| 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 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 | 13 |
| 14 TransitionArray* TransitionArray::cast(Object* object) { | 14 TransitionArray* TransitionArray::cast(Object* object) { |
| 15 DCHECK(object->IsTransitionArray()); | 15 DCHECK(object->IsTransitionArray()); |
| 16 return reinterpret_cast<TransitionArray*>(object); | 16 return reinterpret_cast<TransitionArray*>(object); |
| 17 } | 17 } |
| 18 | 18 |
| 19 | 19 |
| 20 Object* TransitionArray::next_link() { return get(kNextLinkIndex); } |
| 21 |
| 22 |
| 23 void TransitionArray::set_next_link(Object* next, WriteBarrierMode mode) { |
| 24 return set(kNextLinkIndex, next, mode); |
| 25 } |
| 26 |
| 27 |
| 20 bool TransitionArray::HasPrototypeTransitions() { | 28 bool TransitionArray::HasPrototypeTransitions() { |
| 21 return get(kPrototypeTransitionsIndex) != Smi::FromInt(0); | 29 return get(kPrototypeTransitionsIndex) != Smi::FromInt(0); |
| 22 } | 30 } |
| 23 | 31 |
| 24 | 32 |
| 25 FixedArray* TransitionArray::GetPrototypeTransitions() { | 33 FixedArray* TransitionArray::GetPrototypeTransitions() { |
| 26 DCHECK(HasPrototypeTransitions()); // Callers must check first. | 34 DCHECK(HasPrototypeTransitions()); // Callers must check first. |
| 27 Object* prototype_transitions = get(kPrototypeTransitionsIndex); | 35 Object* prototype_transitions = get(kPrototypeTransitionsIndex); |
| 28 return FixedArray::cast(prototype_transitions); | 36 return FixedArray::cast(prototype_transitions); |
| 29 } | 37 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 174 |
| 167 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) { | 175 void TransitionArray::SetNumberOfTransitions(int number_of_transitions) { |
| 168 DCHECK(number_of_transitions <= Capacity(this)); | 176 DCHECK(number_of_transitions <= Capacity(this)); |
| 169 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); | 177 set(kTransitionLengthIndex, Smi::FromInt(number_of_transitions)); |
| 170 } | 178 } |
| 171 | 179 |
| 172 } // namespace internal | 180 } // namespace internal |
| 173 } // namespace v8 | 181 } // namespace v8 |
| 174 | 182 |
| 175 #endif // V8_TRANSITIONS_INL_H_ | 183 #endif // V8_TRANSITIONS_INL_H_ |
| OLD | NEW |