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

Side by Side Diff: src/arm/stub-cache-arm.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 | « no previous file | src/ia32/stub-cache-ia32.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 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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 return GetCode(CALLBACKS, name); 3114 return GetCode(CALLBACKS, name);
3115 } 3115 }
3116 3116
3117 3117
3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { 3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) {
3119 // ----------- S t a t e ------------- 3119 // ----------- S t a t e -------------
3120 // -- lr : return address 3120 // -- lr : return address
3121 // -- r0 : key 3121 // -- r0 : key
3122 // -- r1 : receiver 3122 // -- r1 : receiver
3123 // ----------------------------------- 3123 // -----------------------------------
3124 MaybeObject* maybe_stub;
3125 if (receiver_map->has_fast_elements()) {
3126 maybe_stub = KeyedLoadFastElementStub().TryGetCode();
3127 } else {
3128 ASSERT(receiver_map->has_external_array_elements());
3129 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3130 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode();
3131 }
3132 Code* stub; 3124 Code* stub;
3125 MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map);
3133 if (!maybe_stub->To(&stub)) return maybe_stub; 3126 if (!maybe_stub->To(&stub)) return maybe_stub;
3134 __ DispatchMap(r1, 3127 __ DispatchMap(r1,
3135 r2, 3128 r2,
3136 Handle<Map>(receiver_map), 3129 Handle<Map>(receiver_map),
3137 Handle<Code>(stub), 3130 Handle<Code>(stub),
3138 DO_SMI_CHECK); 3131 DO_SMI_CHECK);
3139 3132
3140 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3133 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3141 __ Jump(ic, RelocInfo::CODE_TARGET); 3134 __ Jump(ic, RelocInfo::CODE_TARGET);
3142 3135
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
3206 3199
3207 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4); 3200 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4);
3208 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); 3201 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
3209 __ Jump(ic, RelocInfo::CODE_TARGET); 3202 __ Jump(ic, RelocInfo::CODE_TARGET);
3210 3203
3211 // Return the generated code. 3204 // Return the generated code.
3212 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); 3205 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
3213 } 3206 }
3214 3207
3215 3208
3216 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( 3209 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) {
3217 Map* receiver_map) {
3218 // ----------- S t a t e ------------- 3210 // ----------- S t a t e -------------
3219 // -- r0 : value 3211 // -- r0 : value
3220 // -- r1 : key 3212 // -- r1 : key
3221 // -- r2 : receiver 3213 // -- r2 : receiver
3222 // -- lr : return address 3214 // -- lr : return address
3223 // -- r3 : scratch 3215 // -- r3 : scratch
3224 // ----------------------------------- 3216 // -----------------------------------
3225 MaybeObject* maybe_stub;
3226 if (receiver_map->has_fast_elements()) {
3227 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
3228 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode();
3229 } else {
3230 ASSERT(receiver_map->has_external_array_elements());
3231 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3232 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode();
3233 }
3234 Code* stub; 3217 Code* stub;
3218 MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map);
3235 if (!maybe_stub->To(&stub)) return maybe_stub; 3219 if (!maybe_stub->To(&stub)) return maybe_stub;
3236 __ DispatchMap(r2, 3220 __ DispatchMap(r2,
3237 r3, 3221 r3,
3238 Handle<Map>(receiver_map), 3222 Handle<Map>(receiver_map),
3239 Handle<Code>(stub), 3223 Handle<Code>(stub),
3240 DO_SMI_CHECK); 3224 DO_SMI_CHECK);
3241 3225
3242 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); 3226 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
3243 __ Jump(ic, RelocInfo::CODE_TARGET); 3227 __ Jump(ic, RelocInfo::CODE_TARGET);
3244 3228
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
4212 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4196 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4213 __ Jump(ic, RelocInfo::CODE_TARGET); 4197 __ Jump(ic, RelocInfo::CODE_TARGET);
4214 } 4198 }
4215 4199
4216 4200
4217 #undef __ 4201 #undef __
4218 4202
4219 } } // namespace v8::internal 4203 } } // namespace v8::internal
4220 4204
4221 #endif // V8_TARGET_ARCH_ARM 4205 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698