Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 32d7e60896c01af3d16bc6e05dc17dc72febad0e..2c9b2756ed6683b7a704c6e27b3d803d8b00eb98 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -202,20 +202,22 @@ void FullCodeGenerator::Generate() { |
if (heap_slots > 0) { |
// Argument to NewContext is the function, which is still in r1. |
Comment cmnt(masm_, "[ Allocate context"); |
- __ push(r1); |
if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { |
+ __ push(r1); |
__ Push(info->scope()->GetScopeInfo()); |
__ CallRuntime(Runtime::kNewGlobalContext, 2); |
} else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
FastNewContextStub stub(heap_slots); |
__ CallStub(&stub); |
} else { |
+ __ push(r1); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
function_in_register = false; |
- // Context is returned in both r0 and cp. It replaces the context |
- // passed to us. It's saved in the stack and kept live in cp. |
- __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Context is returned in r0. It replaces the context passed to us. |
+ // It's saved in the stack and kept live in cp. |
+ __ mov(cp, r0); |
+ __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
// Copy any necessary parameters into the context. |
int num_parameters = info->scope()->num_parameters(); |
for (int i = 0; i < num_parameters; i++) { |