Index: src/compiler/ia32/code-generator-ia32.cc |
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc |
index c05c6ea3def31985dc264fc3ccc50b3e5b6fab8b..98b340f8a7dc864f778c53dbf6b9762779cda10f 100644 |
--- a/src/compiler/ia32/code-generator-ia32.cc |
+++ b/src/compiler/ia32/code-generator-ia32.cc |
@@ -132,9 +132,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); |
- __ mov(esi, FieldOperand(func, JSFunction::kContextOffset)); |
+ if (FLAG_debug_code) { |
+ // Check the function's context matches the context argument. |
+ __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); |
+ __ Assert(equal, kWrongFunctionContext); |
+ } |
__ call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
AddSafepointAndDeopt(instr); |
break; |
@@ -790,7 +793,7 @@ void CodeGenerator::AssembleReturn() { |
__ mov(esp, ebp); // Move stack pointer back to frame pointer. |
__ pop(ebp); // Pop caller's frame pointer. |
int pop_count = |
- descriptor->IsJSFunctionCall() ? descriptor->ParameterCount() : 0; |
+ descriptor->IsJSFunctionCall() ? descriptor->JSParamCount() : 0; |
__ ret(pop_count * kPointerSize); |
} |
} |