Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 37d5cf945d69281e478681b57434a6f94a9f7d2c..47be6cdf613dd15449a93095ebe34af3abd9de50 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -207,17 +207,18 @@ bool LCodeGen::GeneratePrologue() { |
if (heap_slots > 0) { |
Comment(";;; Allocate local context"); |
// Argument to NewContext is the function, which is in r1. |
- __ push(r1); |
if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
FastNewContextStub stub(heap_slots); |
__ CallStub(&stub); |
} else { |
+ __ push(r1); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
RecordSafepoint(Safepoint::kNoLazyDeopt); |
// 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)); |
+ __ mov(cp, r0); |
+ __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
// Copy any necessary parameters into the context. |
int num_parameters = scope()->num_parameters(); |
for (int i = 0; i < num_parameters; i++) { |