OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2762 | 2762 |
2763 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( | 2763 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
2764 Handle<Map> receiver_map) { | 2764 Handle<Map> receiver_map) { |
2765 // ----------- S t a t e ------------- | 2765 // ----------- S t a t e ------------- |
2766 // -- eax : value | 2766 // -- eax : value |
2767 // -- ecx : key | 2767 // -- ecx : key |
2768 // -- edx : receiver | 2768 // -- edx : receiver |
2769 // -- esp[0] : return address | 2769 // -- esp[0] : return address |
2770 // ----------------------------------- | 2770 // ----------------------------------- |
2771 ElementsKind elements_kind = receiver_map->elements_kind(); | 2771 ElementsKind elements_kind = receiver_map->elements_kind(); |
2772 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 2772 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
2773 Handle<Code> stub = | 2773 if (FLAG_compiled_keyed_stores && |
2774 KeyedStoreElementStub(is_jsarray, | 2774 (receiver_map->has_fast_elements() || |
2775 elements_kind, | 2775 receiver_map->has_external_array_elements())) { |
2776 store_mode_).GetCode(isolate()); | 2776 Handle<Code> stub = KeyedStoreFastElementStub( |
2777 | 2777 is_js_array, |
2778 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); | 2778 elements_kind, |
| 2779 store_mode_).GetCode(isolate()); |
| 2780 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); |
| 2781 } else { |
| 2782 Handle<Code> stub = |
| 2783 KeyedStoreElementStub(is_js_array, elements_kind, |
| 2784 store_mode_).GetCode(isolate()); |
| 2785 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); |
| 2786 } |
2779 | 2787 |
2780 TailCallBuiltin(masm(), MissBuiltin(kind())); | 2788 TailCallBuiltin(masm(), MissBuiltin(kind())); |
2781 | 2789 |
2782 // Return the generated code. | 2790 // Return the generated code. |
2783 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); | 2791 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); |
2784 } | 2792 } |
2785 | 2793 |
2786 | 2794 |
2787 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( | 2795 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
2788 MapHandleList* receiver_maps, | 2796 MapHandleList* receiver_maps, |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3719 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3727 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3720 } | 3728 } |
3721 } | 3729 } |
3722 | 3730 |
3723 | 3731 |
3724 #undef __ | 3732 #undef __ |
3725 | 3733 |
3726 } } // namespace v8::internal | 3734 } } // namespace v8::internal |
3727 | 3735 |
3728 #endif // V8_TARGET_ARCH_IA32 | 3736 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |