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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 Object** TransitionArray::GetPrototypeTransitionsSlot() { | 109 Object** TransitionArray::GetPrototypeTransitionsSlot() { |
110 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), | 110 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), |
111 kPrototypeTransitionsOffset); | 111 kPrototypeTransitionsOffset); |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 Object** TransitionArray::GetKeySlot(int transition_number) { | 115 Object** TransitionArray::GetKeySlot(int transition_number) { |
116 ASSERT(!IsSimpleTransition()); | 116 ASSERT(!IsSimpleTransition()); |
117 ASSERT(transition_number < number_of_transitions()); | 117 ASSERT(transition_number < number_of_transitions()); |
118 return HeapObject::RawField( | 118 return RawFieldOfElementAt(ToKeyIndex(transition_number)); |
119 reinterpret_cast<HeapObject*>(this), | |
120 OffsetOfElementAt(ToKeyIndex(transition_number))); | |
121 } | 119 } |
122 | 120 |
123 | 121 |
124 Name* TransitionArray::GetKey(int transition_number) { | 122 Name* TransitionArray::GetKey(int transition_number) { |
125 if (IsSimpleTransition()) { | 123 if (IsSimpleTransition()) { |
126 Map* target = GetTarget(kSimpleTransitionIndex); | 124 Map* target = GetTarget(kSimpleTransitionIndex); |
127 int descriptor = target->LastAdded(); | 125 int descriptor = target->LastAdded(); |
128 Name* key = target->instance_descriptors()->GetKey(descriptor); | 126 Name* key = target->instance_descriptors()->GetKey(descriptor); |
129 return key; | 127 return key; |
130 } | 128 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 187 |
190 | 188 |
191 #undef FIELD_ADDR | 189 #undef FIELD_ADDR |
192 #undef WRITE_FIELD | 190 #undef WRITE_FIELD |
193 #undef CONDITIONAL_WRITE_BARRIER | 191 #undef CONDITIONAL_WRITE_BARRIER |
194 | 192 |
195 | 193 |
196 } } // namespace v8::internal | 194 } } // namespace v8::internal |
197 | 195 |
198 #endif // V8_TRANSITIONS_INL_H_ | 196 #endif // V8_TRANSITIONS_INL_H_ |
OLD | NEW |