Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: src/ic/arm/handler-compiler-arm.cc

Issue 836093007: split api call stubs into accessor and function call stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 static void CompileCallLoadPropertyWithInterceptor( 222 static void CompileCallLoadPropertyWithInterceptor(
223 MacroAssembler* masm, Register receiver, Register holder, Register name, 223 MacroAssembler* masm, Register receiver, Register holder, Register name,
224 Handle<JSObject> holder_obj, IC::UtilityId id) { 224 Handle<JSObject> holder_obj, IC::UtilityId id) {
225 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 225 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
226 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), 226 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
227 NamedLoadHandlerCompiler::kInterceptorArgsLength); 227 NamedLoadHandlerCompiler::kInterceptorArgsLength);
228 } 228 }
229 229
230 230
231 // Generate call to api function. 231 // Generate call to api function.
232 void PropertyHandlerCompiler::GenerateFastApiCall( 232 void PropertyHandlerCompiler::GenerateApiAccessorCall(
233 MacroAssembler* masm, const CallOptimization& optimization, 233 MacroAssembler* masm, const CallOptimization& optimization,
234 Handle<Map> receiver_map, Register receiver, Register scratch_in, 234 Handle<Map> receiver_map, Register receiver, Register scratch_in,
235 bool is_store, int argc, Register* values) { 235 bool is_store, Register store_parameter) {
236 DCHECK(!receiver.is(scratch_in)); 236 DCHECK(!receiver.is(scratch_in));
237 __ push(receiver); 237 __ push(receiver);
238 // Write the arguments to stack frame. 238 // Write the arguments to stack frame.
239 for (int i = 0; i < argc; i++) { 239 if (is_store) {
240 Register arg = values[argc - 1 - i]; 240 DCHECK(!receiver.is(store_parameter));
241 DCHECK(!receiver.is(arg)); 241 DCHECK(!scratch_in.is(store_parameter));
242 DCHECK(!scratch_in.is(arg)); 242 __ push(store_parameter);
243 __ push(arg);
244 } 243 }
245 DCHECK(optimization.is_simple_api_call()); 244 DCHECK(optimization.is_simple_api_call());
246 245
247 // Abi for CallApiFunctionStub. 246 // Abi for CallApiFunctionStub.
248 Register callee = r0; 247 Register callee = r0;
249 Register call_data = r4; 248 Register call_data = r4;
250 Register holder = r2; 249 Register holder = r2;
251 Register api_function_address = r1; 250 Register api_function_address = r1;
252 251
253 // Put holder in place. 252 // Put holder in place.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 286 }
288 287
289 // Put api_function_address in place. 288 // Put api_function_address in place.
290 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 289 Address function_address = v8::ToCData<Address>(api_call_info->callback());
291 ApiFunction fun(function_address); 290 ApiFunction fun(function_address);
292 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 291 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
293 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 292 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
294 __ mov(api_function_address, Operand(ref)); 293 __ mov(api_function_address, Operand(ref));
295 294
296 // Jump to stub. 295 // Jump to stub.
297 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); 296 CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
298 __ TailCallStub(&stub); 297 __ TailCallStub(&stub);
299 } 298 }
300 299
301 300
302 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { 301 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
303 // Push receiver, key and value for runtime call. 302 // Push receiver, key and value for runtime call.
304 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 303 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
305 StoreDescriptor::ValueRegister()); 304 StoreDescriptor::ValueRegister());
306 305
307 // The slow case calls into the runtime to complete the store without causing 306 // The slow case calls into the runtime to complete the store without causing
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 // Return the generated code. 730 // Return the generated code.
732 return GetCode(kind(), Code::NORMAL, name); 731 return GetCode(kind(), Code::NORMAL, name);
733 } 732 }
734 733
735 734
736 #undef __ 735 #undef __
737 } 736 }
738 } // namespace v8::internal 737 } // namespace v8::internal
739 738
740 #endif // V8_TARGET_ARCH_ARM 739 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698