Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2422)

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1964993002: [cleanup] Global variable declarations are never hole initialized (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 10e3f903179f8c97bf4a15cf51892ac11c98b574..f1558ea17a2e8bcf770b953338fbd4c0ceafac29 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<Oddball> 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());
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698