OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 } \ | 50 } \ |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 TransitionArray* TransitionArray::cast(Object* object) { | 54 TransitionArray* TransitionArray::cast(Object* object) { |
55 ASSERT(object->IsTransitionArray()); | 55 ASSERT(object->IsTransitionArray()); |
56 return reinterpret_cast<TransitionArray*>(object); | 56 return reinterpret_cast<TransitionArray*>(object); |
57 } | 57 } |
58 | 58 |
59 | 59 |
60 Map* TransitionArray::elements_transition() { | |
61 Object* transition_map = get(kElementsTransitionIndex); | |
62 return Map::cast(transition_map); | |
63 } | |
64 | |
65 | |
66 void TransitionArray::ClearElementsTransition() { | |
67 WRITE_FIELD(this, kElementsTransitionOffset, Smi::FromInt(0)); | |
68 } | |
69 | |
70 | |
71 bool TransitionArray::HasElementsTransition() { | 60 bool TransitionArray::HasElementsTransition() { |
72 return IsFullTransitionArray() && | 61 return kNotFound != Search(GetHeap()->elements_transition_symbol()); |
titzer
2013/07/31 13:55:46
Yoda condition
Toon Verwaest
2013/07/31 15:05:23
Done.
| |
73 get(kElementsTransitionIndex) != Smi::FromInt(0); | |
74 } | 62 } |
75 | 63 |
76 | 64 |
77 void TransitionArray::set_elements_transition(Map* transition_map, | |
78 WriteBarrierMode mode) { | |
79 ASSERT(IsFullTransitionArray()); | |
80 Heap* heap = GetHeap(); | |
81 WRITE_FIELD(this, kElementsTransitionOffset, transition_map); | |
82 CONDITIONAL_WRITE_BARRIER( | |
83 heap, this, kElementsTransitionOffset, transition_map, mode); | |
84 } | |
85 | |
86 | |
87 Object* TransitionArray::back_pointer_storage() { | 65 Object* TransitionArray::back_pointer_storage() { |
88 return get(kBackPointerStorageIndex); | 66 return get(kBackPointerStorageIndex); |
89 } | 67 } |
90 | 68 |
91 | 69 |
92 void TransitionArray::set_back_pointer_storage(Object* back_pointer, | 70 void TransitionArray::set_back_pointer_storage(Object* back_pointer, |
93 WriteBarrierMode mode) { | 71 WriteBarrierMode mode) { |
94 Heap* heap = GetHeap(); | 72 Heap* heap = GetHeap(); |
95 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer); | 73 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer); |
96 CONDITIONAL_WRITE_BARRIER( | 74 CONDITIONAL_WRITE_BARRIER( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 | 189 |
212 | 190 |
213 #undef FIELD_ADDR | 191 #undef FIELD_ADDR |
214 #undef WRITE_FIELD | 192 #undef WRITE_FIELD |
215 #undef CONDITIONAL_WRITE_BARRIER | 193 #undef CONDITIONAL_WRITE_BARRIER |
216 | 194 |
217 | 195 |
218 } } // namespace v8::internal | 196 } } // namespace v8::internal |
219 | 197 |
220 #endif // V8_TRANSITIONS_INL_H_ | 198 #endif // V8_TRANSITIONS_INL_H_ |
OLD | NEW |