Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: src/ic/ic.cc

Issue 2015513002: [runtime] Ensure that all elements kind transitions are chained to the root map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/ic/ic-compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2950 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, 2951 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC,
2951 vector->GetKind(vector_slot)); 2952 vector->GetKind(vector_slot));
2952 KeyedLoadICNexus nexus(vector, vector_slot); 2953 KeyedLoadICNexus nexus(vector, vector_slot);
2953 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2954 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2954 ic.UpdateState(receiver, key); 2955 ic.UpdateState(receiver, key);
2955 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); 2956 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
2956 } 2957 }
2957 } 2958 }
2958 } // namespace internal 2959 } // namespace internal
2959 } // namespace v8 2960 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/ic/ic-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698