Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 30f6e05257695d59825d9a2e5f578ec9eb4b5f7e..e99c9e35cd533e65fcfcb57d9f35bf0ecea23ddb 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -218,17 +218,18 @@ bool LCodeGen::GeneratePrologue() { |
if (heap_slots > 0) { |
Comment(";;; Allocate local context"); |
// Argument to NewContext is the function, which is still in rdi. |
- __ push(rdi); |
if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
FastNewContextStub stub(heap_slots); |
__ CallStub(&stub); |
} else { |
+ __ push(rdi); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
RecordSafepoint(Safepoint::kNoLazyDeopt); |
- // Context is returned in both rax and rsi. It replaces the context |
- // passed to us. It's saved in the stack and kept live in rsi. |
- __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |
+ // Context is returned in rax. It replaces the context passed to us. |
+ // It's saved in the stack and kept live in rsi. |
+ __ movp(rsi, rax); |
+ __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); |
// Copy any necessary parameters into the context. |
int num_parameters = scope()->num_parameters(); |