| 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 | 757 |
| 758 | 758 |
| 759 bool IC::IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map) { | 759 bool IC::IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map) { |
| 760 if (source_map == NULL) return true; | 760 if (source_map == NULL) return true; |
| 761 if (target_map == NULL) return false; | 761 if (target_map == NULL) return false; |
| 762 ElementsKind target_elements_kind = target_map->elements_kind(); | 762 ElementsKind target_elements_kind = target_map->elements_kind(); |
| 763 bool more_general_transition = IsMoreGeneralElementsKindTransition( | 763 bool more_general_transition = IsMoreGeneralElementsKindTransition( |
| 764 source_map->elements_kind(), target_elements_kind); | 764 source_map->elements_kind(), target_elements_kind); |
| 765 Map* transitioned_map = | 765 Map* transitioned_map = nullptr; |
| 766 more_general_transition | 766 if (more_general_transition) { |
| 767 ? source_map->LookupElementsTransitionMap(target_elements_kind) | 767 MapHandleList map_list; |
| 768 : NULL; | 768 map_list.Add(handle(target_map)); |
| 769 | 769 transitioned_map = source_map->FindElementsKindTransitionedMap(&map_list); |
| 770 } |
| 770 return transitioned_map == target_map; | 771 return transitioned_map == target_map; |
| 771 } | 772 } |
| 772 | 773 |
| 773 | 774 |
| 774 void IC::PatchCache(Handle<Name> name, Handle<Code> code) { | 775 void IC::PatchCache(Handle<Name> name, Handle<Code> code) { |
| 775 switch (state()) { | 776 switch (state()) { |
| 776 case UNINITIALIZED: | 777 case UNINITIALIZED: |
| 777 case PREMONOMORPHIC: | 778 case PREMONOMORPHIC: |
| 778 UpdateMonomorphicIC(code, name); | 779 UpdateMonomorphicIC(code, name); |
| 779 break; | 780 break; |
| (...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 KeyedLoadICNexus nexus(vector, vector_slot); | 2995 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2995 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2996 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2996 ic.UpdateState(receiver, key); | 2997 ic.UpdateState(receiver, key); |
| 2997 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2998 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2998 } | 2999 } |
| 2999 | 3000 |
| 3000 return *result; | 3001 return *result; |
| 3001 } | 3002 } |
| 3002 } // namespace internal | 3003 } // namespace internal |
| 3003 } // namespace v8 | 3004 } // namespace v8 |
| OLD | NEW |