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 4558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4569 | 4569 |
4570 | 4570 |
4571 void Map::set_is_prototype_map(bool value) { | 4571 void Map::set_is_prototype_map(bool value) { |
4572 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value)); | 4572 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value)); |
4573 } | 4573 } |
4574 | 4574 |
4575 bool Map::is_prototype_map() const { | 4575 bool Map::is_prototype_map() const { |
4576 return IsPrototypeMapBits::decode(bit_field2()); | 4576 return IsPrototypeMapBits::decode(bit_field2()); |
4577 } | 4577 } |
4578 | 4578 |
| 4579 bool Map::should_be_fast_prototype_map() const { |
| 4580 if (!prototype_info()->IsPrototypeInfo()) return false; |
| 4581 return PrototypeInfo::cast(prototype_info())->should_be_fast_map(); |
| 4582 } |
4579 | 4583 |
4580 void Map::set_elements_kind(ElementsKind elements_kind) { | 4584 void Map::set_elements_kind(ElementsKind elements_kind) { |
4581 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 4585 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
4582 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); | 4586 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); |
4583 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); | 4587 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); |
4584 DCHECK(this->elements_kind() == elements_kind); | 4588 DCHECK(this->elements_kind() == elements_kind); |
4585 } | 4589 } |
4586 | 4590 |
4587 | 4591 |
4588 ElementsKind Map::elements_kind() { | 4592 ElementsKind Map::elements_kind() { |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5504 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) | 5508 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) |
5505 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) | 5509 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) |
5506 ACCESSORS(AccessorInfo, js_getter, Object, kJsGetterOffset) | 5510 ACCESSORS(AccessorInfo, js_getter, Object, kJsGetterOffset) |
5507 ACCESSORS(AccessorInfo, data, Object, kDataOffset) | 5511 ACCESSORS(AccessorInfo, data, Object, kDataOffset) |
5508 | 5512 |
5509 ACCESSORS(Box, value, Object, kValueOffset) | 5513 ACCESSORS(Box, value, Object, kValueOffset) |
5510 | 5514 |
5511 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) | 5515 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) |
5512 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) | 5516 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) |
5513 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) | 5517 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) |
| 5518 SMI_ACCESSORS(PrototypeInfo, bit_field, kBitFieldOffset) |
| 5519 BOOL_ACCESSORS(PrototypeInfo, bit_field, should_be_fast_map, kShouldBeFastBit) |
5514 | 5520 |
5515 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, | 5521 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, |
5516 kScopeInfoOffset) | 5522 kScopeInfoOffset) |
5517 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, | 5523 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, |
5518 kExtensionOffset) | 5524 kExtensionOffset) |
5519 | 5525 |
5520 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) | 5526 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) |
5521 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) | 5527 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) |
5522 | 5528 |
5523 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) | 5529 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7929 #undef WRITE_INT64_FIELD | 7935 #undef WRITE_INT64_FIELD |
7930 #undef READ_BYTE_FIELD | 7936 #undef READ_BYTE_FIELD |
7931 #undef WRITE_BYTE_FIELD | 7937 #undef WRITE_BYTE_FIELD |
7932 #undef NOBARRIER_READ_BYTE_FIELD | 7938 #undef NOBARRIER_READ_BYTE_FIELD |
7933 #undef NOBARRIER_WRITE_BYTE_FIELD | 7939 #undef NOBARRIER_WRITE_BYTE_FIELD |
7934 | 7940 |
7935 } // namespace internal | 7941 } // namespace internal |
7936 } // namespace v8 | 7942 } // namespace v8 |
7937 | 7943 |
7938 #endif // V8_OBJECTS_INL_H_ | 7944 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |