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 3564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3575 bool Map::HasTransitionArray() { | 3575 bool Map::HasTransitionArray() { |
3576 return instance_descriptors()->HasTransitionArray(); | 3576 return instance_descriptors()->HasTransitionArray(); |
3577 } | 3577 } |
3578 | 3578 |
3579 | 3579 |
3580 Map* Map::elements_transition_map() { | 3580 Map* Map::elements_transition_map() { |
3581 return transitions()->elements_transition(); | 3581 return transitions()->elements_transition(); |
3582 } | 3582 } |
3583 | 3583 |
3584 | 3584 |
| 3585 bool Map::CanHaveMoreTransitions() { |
| 3586 if (!HasTransitionArray()) return true; |
| 3587 return FixedArray::SizeFor(transitions()->length() + |
| 3588 TransitionArray::kTransitionSize) |
| 3589 <= Page::kMaxNonCodeHeapObjectSize; |
| 3590 } |
| 3591 |
| 3592 |
3585 MaybeObject* Map::AddTransition(String* key, Map* target) { | 3593 MaybeObject* Map::AddTransition(String* key, Map* target) { |
3586 if (HasTransitionArray()) return transitions()->CopyInsert(key, target); | 3594 if (HasTransitionArray()) return transitions()->CopyInsert(key, target); |
3587 return TransitionArray::NewWith(key, target); | 3595 return TransitionArray::NewWith(key, target); |
3588 } | 3596 } |
3589 | 3597 |
3590 | 3598 |
3591 void Map::SetTransition(int transition_index, Map* target) { | 3599 void Map::SetTransition(int transition_index, Map* target) { |
3592 transitions()->SetTarget(transition_index, target); | 3600 transitions()->SetTarget(transition_index, target); |
3593 } | 3601 } |
3594 | 3602 |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5382 #undef WRITE_UINT32_FIELD | 5390 #undef WRITE_UINT32_FIELD |
5383 #undef READ_SHORT_FIELD | 5391 #undef READ_SHORT_FIELD |
5384 #undef WRITE_SHORT_FIELD | 5392 #undef WRITE_SHORT_FIELD |
5385 #undef READ_BYTE_FIELD | 5393 #undef READ_BYTE_FIELD |
5386 #undef WRITE_BYTE_FIELD | 5394 #undef WRITE_BYTE_FIELD |
5387 | 5395 |
5388 | 5396 |
5389 } } // namespace v8::internal | 5397 } } // namespace v8::internal |
5390 | 5398 |
5391 #endif // V8_OBJECTS_INL_H_ | 5399 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |