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/v8.h" | 5 #include "src/v8.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/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 transitioned_receiver_map); | 1665 transitioned_receiver_map); |
1666 } | 1666 } |
1667 | 1667 |
1668 if (!map_added) { | 1668 if (!map_added) { |
1669 // If the miss wasn't due to an unseen map, a polymorphic stub | 1669 // If the miss wasn't due to an unseen map, a polymorphic stub |
1670 // won't help, use the generic stub. | 1670 // won't help, use the generic stub. |
1671 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "same map added twice"); | 1671 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "same map added twice"); |
1672 return generic_stub(); | 1672 return generic_stub(); |
1673 } | 1673 } |
1674 | 1674 |
1675 // If the maximum number of receiver maps has been exceeded, use the generic | 1675 // If the maximum number of receiver maps has been exceeded, use the |
1676 // version of the IC. | 1676 // megamorphic version of the IC. |
1677 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { | 1677 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { |
1678 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "max polymorph exceeded"); | 1678 return megamorphic_stub(); |
1679 return generic_stub(); | |
1680 } | 1679 } |
1681 | 1680 |
1682 // Make sure all polymorphic handlers have the same store mode, otherwise the | 1681 // Make sure all polymorphic handlers have the same store mode, otherwise the |
1683 // generic stub must be used. | 1682 // generic stub must be used. |
1684 store_mode = GetNonTransitioningStoreMode(store_mode); | 1683 store_mode = GetNonTransitioningStoreMode(store_mode); |
1685 if (old_store_mode != STANDARD_STORE) { | 1684 if (old_store_mode != STANDARD_STORE) { |
1686 if (store_mode == STANDARD_STORE) { | 1685 if (store_mode == STANDARD_STORE) { |
1687 store_mode = old_store_mode; | 1686 store_mode = old_store_mode; |
1688 } else if (store_mode != old_store_mode) { | 1687 } else if (store_mode != old_store_mode) { |
1689 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "store mode mismatch"); | 1688 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "store mode mismatch"); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 } | 1933 } |
1935 DCHECK(!stub.is_null()); | 1934 DCHECK(!stub.is_null()); |
1936 set_target(*stub); | 1935 set_target(*stub); |
1937 TRACE_IC("StoreIC", key); | 1936 TRACE_IC("StoreIC", key); |
1938 | 1937 |
1939 return store_handle; | 1938 return store_handle; |
1940 } | 1939 } |
1941 | 1940 |
1942 | 1941 |
1943 // static | 1942 // static |
| 1943 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
| 1944 StrictMode strict_mode) { |
| 1945 PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode); |
| 1946 } |
| 1947 |
| 1948 |
| 1949 // static |
1944 void CallIC::OnTypeFeedbackChanged(Isolate* isolate, Code* host, | 1950 void CallIC::OnTypeFeedbackChanged(Isolate* isolate, Code* host, |
1945 TypeFeedbackVector* vector, State old_state, | 1951 TypeFeedbackVector* vector, State old_state, |
1946 State new_state) { | 1952 State new_state) { |
1947 if (host->kind() != Code::FUNCTION) return; | 1953 if (host->kind() != Code::FUNCTION) return; |
1948 | 1954 |
1949 if (FLAG_type_info_threshold > 0) { | 1955 if (FLAG_type_info_threshold > 0) { |
1950 int polymorphic_delta = 0; // "Polymorphic" here includes monomorphic. | 1956 int polymorphic_delta = 0; // "Polymorphic" here includes monomorphic. |
1951 int generic_delta = 0; // "Generic" here includes megamorphic. | 1957 int generic_delta = 0; // "Generic" here includes megamorphic. |
1952 ComputeTypeInfoCountDelta(old_state, new_state, &polymorphic_delta, | 1958 ComputeTypeInfoCountDelta(old_state, new_state, &polymorphic_delta, |
1953 &generic_delta); | 1959 &generic_delta); |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 static const Address IC_utilities[] = { | 2742 static const Address IC_utilities[] = { |
2737 #define ADDR(name) FUNCTION_ADDR(name), | 2743 #define ADDR(name) FUNCTION_ADDR(name), |
2738 IC_UTIL_LIST(ADDR) NULL | 2744 IC_UTIL_LIST(ADDR) NULL |
2739 #undef ADDR | 2745 #undef ADDR |
2740 }; | 2746 }; |
2741 | 2747 |
2742 | 2748 |
2743 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 2749 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
2744 } | 2750 } |
2745 } // namespace v8::internal | 2751 } // namespace v8::internal |
OLD | NEW |