Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 00954b8e133c9e8d47b13f0e252d1ed85c84702a..dc1cd51c70a7ff3c84ae62eea6a34267f9cff66f 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -204,17 +204,18 @@ bool LCodeGen::GeneratePrologue() { |
if (heap_slots > 0) { |
Comment(";;; Allocate local context"); |
// Argument to NewContext is the function, which is in a1. |
- __ push(a1); |
if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
FastNewContextStub stub(heap_slots); |
__ CallStub(&stub); |
} else { |
+ __ push(a1); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
RecordSafepoint(Safepoint::kNoLazyDeopt); |
- // Context is returned in both v0 and cp. It replaces the context |
- // passed to us. It's saved in the stack and kept live in cp. |
- __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Context is returned in both v0. It replaces the context passed to us. |
+ // It's saved in the stack and kept live in cp. |
+ __ mov(cp, v0); |
+ __ sw(v0, 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++) { |