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 #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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 return map->GetLastDescriptorDetails(); | 133 return map->GetLastDescriptorDetails(); |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 Object* TransitionArray::GetTargetValue(int transition_number) { | 137 Object* TransitionArray::GetTargetValue(int transition_number) { |
138 Map* map = GetTarget(transition_number); | 138 Map* map = GetTarget(transition_number); |
139 return map->instance_descriptors()->GetValue(map->LastAdded()); | 139 return map->instance_descriptors()->GetValue(map->LastAdded()); |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 int TransitionArray::Search(Name* name, int* out_insertion_index) { | 143 int TransitionArray::Search(Name* name) { |
144 if (IsSimpleTransition()) { | 144 if (IsSimpleTransition()) { |
145 Name* key = GetKey(kSimpleTransitionIndex); | 145 Name* key = GetKey(kSimpleTransitionIndex); |
146 if (key->Equals(name)) return kSimpleTransitionIndex; | 146 if (key->Equals(name)) return kSimpleTransitionIndex; |
147 if (out_insertion_index != NULL) { | |
148 *out_insertion_index = key->Hash() > name->Hash() ? 0 : 1; | |
149 } | |
150 return kNotFound; | 147 return kNotFound; |
151 } | 148 } |
152 return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index); | 149 return internal::Search<ALL_ENTRIES>(this, name); |
153 } | 150 } |
154 | 151 |
155 | 152 |
156 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, | 153 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, |
157 Name* key, | 154 Name* key, |
158 Map* target) { | 155 Map* target) { |
159 FixedArray::NoIncrementalWriteBarrierSet( | 156 FixedArray::NoIncrementalWriteBarrierSet( |
160 this, ToKeyIndex(transition_number), key); | 157 this, ToKeyIndex(transition_number), key); |
161 FixedArray::NoIncrementalWriteBarrierSet( | 158 FixedArray::NoIncrementalWriteBarrierSet( |
162 this, ToTargetIndex(transition_number), target); | 159 this, ToTargetIndex(transition_number), target); |
(...skipping 10 matching lines...) Expand all Loading... |
173 | 170 |
174 | 171 |
175 #undef FIELD_ADDR | 172 #undef FIELD_ADDR |
176 #undef WRITE_FIELD | 173 #undef WRITE_FIELD |
177 #undef CONDITIONAL_WRITE_BARRIER | 174 #undef CONDITIONAL_WRITE_BARRIER |
178 | 175 |
179 | 176 |
180 } } // namespace v8::internal | 177 } } // namespace v8::internal |
181 | 178 |
182 #endif // V8_TRANSITIONS_INL_H_ | 179 #endif // V8_TRANSITIONS_INL_H_ |
OLD | NEW |