diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index c89be45623..bbb30a497a 100644 --- a/src/compiler/ast-graph-builder.cc +++ b/src/compiler/ast-graph-builder.cc @@ -1092,14 +1092,11 @@ void AstGraphBuilder::VisitVariableDeclaration(VariableDeclaration* decl) { bool hole_init = mode == CONST || mode == LET; switch (variable->location()) { case VariableLocation::GLOBAL: - case VariableLocation::UNALLOCATED: { - Handle value = variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(); + case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals()->push_back(variable->name()); - globals()->push_back(value); + globals()->push_back(isolate()->factory()->undefined_value()); break; - } case VariableLocation::PARAMETER: case VariableLocation::LOCAL: if (hole_init) { diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc index 4c7721af37..67b7540475 100644 --- a/src/crankshaft/hydrogen.cc +++ b/src/crankshaft/hydrogen.cc @@ -12296,10 +12296,9 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_.Add(variable->name(), zone()); - globals_.Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), zone()); + globals_.Add(isolate()->factory()->undefined_value(), zone()); return; case VariableLocation::PARAMETER: case VariableLocation::LOCAL: diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc index 07eab401a2..a485f16781 100644 --- a/src/full-codegen/arm/full-codegen-arm.cc +++ b/src/full-codegen/arm/full-codegen-arm.cc @@ -768,11 +768,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc index 5111c87146..aafcd674ca 100644 --- a/src/full-codegen/arm64/full-codegen-arm64.cc +++ b/src/full-codegen/arm64/full-codegen-arm64.cc @@ -765,11 +765,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc index 340bdd5be8..b408a4850c 100644 --- a/src/full-codegen/ia32/full-codegen-ia32.cc +++ b/src/full-codegen/ia32/full-codegen-ia32.cc @@ -715,10 +715,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc index 648566ccf8..66229237dd 100644 --- a/src/full-codegen/mips/full-codegen-mips.cc +++ b/src/full-codegen/mips/full-codegen-mips.cc @@ -765,11 +765,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc index 124557544e..8e69ca5317 100644 --- a/src/full-codegen/mips64/full-codegen-mips64.cc +++ b/src/full-codegen/mips64/full-codegen-mips64.cc @@ -764,11 +764,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc index 7a2a0c5c64..3117d28772 100644 --- a/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/src/full-codegen/ppc/full-codegen-ppc.cc @@ -730,11 +730,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc index 776f8d9ddc..5341b4dfe8 100644 --- a/src/full-codegen/s390/full-codegen-s390.cc +++ b/src/full-codegen/s390/full-codegen-s390.cc @@ -708,11 +708,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc index bdfda31b0d..74dbdf08ae 100644 --- a/src/full-codegen/x64/full-codegen-x64.cc +++ b/src/full-codegen/x64/full-codegen-x64.cc @@ -727,11 +727,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), - zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc index 8da0e909ea..ee05f1393a 100644 --- a/src/full-codegen/x87/full-codegen-x87.cc +++ b/src/full-codegen/x87/full-codegen-x87.cc @@ -712,10 +712,9 @@ void FullCodeGenerator::VisitVariableDeclaration( switch (variable->location()) { case VariableLocation::GLOBAL: case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals_->Add(variable->name(), zone()); - globals_->Add(variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(), zone()); + globals_->Add(isolate()->factory()->undefined_value(), zone()); break; case VariableLocation::PARAMETER: diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc index 10e3f90317..f1558ea17a 100644 --- a/src/interpreter/bytecode-generator.cc +++ b/src/interpreter/bytecode-generator.cc @@ -747,14 +747,11 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) { bool hole_init = mode == CONST || mode == LET; switch (variable->location()) { case VariableLocation::GLOBAL: - case VariableLocation::UNALLOCATED: { - Handle value = variable->binding_needs_init() - ? isolate()->factory()->the_hole_value() - : isolate()->factory()->undefined_value(); + case VariableLocation::UNALLOCATED: + DCHECK(!variable->binding_needs_init()); globals()->push_back(variable->name()); - globals()->push_back(value); + globals()->push_back(isolate()->factory()->undefined_value()); break; - } case VariableLocation::LOCAL: if (hole_init) { Register destination(variable->index());