| 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/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 829 } |
| 830 } | 830 } |
| 831 | 831 |
| 832 | 832 |
| 833 bool IC::IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map) { | 833 bool IC::IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map) { |
| 834 if (source_map == NULL) return true; | 834 if (source_map == NULL) return true; |
| 835 if (target_map == NULL) return false; | 835 if (target_map == NULL) return false; |
| 836 ElementsKind target_elements_kind = target_map->elements_kind(); | 836 ElementsKind target_elements_kind = target_map->elements_kind(); |
| 837 bool more_general_transition = IsMoreGeneralElementsKindTransition( | 837 bool more_general_transition = IsMoreGeneralElementsKindTransition( |
| 838 source_map->elements_kind(), target_elements_kind); | 838 source_map->elements_kind(), target_elements_kind); |
| 839 Map* transitioned_map = | 839 Map* transitioned_map = nullptr; |
| 840 more_general_transition | 840 if (more_general_transition) { |
| 841 ? source_map->LookupElementsTransitionMap(target_elements_kind) | 841 MapHandleList map_list; |
| 842 : NULL; | 842 map_list.Add(handle(target_map)); |
| 843 | 843 transitioned_map = source_map->FindElementsKindTransitionedMap(&map_list); |
| 844 } |
| 844 return transitioned_map == target_map; | 845 return transitioned_map == target_map; |
| 845 } | 846 } |
| 846 | 847 |
| 847 | 848 |
| 848 void IC::PatchCache(Handle<Name> name, Handle<Code> code) { | 849 void IC::PatchCache(Handle<Name> name, Handle<Code> code) { |
| 849 switch (state()) { | 850 switch (state()) { |
| 850 case UNINITIALIZED: | 851 case UNINITIALIZED: |
| 851 case PREMONOMORPHIC: | 852 case PREMONOMORPHIC: |
| 852 UpdateMonomorphicIC(code, name); | 853 UpdateMonomorphicIC(code, name); |
| 853 break; | 854 break; |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2964 KeyedLoadICNexus nexus(vector, vector_slot); | 2965 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2965 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2966 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2966 ic.UpdateState(receiver, key); | 2967 ic.UpdateState(receiver, key); |
| 2967 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2968 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2968 } | 2969 } |
| 2969 | 2970 |
| 2970 return *result; | 2971 return *result; |
| 2971 } | 2972 } |
| 2972 } // namespace internal | 2973 } // namespace internal |
| 2973 } // namespace v8 | 2974 } // namespace v8 |
| OLD | NEW |