| Index: src/compiler/x64/code-generator-x64.cc
|
| diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
|
| index 30c43d6041cee2c72838afe35a93d9ebf12a1075..f415beef2f07a3590acb9e9f7c7aa998691983af 100644
|
| --- a/src/compiler/x64/code-generator-x64.cc
|
| +++ b/src/compiler/x64/code-generator-x64.cc
|
| @@ -226,9 +226,12 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| }
|
| break;
|
| case kArchCallJSFunction: {
|
| - // TODO(jarin) The load of the context should be separated from the call.
|
| Register func = i.InputRegister(0);
|
| - __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset));
|
| + if (FLAG_debug_code) {
|
| + // Check the function's context matches the context argument.
|
| + __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset));
|
| + __ Assert(equal, kWrongFunctionContext);
|
| + }
|
| __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset));
|
| AddSafepointAndDeopt(instr);
|
| break;
|
| @@ -859,7 +862,7 @@ void CodeGenerator::AssembleReturn() {
|
| __ movq(rsp, rbp); // Move stack pointer back to frame pointer.
|
| __ popq(rbp); // Pop caller's frame pointer.
|
| int pop_count =
|
| - descriptor->IsJSFunctionCall() ? descriptor->ParameterCount() : 0;
|
| + descriptor->IsJSFunctionCall() ? descriptor->JSParamCount() : 0;
|
| __ ret(pop_count * kPointerSize);
|
| }
|
| }
|
|
|