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 5094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5105 kDescriptorOffset) | 5105 kDescriptorOffset) |
5106 | 5106 |
5107 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) | 5107 ACCESSORS(ExecutableAccessorInfo, getter, Object, kGetterOffset) |
5108 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) | 5108 ACCESSORS(ExecutableAccessorInfo, setter, Object, kSetterOffset) |
5109 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) | 5109 ACCESSORS(ExecutableAccessorInfo, data, Object, kDataOffset) |
5110 | 5110 |
5111 ACCESSORS(Box, value, Object, kValueOffset) | 5111 ACCESSORS(Box, value, Object, kValueOffset) |
5112 | 5112 |
5113 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) | 5113 ACCESSORS(AccessorPair, getter, Object, kGetterOffset) |
5114 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) | 5114 ACCESSORS(AccessorPair, setter, Object, kSetterOffset) |
5115 ACCESSORS_TO_SMI(AccessorPair, access_flags, kAccessFlagsOffset) | |
5116 | 5115 |
5117 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) | 5116 ACCESSORS(AccessCheckInfo, named_callback, Object, kNamedCallbackOffset) |
5118 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset) | 5117 ACCESSORS(AccessCheckInfo, indexed_callback, Object, kIndexedCallbackOffset) |
5119 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) | 5118 ACCESSORS(AccessCheckInfo, data, Object, kDataOffset) |
5120 | 5119 |
5121 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset) | 5120 ACCESSORS(InterceptorInfo, getter, Object, kGetterOffset) |
5122 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset) | 5121 ACCESSORS(InterceptorInfo, setter, Object, kSetterOffset) |
5123 ACCESSORS(InterceptorInfo, query, Object, kQueryOffset) | 5122 ACCESSORS(InterceptorInfo, query, Object, kQueryOffset) |
5124 ACCESSORS(InterceptorInfo, deleter, Object, kDeleterOffset) | 5123 ACCESSORS(InterceptorInfo, deleter, Object, kDeleterOffset) |
5125 ACCESSORS(InterceptorInfo, enumerator, Object, kEnumeratorOffset) | 5124 ACCESSORS(InterceptorInfo, enumerator, Object, kEnumeratorOffset) |
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6546 if (!function_template->IsFunctionTemplateInfo()) return true; | 6545 if (!function_template->IsFunctionTemplateInfo()) return true; |
6547 return FunctionTemplateInfo::cast(function_template)->IsTemplateFor(receiver); | 6546 return FunctionTemplateInfo::cast(function_template)->IsTemplateFor(receiver); |
6548 } | 6547 } |
6549 | 6548 |
6550 | 6549 |
6551 void ExecutableAccessorInfo::clear_setter() { | 6550 void ExecutableAccessorInfo::clear_setter() { |
6552 set_setter(GetIsolate()->heap()->undefined_value(), SKIP_WRITE_BARRIER); | 6551 set_setter(GetIsolate()->heap()->undefined_value(), SKIP_WRITE_BARRIER); |
6553 } | 6552 } |
6554 | 6553 |
6555 | 6554 |
6556 void AccessorPair::set_access_flags(v8::AccessControl access_control) { | |
6557 int current = access_flags()->value(); | |
6558 current = BooleanBit::set(current, | |
6559 kAllCanReadBit, | |
6560 access_control & ALL_CAN_READ); | |
6561 current = BooleanBit::set(current, | |
6562 kAllCanWriteBit, | |
6563 access_control & ALL_CAN_WRITE); | |
6564 set_access_flags(Smi::FromInt(current)); | |
6565 } | |
6566 | |
6567 | |
6568 bool AccessorPair::all_can_read() { | |
6569 return BooleanBit::get(access_flags(), kAllCanReadBit); | |
6570 } | |
6571 | |
6572 | |
6573 bool AccessorPair::all_can_write() { | |
6574 return BooleanBit::get(access_flags(), kAllCanWriteBit); | |
6575 } | |
6576 | |
6577 | |
6578 template<typename Derived, typename Shape, typename Key> | 6555 template<typename Derived, typename Shape, typename Key> |
6579 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, | 6556 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |
6580 Handle<Object> key, | 6557 Handle<Object> key, |
6581 Handle<Object> value) { | 6558 Handle<Object> value) { |
6582 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); | 6559 SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0))); |
6583 } | 6560 } |
6584 | 6561 |
6585 | 6562 |
6586 template<typename Derived, typename Shape, typename Key> | 6563 template<typename Derived, typename Shape, typename Key> |
6587 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, | 6564 void Dictionary<Derived, Shape, Key>::SetEntry(int entry, |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6989 #undef READ_SHORT_FIELD | 6966 #undef READ_SHORT_FIELD |
6990 #undef WRITE_SHORT_FIELD | 6967 #undef WRITE_SHORT_FIELD |
6991 #undef READ_BYTE_FIELD | 6968 #undef READ_BYTE_FIELD |
6992 #undef WRITE_BYTE_FIELD | 6969 #undef WRITE_BYTE_FIELD |
6993 #undef NOBARRIER_READ_BYTE_FIELD | 6970 #undef NOBARRIER_READ_BYTE_FIELD |
6994 #undef NOBARRIER_WRITE_BYTE_FIELD | 6971 #undef NOBARRIER_WRITE_BYTE_FIELD |
6995 | 6972 |
6996 } } // namespace v8::internal | 6973 } } // namespace v8::internal |
6997 | 6974 |
6998 #endif // V8_OBJECTS_INL_H_ | 6975 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |