| OLD | NEW |
| 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 Loading... |
| 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 |
| 3101 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); | 3104 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); |
| 3102 Code* stub; | 3105 Code* stub; |
| 3103 if (!maybe_stub->To(&stub)) return maybe_stub; | 3106 if (!maybe_stub->To(&stub)) return maybe_stub; |
| 3104 __ DispatchMap(r1, | 3107 __ DispatchMap(r1, |
| 3105 r2, | 3108 r2, |
| 3106 Handle<Map>(receiver_map), | 3109 Handle<Map>(receiver_map), |
| 3107 Handle<Code>(stub), | 3110 Handle<Code>(stub), |
| 3108 DO_SMI_CHECK); | 3111 DO_SMI_CHECK); |
| 3109 | 3112 |
| 3113 __ bind(&miss); |
| 3110 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); | 3114 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); |
| 3111 __ Jump(ic, RelocInfo::CODE_TARGET); | 3115 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 3112 | 3116 |
| 3113 // Return the generated code. | 3117 // Return the generated code. |
| 3114 return GetCode(NORMAL, NULL); | 3118 return GetCode(NORMAL, NULL); |
| 3115 } | 3119 } |
| 3116 | 3120 |
| 3117 | 3121 |
| 3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic( | 3122 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic( |
| 3119 MapList* receiver_maps, | 3123 MapList* receiver_maps, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3185 | 3189 |
| 3186 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( | 3190 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( |
| 3187 Map* receiver_map) { | 3191 Map* receiver_map) { |
| 3188 // ----------- S t a t e ------------- | 3192 // ----------- S t a t e ------------- |
| 3189 // -- r0 : value | 3193 // -- r0 : value |
| 3190 // -- r1 : key | 3194 // -- r1 : key |
| 3191 // -- r2 : receiver | 3195 // -- r2 : receiver |
| 3192 // -- lr : return address | 3196 // -- lr : return address |
| 3193 // -- r3 : scratch | 3197 // -- r3 : scratch |
| 3194 // ----------------------------------- | 3198 // ----------------------------------- |
| 3199 Label miss; |
| 3200 __ JumpIfSmi(r1, &miss); |
| 3201 |
| 3195 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 3202 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 3196 MaybeObject* maybe_stub = | 3203 MaybeObject* maybe_stub = |
| 3197 KeyedStoreFastElementStub(is_js_array).TryGetCode(); | 3204 KeyedStoreFastElementStub(is_js_array).TryGetCode(); |
| 3198 Code* stub; | 3205 Code* stub; |
| 3199 if (!maybe_stub->To(&stub)) return maybe_stub; | 3206 if (!maybe_stub->To(&stub)) return maybe_stub; |
| 3200 __ DispatchMap(r2, | 3207 __ DispatchMap(r2, |
| 3201 r3, | 3208 r3, |
| 3202 Handle<Map>(receiver_map), | 3209 Handle<Map>(receiver_map), |
| 3203 Handle<Code>(stub), | 3210 Handle<Code>(stub), |
| 3204 DO_SMI_CHECK); | 3211 DO_SMI_CHECK); |
| 3205 | 3212 |
| 3213 __ bind(&miss); |
| 3206 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 3214 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 3207 __ Jump(ic, RelocInfo::CODE_TARGET); | 3215 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 3208 | 3216 |
| 3209 // Return the generated code. | 3217 // Return the generated code. |
| 3210 return GetCode(NORMAL, NULL); | 3218 return GetCode(NORMAL, NULL); |
| 3211 } | 3219 } |
| 3212 | 3220 |
| 3213 | 3221 |
| 3214 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic( | 3222 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic( |
| 3215 MapList* receiver_maps, | 3223 MapList* receiver_maps, |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4209 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4217 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4210 __ Jump(ic, RelocInfo::CODE_TARGET); | 4218 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 4211 } | 4219 } |
| 4212 | 4220 |
| 4213 | 4221 |
| 4214 #undef __ | 4222 #undef __ |
| 4215 | 4223 |
| 4216 } } // namespace v8::internal | 4224 } } // namespace v8::internal |
| 4217 | 4225 |
| 4218 #endif // V8_TARGET_ARCH_ARM | 4226 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |