| Index: src/a64/stub-cache-a64.cc
|
| diff --git a/src/a64/stub-cache-a64.cc b/src/a64/stub-cache-a64.cc
|
| index b79b711767ed16675f88a86ff89c5aa6555ff49d..8da93612a118d73efacf51402148ff945882d7bc 100644
|
| --- a/src/a64/stub-cache-a64.cc
|
| +++ b/src/a64/stub-cache-a64.cc
|
| @@ -945,6 +945,35 @@ static void GenerateFastApiDirectCall(MacroAssembler* masm,
|
| }
|
|
|
|
|
| +// Generate call to api function.
|
| +static void GenerateFastApiCall(MacroAssembler* masm,
|
| + const CallOptimization& optimization,
|
| + Register receiver,
|
| + Register scratch,
|
| + int argc,
|
| + Register* values) {
|
| + ASSERT(optimization.is_simple_api_call());
|
| + ASSERT(!AreAliased(receiver, scratch));
|
| +
|
| + const int stack_space = kFastApiCallArguments + argc + 1;
|
| + // Assign stack space for the call arguments.
|
| + __ Claim(stack_space);
|
| + // Write holder to stack frame.
|
| + __ Poke(receiver, 0);
|
| + // Write receiver to stack frame.
|
| + int index = stack_space - 1;
|
| + __ Poke(receiver, index * kPointerSize);
|
| + // Write the arguments to stack frame.
|
| + for (int i = 0; i < argc; i++) {
|
| + // TODO(jbramley): This is broken, but it is broken on ARM too.
|
| + ASSERT(!AreAliased(receiver, scratch, values[i]));
|
| + __ Poke(receiver, index-- * kPointerSize);
|
| + }
|
| +
|
| + GenerateFastApiDirectCall(masm, optimization, argc);
|
| +}
|
| +
|
| +
|
| class CallInterceptorCompiler BASE_EMBEDDED {
|
| public:
|
| CallInterceptorCompiler(StubCompiler* stub_compiler,
|
| @@ -1295,7 +1324,7 @@ Register BaseLoadStubCompiler::CallbackHandlerFrontend(
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| Label* success,
|
| - Handle<ExecutableAccessorInfo> callback) {
|
| + Handle<Object> callback) {
|
| Label miss;
|
|
|
| Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss);
|
| @@ -1386,6 +1415,13 @@ void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
|
|
|
|
|
| void BaseLoadStubCompiler::GenerateLoadCallback(
|
| + const CallOptimization& call_optimization) {
|
| + GenerateFastApiCall(
|
| + masm(), call_optimization, receiver(), scratch3(), 0, NULL);
|
| +}
|
| +
|
| +
|
| +void BaseLoadStubCompiler::GenerateLoadCallback(
|
| Register reg,
|
| Handle<ExecutableAccessorInfo> callback) {
|
| // Build ExecutableAccessorInfo::args_ list on the stack and push property
|
| @@ -2937,7 +2973,7 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
|
|
| // Return the generated code.
|
| - return GetICCode(kind(), Code::INTERCEPTOR, name);
|
| + return GetCode(kind(), Code::INTERCEPTOR, name);
|
| }
|
|
|
|
|
| @@ -3200,6 +3236,24 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
|
| }
|
|
|
|
|
| +Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
| + Handle<JSObject> object,
|
| + Handle<JSObject> holder,
|
| + Handle<Name> name,
|
| + const CallOptimization& call_optimization) {
|
| + Label success;
|
| + HandlerFrontend(object, receiver(), holder, name, &success);
|
| + __ Bind(&success);
|
| +
|
| + Register values[] = { value() };
|
| + GenerateFastApiCall(
|
| + masm(), call_optimization, receiver(), scratch3(), 1, values);
|
| +
|
| + // Return the generated code.
|
| + return GetCode(kind(), Code::CALLBACKS, name);
|
| +}
|
| +
|
| +
|
| #undef __
|
| #define __ ACCESS_MASM(masm)
|
|
|
|
|