OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 if (target_receiver_maps.length() == 0) { | 1630 if (target_receiver_maps.length() == 0) { |
1631 Handle<Map> monomorphic_map = | 1631 Handle<Map> monomorphic_map = |
1632 ComputeTransitionedMap(receiver_map, store_mode); | 1632 ComputeTransitionedMap(receiver_map, store_mode); |
1633 store_mode = GetNonTransitioningStoreMode(store_mode); | 1633 store_mode = GetNonTransitioningStoreMode(store_mode); |
1634 Handle<Code> handler = | 1634 Handle<Code> handler = |
1635 PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler(monomorphic_map, | 1635 PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler(monomorphic_map, |
1636 store_mode); | 1636 store_mode); |
1637 return ConfigureVectorState(Handle<Name>(), monomorphic_map, handler); | 1637 return ConfigureVectorState(Handle<Name>(), monomorphic_map, handler); |
1638 } | 1638 } |
1639 | 1639 |
| 1640 for (int i = 0; i < target_receiver_maps.length(); i++) { |
| 1641 if (!target_receiver_maps.at(i).is_null() && |
| 1642 target_receiver_maps.at(i)->instance_type() == JS_VALUE_TYPE) { |
| 1643 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "JSValue"); |
| 1644 return; |
| 1645 } |
| 1646 } |
| 1647 |
1640 // There are several special cases where an IC that is MONOMORPHIC can still | 1648 // There are several special cases where an IC that is MONOMORPHIC can still |
1641 // transition to a different GetNonTransitioningStoreMode IC that handles a | 1649 // transition to a different GetNonTransitioningStoreMode IC that handles a |
1642 // superset of the original IC. Handle those here if the receiver map hasn't | 1650 // superset of the original IC. Handle those here if the receiver map hasn't |
1643 // changed or it has transitioned to a more general kind. | 1651 // changed or it has transitioned to a more general kind. |
1644 KeyedAccessStoreMode old_store_mode = GetKeyedAccessStoreMode(); | 1652 KeyedAccessStoreMode old_store_mode = GetKeyedAccessStoreMode(); |
1645 Handle<Map> previous_receiver_map = target_receiver_maps.at(0); | 1653 Handle<Map> previous_receiver_map = target_receiver_maps.at(0); |
1646 if (state() == MONOMORPHIC) { | 1654 if (state() == MONOMORPHIC) { |
1647 Handle<Map> transitioned_receiver_map = receiver_map; | 1655 Handle<Map> transitioned_receiver_map = receiver_map; |
1648 if (IsTransitionStoreMode(store_mode)) { | 1656 if (IsTransitionStoreMode(store_mode)) { |
1649 transitioned_receiver_map = | 1657 transitioned_receiver_map = |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 KeyedLoadICNexus nexus(vector, vector_slot); | 2738 KeyedLoadICNexus nexus(vector, vector_slot); |
2731 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2739 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2732 ic.UpdateState(receiver, key); | 2740 ic.UpdateState(receiver, key); |
2733 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2741 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2734 } | 2742 } |
2735 | 2743 |
2736 return *result; | 2744 return *result; |
2737 } | 2745 } |
2738 } // namespace internal | 2746 } // namespace internal |
2739 } // namespace v8 | 2747 } // namespace v8 |
OLD | NEW |