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

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: Rename for clarity 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 2b9357144eac55bc94072230d6080db0fb275d60..538160ffce07b77d63b6d23b971ca858ad538e15 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -757,22 +757,16 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) {
}
break;
case VariableLocation::LOOKUP: {
- DCHECK(IsDeclaredVariableMode(mode));
+ DCHECK_EQ(VAR, mode);
DCHECK(!hole_init);
- register_allocator()->PrepareForConsecutiveAllocations(3);
+ register_allocator()->PrepareForConsecutiveAllocations(1);
Michael Starzinger 2016/06/14 14:47:32 nit: For a single register, there is no need to pr
adamk 2016/06/14 14:59:43 Done.
Register name = register_allocator()->NextConsecutiveRegister();
Michael Starzinger 2016/06/14 14:47:32 nit: This can be just register_allocator()->NewReg
adamk 2016/06/14 14:59:43 Done.
- Register init_value = register_allocator()->NextConsecutiveRegister();
- Register attributes = register_allocator()->NextConsecutiveRegister();
- 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 +802,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);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698