Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index 894a64a2ee657f5c23b9b79ddaad84cf1febc17d..5256b1a7a1f5b01178843eb4d476eb693a955fbb 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -823,13 +823,9 @@ void FullCodeGenerator::VisitVariableDeclaration( |
case VariableLocation::LOOKUP: { |
Comment cmnt(masm_, "[ VariableDeclaration"); |
- __ Push(rsi); |
__ Push(variable->name()); |
// Declaration nodes are always introduced in one of four modes. |
DCHECK(IsDeclaredVariableMode(mode)); |
- PropertyAttributes attr = |
- IsImmutableVariableMode(mode) ? READ_ONLY : NONE; |
- __ Push(Smi::FromInt(attr)); |
// Push initial value, if any. |
// Note: For variables we must not push an initial value (such as |
// 'undefined') because we may have a (legal) redeclaration and we |
@@ -839,7 +835,10 @@ void FullCodeGenerator::VisitVariableDeclaration( |
} else { |
__ Push(Smi::FromInt(0)); // Indicates no initial value. |
} |
- __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
+ __ CallRuntime(IsImmutableVariableMode(mode) |
+ ? Runtime::kDeclareReadOnlyLookupSlot |
+ : Runtime::kDeclareLookupSlot, |
+ 2); |
break; |
} |
} |
@@ -890,11 +889,9 @@ void FullCodeGenerator::VisitFunctionDeclaration( |
case VariableLocation::LOOKUP: { |
Comment cmnt(masm_, "[ FunctionDeclaration"); |
- __ Push(rsi); |
__ Push(variable->name()); |
- __ Push(Smi::FromInt(NONE)); |
VisitForStackValue(declaration->fun()); |
- __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
+ __ CallRuntime(Runtime::kDeclareLookupSlot, 2); |
break; |
} |
} |
@@ -903,10 +900,9 @@ void FullCodeGenerator::VisitFunctionDeclaration( |
void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
// Call the runtime to declare the globals. |
- __ Push(rsi); // The context is the first argument. |
__ Push(pairs); |
__ Push(Smi::FromInt(DeclareGlobalsFlags())); |
- __ CallRuntime(Runtime::kDeclareGlobals, 3); |
+ __ CallRuntime(Runtime::kDeclareGlobals, 2); |
// Return value is ignored. |
} |