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

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

Issue 7059013: SMI checks for receiver in KeyedLoad/Store (done right this time) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: correct test options Created 9 years, 7 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/macro-assembler-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 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::CompileLoadFastElement(Map* receiver_map) { 3095 MaybeObject* KeyedLoadStubCompiler::CompileLoadFastElement(Map* receiver_map) {
3096 // ----------- S t a t e ------------- 3096 // ----------- S t a t e -------------
3097 // -- lr : return address 3097 // -- lr : return address
3098 // -- r0 : key 3098 // -- r0 : key
3099 // -- r1 : receiver 3099 // -- r1 : receiver
3100 // ----------------------------------- 3100 // -----------------------------------
3101 Label miss;
3102 __ JumpIfSmi(r1, &miss);
3103
3104 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); 3101 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode();
3105 Code* stub; 3102 Code* stub;
3106 if (!maybe_stub->To(&stub)) return maybe_stub; 3103 if (!maybe_stub->To(&stub)) return maybe_stub;
3107 __ DispatchMap(r1, 3104 __ DispatchMap(r1,
3108 r2, 3105 r2,
3109 Handle<Map>(receiver_map), 3106 Handle<Map>(receiver_map),
3110 Handle<Code>(stub), 3107 Handle<Code>(stub),
3111 DO_SMI_CHECK); 3108 DO_SMI_CHECK);
3112 3109
3113 __ bind(&miss);
3114 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); 3110 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss();
3115 __ Jump(ic, RelocInfo::CODE_TARGET); 3111 __ Jump(ic, RelocInfo::CODE_TARGET);
3116 3112
3117 // Return the generated code. 3113 // Return the generated code.
3118 return GetCode(NORMAL, NULL); 3114 return GetCode(NORMAL, NULL);
3119 } 3115 }
3120 3116
3121 3117
3122 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic( 3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic(
3123 MapList* receiver_maps, 3119 MapList* receiver_maps,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
3189 3185
3190 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( 3186 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement(
3191 Map* receiver_map) { 3187 Map* receiver_map) {
3192 // ----------- S t a t e ------------- 3188 // ----------- S t a t e -------------
3193 // -- r0 : value 3189 // -- r0 : value
3194 // -- r1 : key 3190 // -- r1 : key
3195 // -- r2 : receiver 3191 // -- r2 : receiver
3196 // -- lr : return address 3192 // -- lr : return address
3197 // -- r3 : scratch 3193 // -- r3 : scratch
3198 // ----------------------------------- 3194 // -----------------------------------
3199 Label miss;
3200 __ JumpIfSmi(r1, &miss);
3201
3202 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 3195 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
3203 MaybeObject* maybe_stub = 3196 MaybeObject* maybe_stub =
3204 KeyedStoreFastElementStub(is_js_array).TryGetCode(); 3197 KeyedStoreFastElementStub(is_js_array).TryGetCode();
3205 Code* stub; 3198 Code* stub;
3206 if (!maybe_stub->To(&stub)) return maybe_stub; 3199 if (!maybe_stub->To(&stub)) return maybe_stub;
3207 __ DispatchMap(r2, 3200 __ DispatchMap(r2,
3208 r3, 3201 r3,
3209 Handle<Map>(receiver_map), 3202 Handle<Map>(receiver_map),
3210 Handle<Code>(stub), 3203 Handle<Code>(stub),
3211 DO_SMI_CHECK); 3204 DO_SMI_CHECK);
3212 3205
3213 __ bind(&miss);
3214 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); 3206 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss();
3215 __ Jump(ic, RelocInfo::CODE_TARGET); 3207 __ Jump(ic, RelocInfo::CODE_TARGET);
3216 3208
3217 // Return the generated code. 3209 // Return the generated code.
3218 return GetCode(NORMAL, NULL); 3210 return GetCode(NORMAL, NULL);
3219 } 3211 }
3220 3212
3221 3213
3222 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic( 3214 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic(
3223 MapList* receiver_maps, 3215 MapList* receiver_maps,
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
4217 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4209 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4218 __ Jump(ic, RelocInfo::CODE_TARGET); 4210 __ Jump(ic, RelocInfo::CODE_TARGET);
4219 } 4211 }
4220 4212
4221 4213
4222 #undef __ 4214 #undef __
4223 4215
4224 } } // namespace v8::internal 4216 } } // namespace v8::internal
4225 4217
4226 #endif // V8_TARGET_ARCH_ARM 4218 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698