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

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

Issue 2051073004: Remove more dead code now that legacy const is gone (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 build, add mips64 Created 4 years, 6 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/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | 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 044cf16f664946c1d525787522ce65372e530ff6..a7e71c477d34ad2b8dbb8498f2549d1c3fa32080 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -759,6 +759,7 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
break;
case VariableLocation::LOOKUP: {
DCHECK(IsDeclaredVariableMode(mode));
+ DCHECK(!hole_init);
register_allocator()->PrepareForConsecutiveAllocations(3);
Register name = register_allocator()->NextConsecutiveRegister();
@@ -766,16 +767,9 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
Register attributes = register_allocator()->NextConsecutiveRegister();
builder()->LoadLiteral(variable->name()).StoreAccumulatorInRegister(name);
- if (hole_init) {
- builder()->LoadTheHole().StoreAccumulatorInRegister(init_value);
- } else {
- // For variables, we must not use an initial value (such as 'undefined')
- // because we may have a (legal) redeclaration and we must not destroy
- // the current value.
- builder()
- ->LoadLiteral(Smi::FromInt(0))
- .StoreAccumulatorInRegister(init_value);
- }
+ builder()
+ ->LoadLiteral(Smi::FromInt(0))
+ .StoreAccumulatorInRegister(init_value);
builder()
->LoadLiteral(Smi::FromInt(variable->DeclarationPropertyAttributes()))
.StoreAccumulatorInRegister(attributes)
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698