Chromium Code Reviews| Index: src/compiler/fast-accessor-assembler.cc |
| diff --git a/src/compiler/fast-accessor-assembler.cc b/src/compiler/fast-accessor-assembler.cc |
| index 518003b2eedb0d8885b27bd599dd6fb63e74ae71..1a97fd5337e6cc6aa9af729cb94a3bdb1f056b8e 100644 |
| --- a/src/compiler/fast-accessor-assembler.cc |
| +++ b/src/compiler/fast-accessor-assembler.cc |
| @@ -5,7 +5,7 @@ |
| #include "src/compiler/fast-accessor-assembler.h" |
| #include "src/base/logging.h" |
| -#include "src/code-stubs.h" // For CallApiFunctionStub. |
| +#include "src/code-stubs.h" // For CallApiCallbackStub. |
| #include "src/compiler/graph.h" |
| #include "src/compiler/linkage.h" |
| #include "src/compiler/pipeline.h" |
| @@ -172,7 +172,8 @@ FastAccessorAssembler::ValueId FastAccessorAssembler::Call( |
| CHECK_EQ(kBuilding, state_); |
| // Create API function stub. |
| - CallApiFunctionStub stub(assembler_->isolate(), true); |
| + CallApiCallbackStub stub(assembler_->isolate(), 1, true); |
| + DCHECK_EQ(1, stub.GetCallInterfaceDescriptor().GetStackParameterCount()); |
| // Wrap the FunctionCallback in an ExternalReference. |
| ApiFunction callback_api_function(FUNCTION_ADDR(callback_function)); |
| @@ -180,30 +181,27 @@ FastAccessorAssembler::ValueId FastAccessorAssembler::Call( |
| ExternalReference::DIRECT_API_CALL, |
| assembler_->isolate()); |
| - // The stub has 5 parameters, and kJSParam (here: 1) parameters to pass |
| - // through to the callback. |
| - // See: ApiFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType |
| - static const int kStackParam = 1; |
| + // The stub has 6 parameters. |
| + // See: ApiCallbackDescriptorBase::BuildCallInterfaceDescriptorFunctionType |
| Node* args[] = { |
| // Stub/register parameters: |
| - assembler_->Parameter(0), /* receiver (use accessor's) */ |
| - assembler_->UndefinedConstant(), /* call_data (undefined) */ |
| - assembler_->NullConstant(), /* holder (null) */ |
| - assembler_->ExternalConstant(callback), /* API callback function */ |
| - assembler_->IntPtrConstant(kStackParam), /* # JS arguments */ |
| + assembler_->Parameter(0), /* receiver (use accessor's) */ |
| + assembler_->UndefinedConstant(), /* call_data (undefined) */ |
| + assembler_->NullConstant(), /* holder (null) */ |
| + assembler_->ExternalConstant(callback), /* API callback function */ |
| - // kStackParam stack parameter(s): |
| + // JS arguments, on stack: |
| FromId(arg), |
| // Context parameter. (See Linkage::GetStubCallDescriptor.) |
| assembler_->UndefinedConstant()}; |
|
danno
2016/03/09 10:23:38
It might be slightly more efficient to pass Smi(0)
vogelheim
2016/03/09 11:09:35
Ack. But: The point of this CL is to enable moving
|
| - CHECK_EQ(5 + kStackParam + 1, arraysize(args)); |
| + DCHECK_EQ(arraysize(args), |
| + 1 + stub.GetCallInterfaceDescriptor().GetParameterCount()); |
| Node* call = assembler_->CallN( |
| Linkage::GetStubCallDescriptor( |
| assembler_->isolate(), zone(), stub.GetCallInterfaceDescriptor(), |
| - kStackParam + stub.GetStackParameterCount(), |
| - CallDescriptor::kNoFlags), |
| + stub.GetStackParameterCount(), CallDescriptor::kNoFlags), |
| assembler_->HeapConstant(stub.GetCode()), args); |
| return FromRaw(call); |
| } |