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

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

Issue 2061173002: [cleanup] Remove dead code from DeclareLookupSlot and rename it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handled review comments 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/parsing/parser.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 2b9357144eac55bc94072230d6080db0fb275d60..2d95b82fbc7dd50f0c92d07b2ee61dca256abcf5 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -757,22 +757,15 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
}
break;
case VariableLocation::LOOKUP: {
- DCHECK(IsDeclaredVariableMode(mode));
+ DCHECK_EQ(VAR, mode);
DCHECK(!hole_init);
- register_allocator()->PrepareForConsecutiveAllocations(3);
- Register name = register_allocator()->NextConsecutiveRegister();
- Register init_value = register_allocator()->NextConsecutiveRegister();
- Register attributes = register_allocator()->NextConsecutiveRegister();
+ Register name = register_allocator()->NewRegister();
- builder()->LoadLiteral(variable->name()).StoreAccumulatorInRegister(name);
- builder()
- ->LoadLiteral(Smi::FromInt(0))
- .StoreAccumulatorInRegister(init_value);
builder()
- ->LoadLiteral(Smi::FromInt(variable->DeclarationPropertyAttributes()))
- .StoreAccumulatorInRegister(attributes)
- .CallRuntime(Runtime::kDeclareLookupSlot, name, 3);
+ ->LoadLiteral(variable->name())
+ .StoreAccumulatorInRegister(name)
+ .CallRuntime(Runtime::kDeclareEvalVar, name, 1);
break;
}
}
@@ -808,18 +801,14 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) {
break;
}
case VariableLocation::LOOKUP: {
- register_allocator()->PrepareForConsecutiveAllocations(3);
+ register_allocator()->PrepareForConsecutiveAllocations(2);
Register name = register_allocator()->NextConsecutiveRegister();
Register literal = register_allocator()->NextConsecutiveRegister();
- Register attributes = register_allocator()->NextConsecutiveRegister();
builder()->LoadLiteral(variable->name()).StoreAccumulatorInRegister(name);
VisitForAccumulatorValue(decl->fun());
- builder()
- ->StoreAccumulatorInRegister(literal)
- .LoadLiteral(Smi::FromInt(variable->DeclarationPropertyAttributes()))
- .StoreAccumulatorInRegister(attributes)
- .CallRuntime(Runtime::kDeclareLookupSlot, name, 3);
+ builder()->StoreAccumulatorInRegister(literal).CallRuntime(
+ Runtime::kDeclareEvalFunction, name, 2);
}
}
}
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698