Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 2b9357144eac55bc94072230d6080db0fb275d60..a5e1dfb387822d2f35482fe1012653ab739e3166 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -763,16 +763,12 @@ void BytecodeGenerator::VisitVariableDeclaration(VariableDeclaration* decl) { |
register_allocator()->PrepareForConsecutiveAllocations(3); |
Michael Starzinger
2016/06/14 11:11:37
nit: s/3/2/ here, only two consecutive register ne
adamk
2016/06/14 11:23:07
Done.
|
Register name = register_allocator()->NextConsecutiveRegister(); |
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); |
+ .StoreAccumulatorInRegister(init_value) |
+ .CallRuntime(Runtime::kDeclareLookupSlot, name, 2); |
break; |
} |
} |
@@ -811,15 +807,11 @@ void BytecodeGenerator::VisitFunctionDeclaration(FunctionDeclaration* decl) { |
register_allocator()->PrepareForConsecutiveAllocations(3); |
Michael Starzinger
2016/06/14 11:11:37
nit: Likewise s/3/2/ here.
adamk
2016/06/14 11:23:07
Done.
|
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::kDeclareLookupSlot, name, 2); |
} |
} |
} |