Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index 3dece9cb134e71ed7dffbf3f05077b23d9de9a28..f6d68ba75ee423346ccbaf241e3df6f962a57990 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -2922,83 +2922,38 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) { |
} |
-void FullCodeGenerator::VisitCall(Call* expr) { |
-#ifdef DEBUG |
- // We want to verify that RecordJSReturnSite gets called on all paths |
- // through this function. Avoid early returns. |
- expr->return_is_recorded_ = false; |
-#endif |
- |
- Comment cmnt(masm_, "[ Call"); |
- Expression* callee = expr->expression(); |
- Call::CallType call_type = expr->GetCallType(isolate()); |
- |
- if (call_type == Call::POSSIBLY_EVAL_CALL) { |
- // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval |
- // to resolve the function we need to call. Then we call the resolved |
- // function using the given arguments. |
- ZoneList<Expression*>* args = expr->arguments(); |
- int arg_count = args->length(); |
+void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { |
+ // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval |
+ // to resolve the function we need to call. Then we call the resolved |
+ // function using the given arguments. |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ int arg_count = args->length(); |
- PushCalleeAndWithBaseObject(expr); |
+ PushCalleeAndWithBaseObject(expr); |
- // Push the arguments. |
- for (int i = 0; i < arg_count; i++) { |
- VisitForStackValue(args->at(i)); |
- } |
+ // Push the arguments. |
+ for (int i = 0; i < arg_count; i++) { |
+ VisitForStackValue(args->at(i)); |
+ } |
- // Push a copy of the function (found below the arguments) and |
- // resolve eval. |
- __ push(Operand(esp, (arg_count + 1) * kPointerSize)); |
- EmitResolvePossiblyDirectEval(arg_count); |
+ // Push a copy of the function (found below the arguments) and |
+ // resolve eval. |
+ __ push(Operand(esp, (arg_count + 1) * kPointerSize)); |
+ EmitResolvePossiblyDirectEval(arg_count); |
- // Touch up the stack with the resolved function. |
- __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax); |
+ // Touch up the stack with the resolved function. |
+ __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax); |
- PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
+ PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
- SetCallPosition(expr, arg_count); |
- CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
- __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
- __ CallStub(&stub); |
- RecordJSReturnSite(expr); |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
- context()->DropAndPlug(1, eax); |
- |
- } else if (call_type == Call::GLOBAL_CALL) { |
- EmitCallWithLoadIC(expr); |
- } else if (call_type == Call::LOOKUP_SLOT_CALL) { |
- // Call to a lookup slot (dynamically introduced variable). |
- PushCalleeAndWithBaseObject(expr); |
- EmitCall(expr); |
- } else if (call_type == Call::NAMED_PROPERTY_CALL) { |
- Property* property = callee->AsProperty(); |
- VisitForStackValue(property->obj()); |
- EmitCallWithLoadIC(expr); |
- } else if (call_type == Call::KEYED_PROPERTY_CALL) { |
- Property* property = callee->AsProperty(); |
- VisitForStackValue(property->obj()); |
- EmitKeyedCallWithLoadIC(expr, property->key()); |
- } else if (call_type == Call::NAMED_SUPER_PROPERTY_CALL) { |
- EmitSuperCallWithLoadIC(expr); |
- } else if (call_type == Call::KEYED_SUPER_PROPERTY_CALL) { |
- EmitKeyedSuperCallWithLoadIC(expr); |
- } else if (call_type == Call::SUPER_CALL) { |
- EmitSuperConstructorCall(expr); |
- } else { |
- DCHECK(call_type == Call::OTHER_CALL); |
- // Call to an arbitrary expression not handled specially above. |
- VisitForStackValue(callee); |
- __ push(Immediate(isolate()->factory()->undefined_value())); |
- // Emit function call. |
- EmitCall(expr); |
- } |
- |
-#ifdef DEBUG |
- // RecordJSReturnSite should have been called. |
- DCHECK(expr->return_is_recorded_); |
-#endif |
+ SetCallPosition(expr, arg_count); |
+ CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
+ __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
+ __ CallStub(&stub); |
+ RecordJSReturnSite(expr); |
+ // Restore context register. |
+ __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ context()->DropAndPlug(1, eax); |
} |