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