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

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

Issue 7044083: Refactor platform-specific code for determining shared stub for keyed load/stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | « 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 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 __ bind(&miss); 2692 __ bind(&miss);
2693 __ DecrementCounter(counters->keyed_store_field(), 1); 2693 __ DecrementCounter(counters->keyed_store_field(), 1);
2694 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); 2694 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2695 __ jmp(ic, RelocInfo::CODE_TARGET); 2695 __ jmp(ic, RelocInfo::CODE_TARGET);
2696 2696
2697 // Return the generated code. 2697 // Return the generated code.
2698 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); 2698 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
2699 } 2699 }
2700 2700
2701 2701
2702 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( 2702 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) {
2703 Map* receiver_map) {
2704 // ----------- S t a t e ------------- 2703 // ----------- S t a t e -------------
2705 // -- eax : value 2704 // -- eax : value
2706 // -- ecx : key 2705 // -- ecx : key
2707 // -- edx : receiver 2706 // -- edx : receiver
2708 // -- esp[0] : return address 2707 // -- esp[0] : return address
2709 // ----------------------------------- 2708 // -----------------------------------
2710 MaybeObject* maybe_stub;
2711 if (receiver_map->has_fast_elements()) {
2712 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
2713 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode();
2714 } else {
2715 ASSERT(receiver_map->has_external_array_elements());
2716 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
2717 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode();
2718 }
2719 Code* stub; 2709 Code* stub;
2710 MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map);
2720 if (!maybe_stub->To(&stub)) return maybe_stub; 2711 if (!maybe_stub->To(&stub)) return maybe_stub;
2721 __ DispatchMap(edx, 2712 __ DispatchMap(edx,
2722 Handle<Map>(receiver_map), 2713 Handle<Map>(receiver_map),
2723 Handle<Code>(stub), 2714 Handle<Code>(stub),
2724 DO_SMI_CHECK); 2715 DO_SMI_CHECK);
2725 2716
2726 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); 2717 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
2727 __ jmp(ic, RelocInfo::CODE_TARGET); 2718 __ jmp(ic, RelocInfo::CODE_TARGET);
2728 2719
2729 // Return the generated code. 2720 // Return the generated code.
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
3168 return GetCode(CALLBACKS, name); 3159 return GetCode(CALLBACKS, name);
3169 } 3160 }
3170 3161
3171 3162
3172 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { 3163 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) {
3173 // ----------- S t a t e ------------- 3164 // ----------- S t a t e -------------
3174 // -- eax : key 3165 // -- eax : key
3175 // -- edx : receiver 3166 // -- edx : receiver
3176 // -- esp[0] : return address 3167 // -- esp[0] : return address
3177 // ----------------------------------- 3168 // -----------------------------------
3178 MaybeObject* maybe_stub;
3179 if (receiver_map->has_fast_elements()) {
3180 maybe_stub = KeyedLoadFastElementStub().TryGetCode();
3181 } else {
3182 ASSERT(receiver_map->has_external_array_elements());
3183 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3184 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode();
3185 }
3186 Code* stub; 3169 Code* stub;
3170 MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map);
3187 if (!maybe_stub->To(&stub)) return maybe_stub; 3171 if (!maybe_stub->To(&stub)) return maybe_stub;
3188 __ DispatchMap(edx, 3172 __ DispatchMap(edx,
3189 Handle<Map>(receiver_map), 3173 Handle<Map>(receiver_map),
3190 Handle<Code>(stub), 3174 Handle<Code>(stub),
3191 DO_SMI_CHECK); 3175 DO_SMI_CHECK);
3192 3176
3193 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 3177 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
3194 3178
3195 // Return the generated code. 3179 // Return the generated code.
3196 return GetCode(NORMAL, NULL); 3180 return GetCode(NORMAL, NULL);
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
3825 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 3809 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3826 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); 3810 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3827 } 3811 }
3828 3812
3829 3813
3830 #undef __ 3814 #undef __
3831 3815
3832 } } // namespace v8::internal 3816 } } // namespace v8::internal
3833 3817
3834 #endif // V8_TARGET_ARCH_IA32 3818 #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