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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 23549019: store ics for js api accessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 AllowExternalCallThatCantCauseGC scope(masm); 917 AllowExternalCallThatCantCauseGC scope(masm);
918 __ CallApiFunctionAndReturn(ref, 918 __ CallApiFunctionAndReturn(ref,
919 function_address, 919 function_address,
920 thunk_ref, 920 thunk_ref,
921 r1, 921 r1,
922 kStackUnwindSpace, 922 kStackUnwindSpace,
923 kFastApiCallArguments + 1); 923 kFastApiCallArguments + 1);
924 } 924 }
925 925
926 926
927 // Generate call to api function.
928 static void GenerateFastApiCall(MacroAssembler* masm,
929 const CallOptimization& optimization,
930 Register receiver,
931 Register scratch,
932 int argc,
933 Register* values) {
934 ASSERT(!receiver.is(scratch));
935
936 const int stack_space = kFastApiCallArguments + argc + 1;
937 // Assign stack space for the call arguments.
938 __ sub(sp, sp, Operand(stack_space * kPointerSize));
939 // Write holder to stack frame.
940 __ str(receiver, MemOperand(sp, 0));
941 // Write receiver to stack frame.
942 int index = stack_space - 1;
943 __ str(receiver, MemOperand(sp, index * kPointerSize));
944 // Write the arguments to stack frame.
945 for (int i = 0; i < argc; i++) {
946 ASSERT(!receiver.is(values[i]));
947 ASSERT(!scratch.is(values[i]));
948 __ str(receiver, MemOperand(sp, index-- * kPointerSize));
949 }
950
951 GenerateFastApiDirectCall(masm, optimization, argc);
952 }
953
954
927 class CallInterceptorCompiler BASE_EMBEDDED { 955 class CallInterceptorCompiler BASE_EMBEDDED {
928 public: 956 public:
929 CallInterceptorCompiler(StubCompiler* stub_compiler, 957 CallInterceptorCompiler(StubCompiler* stub_compiler,
930 const ParameterCount& arguments, 958 const ParameterCount& arguments,
931 Register name, 959 Register name,
932 Code::ExtraICState extra_ic_state) 960 Code::ExtraICState extra_ic_state)
933 : stub_compiler_(stub_compiler), 961 : stub_compiler_(stub_compiler),
934 arguments_(arguments), 962 arguments_(arguments),
935 name_(name), 963 name_(name),
936 extra_ic_state_(extra_ic_state) {} 964 extra_ic_state_(extra_ic_state) {}
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 1402
1375 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { 1403 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1376 // Return the constant value. 1404 // Return the constant value.
1377 __ LoadObject(r0, value); 1405 __ LoadObject(r0, value);
1378 __ Ret(); 1406 __ Ret();
1379 } 1407 }
1380 1408
1381 1409
1382 void BaseLoadStubCompiler::GenerateLoadCallback( 1410 void BaseLoadStubCompiler::GenerateLoadCallback(
1383 const CallOptimization& call_optimization) { 1411 const CallOptimization& call_optimization) {
1384 ASSERT(call_optimization.is_simple_api_call()); 1412 GenerateFastApiCall(
1385 1413 masm(), call_optimization, receiver(), scratch3(), 0, NULL);
1386 // Assign stack space for the call arguments.
1387 __ sub(sp, sp, Operand((kFastApiCallArguments + 1) * kPointerSize));
1388
1389 int argc = 0;
1390 int api_call_argc = argc + kFastApiCallArguments;
1391 // Write holder to stack frame.
1392 __ str(receiver(), MemOperand(sp, 0));
1393 // Write receiver to stack frame.
1394 __ str(receiver(), MemOperand(sp, api_call_argc * kPointerSize));
1395
1396 GenerateFastApiDirectCall(masm(), call_optimization, argc);
1397 } 1414 }
1398 1415
1399 1416
1400 void BaseLoadStubCompiler::GenerateLoadCallback( 1417 void BaseLoadStubCompiler::GenerateLoadCallback(
1401 Register reg, 1418 Register reg,
1402 Handle<ExecutableAccessorInfo> callback) { 1419 Handle<ExecutableAccessorInfo> callback) {
1403 // Build AccessorInfo::args_ list on the stack and push property name below 1420 // Build AccessorInfo::args_ list on the stack and push property name below
1404 // the exit frame to make GC aware of them and store pointers to them. 1421 // the exit frame to make GC aware of them and store pointers to them.
1405 __ push(receiver()); 1422 __ push(receiver());
1406 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_ 1423 __ mov(scratch2(), sp); // scratch2 = AccessorInfo::args_
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 // Do tail-call to the runtime system. 2803 // Do tail-call to the runtime system.
2787 ExternalReference store_callback_property = 2804 ExternalReference store_callback_property =
2788 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 2805 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
2789 __ TailCallExternalReference(store_callback_property, 4, 1); 2806 __ TailCallExternalReference(store_callback_property, 4, 1);
2790 2807
2791 // Return the generated code. 2808 // Return the generated code.
2792 return GetCode(kind(), Code::CALLBACKS, name); 2809 return GetCode(kind(), Code::CALLBACKS, name);
2793 } 2810 }
2794 2811
2795 2812
2813 Handle<Code> StoreStubCompiler::CompileStoreCallback(
2814 Handle<JSObject> object,
2815 Handle<JSObject> holder,
2816 Handle<Name> name,
2817 const CallOptimization& call_optimization) {
2818 Label success;
2819 HandlerFrontend(object, receiver(), holder, name, &success);
2820 __ bind(&success);
2821
2822 Register values[] = { value() };
2823 GenerateFastApiCall(
2824 masm(), call_optimization, receiver(), scratch3(), 1, values);
2825
2826 // Return the generated code.
2827 return GetCode(kind(), Code::CALLBACKS, name);
2828 }
2829
2830
2796 #undef __ 2831 #undef __
2797 #define __ ACCESS_MASM(masm) 2832 #define __ ACCESS_MASM(masm)
2798 2833
2799 2834
2800 void StoreStubCompiler::GenerateStoreViaSetter( 2835 void StoreStubCompiler::GenerateStoreViaSetter(
2801 MacroAssembler* masm, 2836 MacroAssembler* masm,
2802 Handle<JSFunction> setter) { 2837 Handle<JSFunction> setter) {
2803 // ----------- S t a t e ------------- 2838 // ----------- S t a t e -------------
2804 // -- r0 : value 2839 // -- r0 : value
2805 // -- r1 : receiver 2840 // -- r1 : receiver
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 // ----------------------------------- 3205 // -----------------------------------
3171 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3206 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3172 } 3207 }
3173 3208
3174 3209
3175 #undef __ 3210 #undef __
3176 3211
3177 } } // namespace v8::internal 3212 } } // namespace v8::internal
3178 3213
3179 #endif // V8_TARGET_ARCH_ARM 3214 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698