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..a489615f3f1c4f91b428a216ba0457d4400feda2 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; |
@@ -858,8 +861,9 @@ void CodeGenerator::AssembleReturn() { |
} else { |
__ 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; |
+ int pop_count = descriptor->IsJSFunctionCall() |
+ ? static_cast<int>(descriptor->JSParameterCount()) |
+ : 0; |
__ ret(pop_count * kPointerSize); |
} |
} |