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

Side by Side Diff: src/transitions-inl.h

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/transitions.cc ('k') | test/cctest/heap/test-heap.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 #ifndef V8_TRANSITIONS_INL_H_ 5 #ifndef V8_TRANSITIONS_INL_H_
6 #define V8_TRANSITIONS_INL_H_ 6 #define V8_TRANSITIONS_INL_H_
7 7
8 #include "src/transitions.h" 8 #include "src/transitions.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 95
96 void TransitionArray::SetTarget(int transition_number, Map* value) { 96 void TransitionArray::SetTarget(int transition_number, Map* value) {
97 DCHECK(transition_number < number_of_transitions()); 97 DCHECK(transition_number < number_of_transitions());
98 set(ToTargetIndex(transition_number), value); 98 set(ToTargetIndex(transition_number), value);
99 } 99 }
100 100
101 101
102 int TransitionArray::SearchName(Name* name, int* out_insertion_index) { 102 int TransitionArray::SearchName(Name* name, int* out_insertion_index) {
103 return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index); 103 DCHECK(name->IsUniqueName());
104 return internal::Search<ALL_ENTRIES>(this, name, number_of_entries(),
105 out_insertion_index);
104 } 106 }
105 107
106 108
107 #ifdef DEBUG 109 #ifdef DEBUG
108 bool TransitionArray::IsSpecialTransition(Name* name) { 110 bool TransitionArray::IsSpecialTransition(Name* name) {
109 if (!name->IsSymbol()) return false; 111 if (!name->IsSymbol()) return false;
110 Heap* heap = name->GetHeap(); 112 Heap* heap = name->GetHeap();
111 return name == heap->nonextensible_symbol() || 113 return name == heap->nonextensible_symbol() ||
112 name == heap->sealed_symbol() || name == heap->frozen_symbol() || 114 name == heap->sealed_symbol() || name == heap->frozen_symbol() ||
113 name == heap->elements_transition_symbol() || 115 name == heap->elements_transition_symbol() ||
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 177
176 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) { 178 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) {
177 DCHECK(number_of_transitions <= Capacity(this)); 179 DCHECK(number_of_transitions <= Capacity(this));
178 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); 180 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions));
179 } 181 }
180 182
181 } // namespace internal 183 } // namespace internal
182 } // namespace v8 184 } // namespace v8
183 185
184 #endif // V8_TRANSITIONS_INL_H_ 186 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « src/transitions.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698