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

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

Issue 7003141: MIPS: port Refactor platform-specific code for determining shared stub for keyed load/stores. (Closed)
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
« no previous file with comments | « no previous file | no next file » | 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 3080 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 return GetCode(CALLBACKS, name); 3091 return GetCode(CALLBACKS, name);
3092 } 3092 }
3093 3093
3094 3094
3095 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { 3095 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) {
3096 // ----------- S t a t e ------------- 3096 // ----------- S t a t e -------------
3097 // -- ra : return address 3097 // -- ra : return address
3098 // -- a0 : key 3098 // -- a0 : key
3099 // -- a1 : receiver 3099 // -- a1 : receiver
3100 // ----------------------------------- 3100 // -----------------------------------
3101 MaybeObject* maybe_stub;
3102 if (receiver_map->has_fast_elements()) {
3103 maybe_stub = KeyedLoadFastElementStub().TryGetCode();
3104 } else {
3105 ASSERT(receiver_map->has_external_array_elements());
3106 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3107 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode();
3108 }
3109 Code* stub; 3101 Code* stub;
3102 MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map);
3110 if (!maybe_stub->To(&stub)) return maybe_stub; 3103 if (!maybe_stub->To(&stub)) return maybe_stub;
3111 __ DispatchMap(a1, 3104 __ DispatchMap(a1,
3112 a2, 3105 a2,
3113 Handle<Map>(receiver_map), 3106 Handle<Map>(receiver_map),
3114 Handle<Code>(stub), 3107 Handle<Code>(stub),
3115 DO_SMI_CHECK); 3108 DO_SMI_CHECK);
3116 3109
3117 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3110 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3118 __ Jump(ic, RelocInfo::CODE_TARGET); 3111 __ Jump(ic, RelocInfo::CODE_TARGET);
3119 3112
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 3174
3182 __ DecrementCounter(counters->keyed_store_field(), 1, a3, t0); 3175 __ DecrementCounter(counters->keyed_store_field(), 1, a3, t0);
3183 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); 3176 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss();
3184 __ Jump(ic, RelocInfo::CODE_TARGET); 3177 __ Jump(ic, RelocInfo::CODE_TARGET);
3185 3178
3186 // Return the generated code. 3179 // Return the generated code.
3187 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); 3180 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
3188 } 3181 }
3189 3182
3190 3183
3191 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( 3184 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) {
3192 Map* receiver_map) {
3193 // ----------- S t a t e ------------- 3185 // ----------- S t a t e -------------
3194 // -- a0 : value 3186 // -- a0 : value
3195 // -- a1 : key 3187 // -- a1 : key
3196 // -- a2 : receiver 3188 // -- a2 : receiver
3197 // -- ra : return address 3189 // -- ra : return address
3198 // -- a3 : scratch 3190 // -- a3 : scratch
3199 // ----------------------------------- 3191 // -----------------------------------
3200 MaybeObject* maybe_stub;
3201 if (receiver_map->has_fast_elements()) {
3202 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
3203 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode();
3204 } else {
3205 ASSERT(receiver_map->has_external_array_elements());
3206 JSObject::ElementsKind elements_kind = receiver_map->elements_kind();
3207 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode();
3208 }
3209 Code* stub; 3192 Code* stub;
3193 MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map);
3210 if (!maybe_stub->To(&stub)) return maybe_stub; 3194 if (!maybe_stub->To(&stub)) return maybe_stub;
3211 __ DispatchMap(a2, 3195 __ DispatchMap(a2,
3212 a3, 3196 a3,
3213 Handle<Map>(receiver_map), 3197 Handle<Map>(receiver_map),
3214 Handle<Code>(stub), 3198 Handle<Code>(stub),
3215 DO_SMI_CHECK); 3199 DO_SMI_CHECK);
3216 3200
3217 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); 3201 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
3218 __ Jump(ic, RelocInfo::CODE_TARGET); 3202 __ Jump(ic, RelocInfo::CODE_TARGET);
3219 3203
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
4249 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4233 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4250 __ Jump(ic, RelocInfo::CODE_TARGET); 4234 __ Jump(ic, RelocInfo::CODE_TARGET);
4251 } 4235 }
4252 4236
4253 4237
4254 #undef __ 4238 #undef __
4255 4239
4256 } } // namespace v8::internal 4240 } } // namespace v8::internal
4257 4241
4258 #endif // V8_TARGET_ARCH_MIPS 4242 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698