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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) { | 161 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) { |
162 Map* map = GetTarget(transition_number); | 162 Map* map = GetTarget(transition_number); |
163 DescriptorArray* descriptors = map->instance_descriptors(); | 163 DescriptorArray* descriptors = map->instance_descriptors(); |
164 int descriptor = map->LastAdded(); | 164 int descriptor = map->LastAdded(); |
165 ASSERT(descriptor != Map::kNoneAdded); | 165 ASSERT(descriptor != Map::kNoneAdded); |
166 return descriptors->GetDetails(descriptor); | 166 return descriptors->GetDetails(descriptor); |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 Object** TransitionArray::GetElementsTransitionSlot() { | |
171 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), | |
172 kElementsTransitionOffset); | |
173 } | |
174 | |
175 | |
176 int TransitionArray::Search(String* name) { | 170 int TransitionArray::Search(String* name) { |
177 return internal::Search(this, name); | 171 return internal::Search(this, name); |
178 } | 172 } |
179 | 173 |
180 | 174 |
181 void TransitionArray::Set(int transition_number, | 175 void TransitionArray::Set(int transition_number, |
182 String* key, | 176 String* key, |
183 Map* target, | 177 Map* target, |
184 const WhitenessWitness&) { | 178 const WhitenessWitness&) { |
185 NoIncrementalWriteBarrierSet(this, | 179 NoIncrementalWriteBarrierSet(this, |
186 ToKeyIndex(transition_number), | 180 ToKeyIndex(transition_number), |
187 key); | 181 key); |
188 NoIncrementalWriteBarrierSet(this, | 182 NoIncrementalWriteBarrierSet(this, |
189 ToTargetIndex(transition_number), | 183 ToTargetIndex(transition_number), |
190 target); | 184 target); |
191 } | 185 } |
192 | 186 |
193 | 187 |
194 #undef FIELD_ADDR | 188 #undef FIELD_ADDR |
195 #undef WRITE_FIELD | 189 #undef WRITE_FIELD |
196 #undef CONDITIONAL_WRITE_BARRIER | 190 #undef CONDITIONAL_WRITE_BARRIER |
197 | 191 |
198 | 192 |
199 } } // namespace v8::internal | 193 } } // namespace v8::internal |
200 | 194 |
201 #endif // V8_TRANSITIONS_INL_H_ | 195 #endif // V8_TRANSITIONS_INL_H_ |
OLD | NEW |