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 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 | 2664 |
2665 | 2665 |
2666 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( | 2666 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( |
2667 Map* receiver_map) { | 2667 Map* receiver_map) { |
2668 // ----------- S t a t e ------------- | 2668 // ----------- S t a t e ------------- |
2669 // -- eax : value | 2669 // -- eax : value |
2670 // -- ecx : key | 2670 // -- ecx : key |
2671 // -- edx : receiver | 2671 // -- edx : receiver |
2672 // -- esp[0] : return address | 2672 // -- esp[0] : return address |
2673 // ----------------------------------- | 2673 // ----------------------------------- |
| 2674 Label miss; |
| 2675 __ JumpIfSmi(edx, &miss); |
| 2676 |
2674 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 2677 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
2675 MaybeObject* maybe_stub = | 2678 MaybeObject* maybe_stub = |
2676 KeyedStoreFastElementStub(is_js_array).TryGetCode(); | 2679 KeyedStoreFastElementStub(is_js_array).TryGetCode(); |
2677 Code* stub; | 2680 Code* stub; |
2678 if (!maybe_stub->To(&stub)) return maybe_stub; | 2681 if (!maybe_stub->To(&stub)) return maybe_stub; |
2679 __ DispatchMap(edx, | 2682 __ DispatchMap(edx, |
2680 Handle<Map>(receiver_map), | 2683 Handle<Map>(receiver_map), |
2681 Handle<Code>(stub), | 2684 Handle<Code>(stub), |
2682 DO_SMI_CHECK); | 2685 DO_SMI_CHECK); |
2683 | 2686 |
| 2687 __ bind(&miss); |
2684 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2688 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
2685 __ jmp(ic, RelocInfo::CODE_TARGET); | 2689 __ jmp(ic, RelocInfo::CODE_TARGET); |
2686 | 2690 |
2687 // Return the generated code. | 2691 // Return the generated code. |
2688 return GetCode(NORMAL, NULL); | 2692 return GetCode(NORMAL, NULL); |
2689 } | 2693 } |
2690 | 2694 |
2691 | 2695 |
2692 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic( | 2696 MaybeObject* KeyedStoreStubCompiler::CompileStoreMegamorphic( |
2693 MapList* receiver_maps, | 2697 MapList* receiver_maps, |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 return GetCode(CALLBACKS, name); | 3130 return GetCode(CALLBACKS, name); |
3127 } | 3131 } |
3128 | 3132 |
3129 | 3133 |
3130 MaybeObject* KeyedLoadStubCompiler::CompileLoadFastElement(Map* receiver_map) { | 3134 MaybeObject* KeyedLoadStubCompiler::CompileLoadFastElement(Map* receiver_map) { |
3131 // ----------- S t a t e ------------- | 3135 // ----------- S t a t e ------------- |
3132 // -- eax : key | 3136 // -- eax : key |
3133 // -- edx : receiver | 3137 // -- edx : receiver |
3134 // -- esp[0] : return address | 3138 // -- esp[0] : return address |
3135 // ----------------------------------- | 3139 // ----------------------------------- |
| 3140 Label miss; |
| 3141 __ JumpIfSmi(edx, &miss); |
| 3142 |
3136 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); | 3143 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); |
3137 Code* stub; | 3144 Code* stub; |
3138 if (!maybe_stub->To(&stub)) return maybe_stub; | 3145 if (!maybe_stub->To(&stub)) return maybe_stub; |
3139 __ DispatchMap(edx, | 3146 __ DispatchMap(edx, |
3140 Handle<Map>(receiver_map), | 3147 Handle<Map>(receiver_map), |
3141 Handle<Code>(stub), | 3148 Handle<Code>(stub), |
3142 DO_SMI_CHECK); | 3149 DO_SMI_CHECK); |
3143 | 3150 |
| 3151 __ bind(&miss); |
3144 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3152 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
3145 | 3153 |
3146 // Return the generated code. | 3154 // Return the generated code. |
3147 return GetCode(NORMAL, NULL); | 3155 return GetCode(NORMAL, NULL); |
3148 } | 3156 } |
3149 | 3157 |
3150 | 3158 |
3151 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic( | 3159 MaybeObject* KeyedLoadStubCompiler::CompileLoadMegamorphic( |
3152 MapList* receiver_maps, | 3160 MapList* receiver_maps, |
3153 CodeList* handler_ics) { | 3161 CodeList* handler_ics) { |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3834 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
3827 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3835 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
3828 } | 3836 } |
3829 | 3837 |
3830 | 3838 |
3831 #undef __ | 3839 #undef __ |
3832 | 3840 |
3833 } } // namespace v8::internal | 3841 } } // namespace v8::internal |
3834 | 3842 |
3835 #endif // V8_TARGET_ARCH_IA32 | 3843 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |