| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index fb382d13c1056c624d25d46f750dc3be08b769b6..64df73fe4f89122ed907c5cb31a2d72d1e8abcf1 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -182,20 +182,22 @@ void FullCodeGenerator::Generate() {
|
| if (heap_slots > 0) {
|
| Comment cmnt(masm_, "[ Allocate context");
|
| // Argument to NewContext is the function, which is still in rdi.
|
| - __ push(rdi);
|
| if (FLAG_harmony_scoping && info->scope()->is_global_scope()) {
|
| + __ push(rdi);
|
| __ Push(info->scope()->GetScopeInfo());
|
| __ CallRuntime(Runtime::kNewGlobalContext, 2);
|
| } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
|
| FastNewContextStub stub(heap_slots);
|
| __ CallStub(&stub);
|
| } else {
|
| + __ push(rdi);
|
| __ CallRuntime(Runtime::kNewFunctionContext, 1);
|
| }
|
| function_in_register = false;
|
| - // 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 = info->scope()->num_parameters();
|
|
|