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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 5190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5201 | 5201 |
5202 | 5202 |
5203 Map* Map::elements_transition_map() { | 5203 Map* Map::elements_transition_map() { |
5204 int index = transitions()->Search(GetHeap()->elements_transition_symbol()); | 5204 int index = transitions()->Search(GetHeap()->elements_transition_symbol()); |
5205 return transitions()->GetTarget(index); | 5205 return transitions()->GetTarget(index); |
5206 } | 5206 } |
5207 | 5207 |
5208 | 5208 |
5209 bool Map::CanHaveMoreTransitions() { | 5209 bool Map::CanHaveMoreTransitions() { |
5210 if (!HasTransitionArray()) return true; | 5210 if (!HasTransitionArray()) return true; |
5211 return FixedArray::SizeFor(transitions()->length() + | 5211 return transitions()->number_of_transitions() <= |
5212 TransitionArray::kTransitionSize) | 5212 TransitionArray::kMaxNumberOfTransitions; |
5213 <= Page::kMaxRegularHeapObjectSize; | |
5214 } | 5213 } |
5215 | 5214 |
5216 | 5215 |
5217 Map* Map::GetTransition(int transition_index) { | 5216 Map* Map::GetTransition(int transition_index) { |
5218 return transitions()->GetTarget(transition_index); | 5217 return transitions()->GetTarget(transition_index); |
5219 } | 5218 } |
5220 | 5219 |
5221 | 5220 |
5222 int Map::SearchTransition(Name* name) { | 5221 int Map::SearchTransition(Name* name) { |
5223 if (HasTransitionArray()) return transitions()->Search(name); | 5222 if (HasTransitionArray()) return transitions()->Search(name); |
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7283 #undef READ_SHORT_FIELD | 7282 #undef READ_SHORT_FIELD |
7284 #undef WRITE_SHORT_FIELD | 7283 #undef WRITE_SHORT_FIELD |
7285 #undef READ_BYTE_FIELD | 7284 #undef READ_BYTE_FIELD |
7286 #undef WRITE_BYTE_FIELD | 7285 #undef WRITE_BYTE_FIELD |
7287 #undef NOBARRIER_READ_BYTE_FIELD | 7286 #undef NOBARRIER_READ_BYTE_FIELD |
7288 #undef NOBARRIER_WRITE_BYTE_FIELD | 7287 #undef NOBARRIER_WRITE_BYTE_FIELD |
7289 | 7288 |
7290 } } // namespace v8::internal | 7289 } } // namespace v8::internal |
7291 | 7290 |
7292 #endif // V8_OBJECTS_INL_H_ | 7291 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |