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

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

Issue 88043002: Out-of-line constant pool on Arm: Stage 3 - Set Constant Pool Pointer on Function Entry (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Re-upload to fix code-review error. Created 7 years 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
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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 // -- sp[(argc + 6) * 4] : first JS argument 840 // -- sp[(argc + 6) * 4] : first JS argument
841 // -- sp[(argc + 7) * 4] : receiver 841 // -- sp[(argc + 7) * 4] : receiver
842 // ----------------------------------- 842 // -----------------------------------
843 typedef FunctionCallbackArguments FCA; 843 typedef FunctionCallbackArguments FCA;
844 // Save calling context. 844 // Save calling context.
845 __ str(cp, MemOperand(sp, FCA::kContextSaveIndex * kPointerSize)); 845 __ str(cp, MemOperand(sp, FCA::kContextSaveIndex * kPointerSize));
846 // Get the function and setup the context. 846 // Get the function and setup the context.
847 Handle<JSFunction> function = optimization.constant_function(); 847 Handle<JSFunction> function = optimization.constant_function();
848 __ Move(r5, function); 848 __ Move(r5, function);
849 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); 849 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset));
850 __ LoadConstantPoolPointer(r5);
850 __ str(r5, MemOperand(sp, FCA::kCalleeIndex * kPointerSize)); 851 __ str(r5, MemOperand(sp, FCA::kCalleeIndex * kPointerSize));
851 852
852 // Construct the FunctionCallbackInfo. 853 // Construct the FunctionCallbackInfo.
853 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 854 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
854 Handle<Object> call_data(api_call_info->data(), masm->isolate()); 855 Handle<Object> call_data(api_call_info->data(), masm->isolate());
855 if (masm->isolate()->heap()->InNewSpace(*call_data)) { 856 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
856 __ Move(r0, api_call_info); 857 __ Move(r0, api_call_info);
857 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); 858 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset));
858 } else { 859 } else {
859 __ Move(r6, call_data); 860 __ Move(r6, call_data);
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 2756
2756 // Patch the receiver on the stack with the global proxy if 2757 // Patch the receiver on the stack with the global proxy if
2757 // necessary. 2758 // necessary.
2758 if (object->IsGlobalObject()) { 2759 if (object->IsGlobalObject()) {
2759 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 2760 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
2760 __ str(r3, MemOperand(sp, argc * kPointerSize)); 2761 __ str(r3, MemOperand(sp, argc * kPointerSize));
2761 } 2762 }
2762 2763
2763 // Set up the context (function already in r1). 2764 // Set up the context (function already in r1).
2764 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 2765 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
2766 __ LoadConstantPoolPointer(r1);
2765 2767
2766 // Jump to the cached code (tail call). 2768 // Jump to the cached code (tail call).
2767 Counters* counters = isolate()->counters(); 2769 Counters* counters = isolate()->counters();
2768 __ IncrementCounter(counters->call_global_inline(), 1, r3, r4); 2770 __ IncrementCounter(counters->call_global_inline(), 1, r3, r4);
2769 ParameterCount expected(function->shared()->formal_parameter_count()); 2771 ParameterCount expected(function->shared()->formal_parameter_count());
2770 CallKind call_kind = CallICBase::Contextual::decode(extra_state_) 2772 CallKind call_kind = CallICBase::Contextual::decode(extra_state_)
2771 ? CALL_AS_FUNCTION 2773 ? CALL_AS_FUNCTION
2772 : CALL_AS_METHOD; 2774 : CALL_AS_METHOD;
2773 // We call indirectly through the code field in the function to 2775 // We call indirectly through the code field in the function to
2774 // allow recompilation to take effect without changing any of the 2776 // allow recompilation to take effect without changing any of the
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 // If we generate a global code snippet for deoptimization only, remember 2863 // If we generate a global code snippet for deoptimization only, remember
2862 // the place to continue after deoptimization. 2864 // the place to continue after deoptimization.
2863 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); 2865 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2864 } 2866 }
2865 2867
2866 // We have to return the passed value, not the return value of the setter. 2868 // We have to return the passed value, not the return value of the setter.
2867 __ pop(r0); 2869 __ pop(r0);
2868 2870
2869 // Restore context register. 2871 // Restore context register.
2870 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2872 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2873 __ RestoreConstantPoolPointer();
2871 } 2874 }
2872 __ Ret(); 2875 __ Ret();
2873 } 2876 }
2874 2877
2875 2878
2876 #undef __ 2879 #undef __
2877 #define __ ACCESS_MASM(masm()) 2880 #define __ ACCESS_MASM(masm())
2878 2881
2879 2882
2880 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( 2883 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 ParameterCount actual(0); 2997 ParameterCount actual(0);
2995 ParameterCount expected(getter); 2998 ParameterCount expected(getter);
2996 __ InvokeFunction(getter, expected, actual, 2999 __ InvokeFunction(getter, expected, actual,
2997 CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); 3000 CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
2998 } else { 3001 } else {
2999 // If we generate a global code snippet for deoptimization only, remember 3002 // If we generate a global code snippet for deoptimization only, remember
3000 // the place to continue after deoptimization. 3003 // the place to continue after deoptimization.
3001 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); 3004 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
3002 } 3005 }
3003 3006
3004 // Restore context register. 3007 // Restore context and pointer pool register.
3005 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3008 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3009 __ RestoreConstantPoolPointer();
3006 } 3010 }
3007 __ Ret(); 3011 __ Ret();
3008 } 3012 }
3009 3013
3010 3014
3011 #undef __ 3015 #undef __
3012 #define __ ACCESS_MASM(masm()) 3016 #define __ ACCESS_MASM(masm())
3013 3017
3014 3018
3015 Handle<Code> LoadStubCompiler::CompileLoadGlobal( 3019 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 // ----------------------------------- 3171 // -----------------------------------
3168 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 3172 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
3169 } 3173 }
3170 3174
3171 3175
3172 #undef __ 3176 #undef __
3173 3177
3174 } } // namespace v8::internal 3178 } } // namespace v8::internal
3175 3179
3176 #endif // V8_TARGET_ARCH_ARM 3180 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698