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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 LookupIterator it(isolate, object, index); | 1105 LookupIterator it(isolate, object, index); |
1106 MAYBE_RETURN_NULL( | 1106 MAYBE_RETURN_NULL( |
1107 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); | 1107 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); |
1108 return value; | 1108 return value; |
1109 } | 1109 } |
1110 | 1110 |
1111 MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate, | 1111 MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate, |
1112 Handle<JSReceiver> receiver) { | 1112 Handle<JSReceiver> receiver) { |
1113 // We don't expect access checks to be needed on JSProxy objects. | 1113 // We don't expect access checks to be needed on JSProxy objects. |
1114 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); | 1114 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); |
1115 PrototypeIterator iter(isolate, receiver, | 1115 PrototypeIterator iter(isolate, receiver, kStartAtReceiver, |
1116 PrototypeIterator::START_AT_RECEIVER, | |
1117 PrototypeIterator::END_AT_NON_HIDDEN); | 1116 PrototypeIterator::END_AT_NON_HIDDEN); |
1118 do { | 1117 do { |
1119 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); | 1118 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); |
1120 } while (!iter.IsAtEnd()); | 1119 } while (!iter.IsAtEnd()); |
1121 return PrototypeIterator::GetCurrent(iter); | 1120 return PrototypeIterator::GetCurrent(iter); |
1122 } | 1121 } |
1123 | 1122 |
1124 MaybeHandle<Object> JSReceiver::GetProperty(Isolate* isolate, | 1123 MaybeHandle<Object> JSReceiver::GetProperty(Isolate* isolate, |
1125 Handle<JSReceiver> receiver, | 1124 Handle<JSReceiver> receiver, |
1126 const char* name) { | 1125 const char* name) { |
(...skipping 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4569 | 4568 |
4570 | 4569 |
4571 void Map::set_is_prototype_map(bool value) { | 4570 void Map::set_is_prototype_map(bool value) { |
4572 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value)); | 4571 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value)); |
4573 } | 4572 } |
4574 | 4573 |
4575 bool Map::is_prototype_map() const { | 4574 bool Map::is_prototype_map() const { |
4576 return IsPrototypeMapBits::decode(bit_field2()); | 4575 return IsPrototypeMapBits::decode(bit_field2()); |
4577 } | 4576 } |
4578 | 4577 |
| 4578 bool Map::should_be_fast_prototype_map() const { |
| 4579 if (!prototype_info()->IsPrototypeInfo()) return false; |
| 4580 return PrototypeInfo::cast(prototype_info())->should_be_fast_map(); |
| 4581 } |
4579 | 4582 |
4580 void Map::set_elements_kind(ElementsKind elements_kind) { | 4583 void Map::set_elements_kind(ElementsKind elements_kind) { |
4581 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); | 4584 DCHECK(static_cast<int>(elements_kind) < kElementsKindCount); |
4582 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); | 4585 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); |
4583 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); | 4586 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); |
4584 DCHECK(this->elements_kind() == elements_kind); | 4587 DCHECK(this->elements_kind() == elements_kind); |
4585 } | 4588 } |
4586 | 4589 |
4587 | 4590 |
4588 ElementsKind Map::elements_kind() { | 4591 ElementsKind Map::elements_kind() { |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5504 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) | 5507 ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) |
5505 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) | 5508 ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) |
5506 ACCESSORS(AccessorInfo, js_getter, Object, kJsGetterOffset) | 5509 ACCESSORS(AccessorInfo, js_getter, Object, kJsGetterOffset) |
5507 ACCESSORS(AccessorInfo, data, Object, kDataOffset) | 5510 ACCESSORS(AccessorInfo, data, Object, kDataOffset) |
5508 | 5511 |
5509 ACCESSORS(Box, value, Object, kValueOffset) | 5512 ACCESSORS(Box, value, Object, kValueOffset) |
5510 | 5513 |
5511 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) | 5514 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) |
5512 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) | 5515 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) |
5513 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) | 5516 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) |
| 5517 SMI_ACCESSORS(PrototypeInfo, bit_field, kBitFieldOffset) |
| 5518 BOOL_ACCESSORS(PrototypeInfo, bit_field, should_be_fast_map, kShouldBeFastBit) |
5514 | 5519 |
5515 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, | 5520 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, |
5516 kScopeInfoOffset) | 5521 kScopeInfoOffset) |
5517 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, | 5522 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, |
5518 kExtensionOffset) | 5523 kExtensionOffset) |
5519 | 5524 |
5520 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) | 5525 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) |
5521 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) | 5526 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) |
5522 | 5527 |
5523 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) | 5528 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7929 #undef WRITE_INT64_FIELD | 7934 #undef WRITE_INT64_FIELD |
7930 #undef READ_BYTE_FIELD | 7935 #undef READ_BYTE_FIELD |
7931 #undef WRITE_BYTE_FIELD | 7936 #undef WRITE_BYTE_FIELD |
7932 #undef NOBARRIER_READ_BYTE_FIELD | 7937 #undef NOBARRIER_READ_BYTE_FIELD |
7933 #undef NOBARRIER_WRITE_BYTE_FIELD | 7938 #undef NOBARRIER_WRITE_BYTE_FIELD |
7934 | 7939 |
7935 } // namespace internal | 7940 } // namespace internal |
7936 } // namespace v8 | 7941 } // namespace v8 |
7937 | 7942 |
7938 #endif // V8_OBJECTS_INL_H_ | 7943 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |