Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index f942f697f7253f331beb68124ff9716ad032725e..d38121760acd4b9e538a56dadc90e0f7f5c9118c 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -3230,11 +3230,13 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
- // Push the builtins object as receiver. |
+ // Push function. |
+ __ LoadNativeContextSlot(expr->context_index(), rax); |
+ PushOperand(rax); |
+ |
+ // Push undefined as receiver. |
OperandStackDepthIncrement(1); |
__ PushRoot(Heap::kUndefinedValueRootIndex); |
- |
- __ LoadNativeContextSlot(expr->context_index(), rax); |
} |
@@ -3257,13 +3259,8 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
if (expr->is_jsruntime()) { |
Comment cmnt(masm_, "[ CallRuntime"); |
- |
EmitLoadJSRuntimeFunction(expr); |
- // Push the target function under the receiver. |
- PushOperand(Operand(rsp, 0)); |
- __ movp(Operand(rsp, kPointerSize), rax); |
- |
// Push the arguments ("left-to-right"). |
for (int i = 0; i < arg_count; i++) { |
VisitForStackValue(args->at(i)); |