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

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

Issue 8390045: Handlify CompileStoreCallback, CompileStoreInterceptor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | « src/arm/stub-cache-arm.cc ('k') | src/stub-cache.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 __ bind(&miss); 2718 __ bind(&miss);
2719 __ mov(ecx, Immediate(name)); // restore name 2719 __ mov(ecx, Immediate(name)); // restore name
2720 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2720 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2721 __ jmp(ic, RelocInfo::CODE_TARGET); 2721 __ jmp(ic, RelocInfo::CODE_TARGET);
2722 2722
2723 // Return the generated code. 2723 // Return the generated code.
2724 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); 2724 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name);
2725 } 2725 }
2726 2726
2727 2727
2728 MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, 2728 Handle<Code> StoreStubCompiler::CompileStoreCallback(
2729 AccessorInfo* callback, 2729 Handle<JSObject> object,
2730 String* name) { 2730 Handle<AccessorInfo> callback,
2731 Handle<String> name) {
2731 // ----------- S t a t e ------------- 2732 // ----------- S t a t e -------------
2732 // -- eax : value 2733 // -- eax : value
2733 // -- ecx : name 2734 // -- ecx : name
2734 // -- edx : receiver 2735 // -- edx : receiver
2735 // -- esp[0] : return address 2736 // -- esp[0] : return address
2736 // ----------------------------------- 2737 // -----------------------------------
2737 Label miss; 2738 Label miss;
2738 2739
2739 // Check that the object isn't a smi. 2740 // Check that the object isn't a smi.
2740 __ JumpIfSmi(edx, &miss); 2741 __ JumpIfSmi(edx, &miss);
2741 2742
2742 // Check that the map of the object hasn't changed. 2743 // Check that the map of the object hasn't changed.
2743 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), 2744 __ cmp(FieldOperand(edx, HeapObject::kMapOffset),
2744 Immediate(Handle<Map>(object->map()))); 2745 Immediate(Handle<Map>(object->map())));
2745 __ j(not_equal, &miss); 2746 __ j(not_equal, &miss);
2746 2747
2747 // Perform global security token check if needed. 2748 // Perform global security token check if needed.
2748 if (object->IsJSGlobalProxy()) { 2749 if (object->IsJSGlobalProxy()) {
2749 __ CheckAccessGlobalProxy(edx, ebx, &miss); 2750 __ CheckAccessGlobalProxy(edx, ebx, &miss);
2750 } 2751 }
2751 2752
2752 // Stub never generated for non-global objects that require access 2753 // Stub never generated for non-global objects that require access
2753 // checks. 2754 // checks.
2754 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 2755 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
2755 2756
2756 __ pop(ebx); // remove the return address 2757 __ pop(ebx); // remove the return address
2757 __ push(edx); // receiver 2758 __ push(edx); // receiver
2758 __ push(Immediate(Handle<AccessorInfo>(callback))); // callback info 2759 __ push(Immediate(callback)); // callback info
2759 __ push(ecx); // name 2760 __ push(ecx); // name
2760 __ push(eax); // value 2761 __ push(eax); // value
2761 __ push(ebx); // restore return address 2762 __ push(ebx); // restore return address
2762 2763
2763 // Do tail-call to the runtime system. 2764 // Do tail-call to the runtime system.
2764 ExternalReference store_callback_property = 2765 ExternalReference store_callback_property =
2765 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 2766 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
2766 __ TailCallExternalReference(store_callback_property, 4, 1); 2767 __ TailCallExternalReference(store_callback_property, 4, 1);
2767 2768
2768 // Handle store cache miss. 2769 // Handle store cache miss.
2769 __ bind(&miss); 2770 __ bind(&miss);
2770 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2771 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2771 __ jmp(ic, RelocInfo::CODE_TARGET); 2772 __ jmp(ic, RelocInfo::CODE_TARGET);
2772 2773
2773 // Return the generated code. 2774 // Return the generated code.
2774 return TryGetCode(CALLBACKS, name); 2775 return GetCode(CALLBACKS, name);
2775 } 2776 }
2776 2777
2777 2778
2778 MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, 2779 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
2779 String* name) { 2780 Handle<JSObject> receiver,
2781 Handle<String> name) {
2780 // ----------- S t a t e ------------- 2782 // ----------- S t a t e -------------
2781 // -- eax : value 2783 // -- eax : value
2782 // -- ecx : name 2784 // -- ecx : name
2783 // -- edx : receiver 2785 // -- edx : receiver
2784 // -- esp[0] : return address 2786 // -- esp[0] : return address
2785 // ----------------------------------- 2787 // -----------------------------------
2786 Label miss; 2788 Label miss;
2787 2789
2788 // Check that the object isn't a smi. 2790 // Check that the object isn't a smi.
2789 __ JumpIfSmi(edx, &miss); 2791 __ JumpIfSmi(edx, &miss);
(...skipping 23 matching lines...) Expand all
2813 ExternalReference store_ic_property = 2815 ExternalReference store_ic_property =
2814 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); 2816 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate());
2815 __ TailCallExternalReference(store_ic_property, 4, 1); 2817 __ TailCallExternalReference(store_ic_property, 4, 1);
2816 2818
2817 // Handle store cache miss. 2819 // Handle store cache miss.
2818 __ bind(&miss); 2820 __ bind(&miss);
2819 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2821 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2820 __ jmp(ic, RelocInfo::CODE_TARGET); 2822 __ jmp(ic, RelocInfo::CODE_TARGET);
2821 2823
2822 // Return the generated code. 2824 // Return the generated code.
2823 return TryGetCode(INTERCEPTOR, name); 2825 return GetCode(INTERCEPTOR, name);
2824 } 2826 }
2825 2827
2826 2828
2827 Handle<Code> StoreStubCompiler::CompileStoreGlobal( 2829 Handle<Code> StoreStubCompiler::CompileStoreGlobal(
2828 Handle<GlobalObject> object, 2830 Handle<GlobalObject> object,
2829 Handle<JSGlobalPropertyCell> cell, 2831 Handle<JSGlobalPropertyCell> cell,
2830 Handle<String> name) { 2832 Handle<String> name) {
2831 // ----------- S t a t e ------------- 2833 // ----------- S t a t e -------------
2832 // -- eax : value 2834 // -- eax : value
2833 // -- ecx : name 2835 // -- ecx : name
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
4207 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4209 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4208 __ jmp(ic_miss, RelocInfo::CODE_TARGET); 4210 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
4209 } 4211 }
4210 4212
4211 4213
4212 #undef __ 4214 #undef __
4213 4215
4214 } } // namespace v8::internal 4216 } } // namespace v8::internal
4215 4217
4216 #endif // V8_TARGET_ARCH_IA32 4218 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698