| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 18dfa0c302fe9739e7a4ef827284d1703f6781eb..856db116a88d57d95974a8b45c9129c63c286307 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -4540,17 +4540,11 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
|
|
|
|
|
| void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
|
| - InlineFunctionGenerator generator = FindInlineFunctionGenerator(expr);
|
| - if (generator != nullptr) {
|
| - Comment cmnt(masm_, "[ InlineRuntimeCall");
|
| - EmitInlineRuntimeCall(expr, generator);
|
| - return;
|
| - }
|
| -
|
| - Comment cmnt(masm_, "[ CallRuntime");
|
| ZoneList<Expression*>* args = expr->arguments();
|
| + int arg_count = args->length();
|
|
|
| if (expr->is_jsruntime()) {
|
| + Comment cmnt(masm_, "[ CallRuntime");
|
| // Push the builtins object as receiver.
|
| __ mov(eax, GlobalObjectOperand());
|
| __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset));
|
| @@ -4570,9 +4564,7 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
|
| __ push(Operand(esp, 0));
|
| __ mov(Operand(esp, kPointerSize), eax);
|
|
|
| - // Code common for calls using the IC.
|
| - ZoneList<Expression*>* args = expr->arguments();
|
| - int arg_count = args->length();
|
| + // Push the arguments ("left-to-right").
|
| for (int i = 0; i < arg_count; i++) {
|
| VisitForStackValue(args->at(i));
|
| }
|
| @@ -4582,21 +4574,33 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
|
| CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
|
| __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
|
| __ CallStub(&stub);
|
| +
|
| // Restore context register.
|
| __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
| context()->DropAndPlug(1, eax);
|
|
|
| } else {
|
| - // Push the arguments ("left-to-right").
|
| - int arg_count = args->length();
|
| - for (int i = 0; i < arg_count; i++) {
|
| - VisitForStackValue(args->at(i));
|
| - }
|
| -
|
| - // Call the C runtime function.
|
| - __ CallRuntime(expr->function(), arg_count);
|
| + const Runtime::Function* function = expr->function();
|
| + switch (function->function_id) {
|
| +#define CALL_INTRINSIC_GENERATOR(Name) \
|
| + case Runtime::kInline##Name: { \
|
| + Comment cmnt(masm_, "[ Inline" #Name); \
|
| + return Emit##Name(expr); \
|
| + }
|
| + FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR)
|
| +#undef CALL_INTRINSIC_GENERATOR
|
| + default: {
|
| + Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic");
|
| + // Push the arguments ("left-to-right").
|
| + for (int i = 0; i < arg_count; i++) {
|
| + VisitForStackValue(args->at(i));
|
| + }
|
|
|
| - context()->Plug(eax);
|
| + // Call the C runtime function.
|
| + __ CallRuntime(expr->function(), arg_count);
|
| + context()->Plug(eax);
|
| + }
|
| + }
|
| }
|
| }
|
|
|
|
|