| 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) { | 143 int TransitionArray::Search(Name* name, int* out_insertion_index) { |
| 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 } |
| 147 return kNotFound; | 150 return kNotFound; |
| 148 } | 151 } |
| 149 return internal::Search<ALL_ENTRIES>(this, name); | 152 return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index); |
| 150 } | 153 } |
| 151 | 154 |
| 152 | 155 |
| 153 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, | 156 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, |
| 154 Name* key, | 157 Name* key, |
| 155 Map* target) { | 158 Map* target) { |
| 156 FixedArray::NoIncrementalWriteBarrierSet( | 159 FixedArray::NoIncrementalWriteBarrierSet( |
| 157 this, ToKeyIndex(transition_number), key); | 160 this, ToKeyIndex(transition_number), key); |
| 158 FixedArray::NoIncrementalWriteBarrierSet( | 161 FixedArray::NoIncrementalWriteBarrierSet( |
| 159 this, ToTargetIndex(transition_number), target); | 162 this, ToTargetIndex(transition_number), target); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 170 | 173 |
| 171 | 174 |
| 172 #undef FIELD_ADDR | 175 #undef FIELD_ADDR |
| 173 #undef WRITE_FIELD | 176 #undef WRITE_FIELD |
| 174 #undef CONDITIONAL_WRITE_BARRIER | 177 #undef CONDITIONAL_WRITE_BARRIER |
| 175 | 178 |
| 176 | 179 |
| 177 } } // namespace v8::internal | 180 } } // namespace v8::internal |
| 178 | 181 |
| 179 #endif // V8_TRANSITIONS_INL_H_ | 182 #endif // V8_TRANSITIONS_INL_H_ |
| OLD | NEW |