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 7095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7106 LookupIterator it = LookupIterator::PropertyOrElement(object->GetIsolate(), | 7106 LookupIterator it = LookupIterator::PropertyOrElement(object->GetIsolate(), |
7107 object, name, object); | 7107 object, name, object); |
7108 return HasProperty(&it); | 7108 return HasProperty(&it); |
7109 } | 7109 } |
7110 | 7110 |
7111 | 7111 |
7112 Maybe<bool> JSReceiver::HasOwnProperty(Handle<JSReceiver> object, | 7112 Maybe<bool> JSReceiver::HasOwnProperty(Handle<JSReceiver> object, |
7113 Handle<Name> name) { | 7113 Handle<Name> name) { |
7114 if (object->IsJSObject()) { // Shortcut | 7114 if (object->IsJSObject()) { // Shortcut |
7115 LookupIterator it = LookupIterator::PropertyOrElement( | 7115 LookupIterator it = LookupIterator::PropertyOrElement( |
7116 object->GetIsolate(), object, name, object, LookupIterator::HIDDEN); | 7116 object->GetIsolate(), object, name, object, LookupIterator::OWN); |
7117 return HasProperty(&it); | 7117 return HasProperty(&it); |
7118 } | 7118 } |
7119 | 7119 |
7120 Maybe<PropertyAttributes> attributes = | 7120 Maybe<PropertyAttributes> attributes = |
7121 JSReceiver::GetOwnPropertyAttributes(object, name); | 7121 JSReceiver::GetOwnPropertyAttributes(object, name); |
7122 MAYBE_RETURN(attributes, Nothing<bool>()); | 7122 MAYBE_RETURN(attributes, Nothing<bool>()); |
7123 return Just(attributes.FromJust() != ABSENT); | 7123 return Just(attributes.FromJust() != ABSENT); |
7124 } | 7124 } |
7125 | 7125 |
7126 | 7126 |
7127 Maybe<PropertyAttributes> JSReceiver::GetPropertyAttributes( | 7127 Maybe<PropertyAttributes> JSReceiver::GetPropertyAttributes( |
7128 Handle<JSReceiver> object, Handle<Name> name) { | 7128 Handle<JSReceiver> object, Handle<Name> name) { |
7129 LookupIterator it = LookupIterator::PropertyOrElement(name->GetIsolate(), | 7129 LookupIterator it = LookupIterator::PropertyOrElement(name->GetIsolate(), |
7130 object, name, object); | 7130 object, name, object); |
7131 return GetPropertyAttributes(&it); | 7131 return GetPropertyAttributes(&it); |
7132 } | 7132 } |
7133 | 7133 |
7134 | 7134 |
7135 Maybe<PropertyAttributes> JSReceiver::GetOwnPropertyAttributes( | 7135 Maybe<PropertyAttributes> JSReceiver::GetOwnPropertyAttributes( |
7136 Handle<JSReceiver> object, Handle<Name> name) { | 7136 Handle<JSReceiver> object, Handle<Name> name) { |
7137 LookupIterator it = LookupIterator::PropertyOrElement( | 7137 LookupIterator it = LookupIterator::PropertyOrElement( |
7138 name->GetIsolate(), object, name, object, LookupIterator::HIDDEN); | 7138 name->GetIsolate(), object, name, object, LookupIterator::OWN); |
7139 return GetPropertyAttributes(&it); | 7139 return GetPropertyAttributes(&it); |
7140 } | 7140 } |
7141 | 7141 |
7142 | 7142 |
7143 Maybe<bool> JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) { | 7143 Maybe<bool> JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) { |
7144 LookupIterator it(object->GetIsolate(), object, index, object); | 7144 LookupIterator it(object->GetIsolate(), object, index, object); |
7145 return HasProperty(&it); | 7145 return HasProperty(&it); |
7146 } | 7146 } |
7147 | 7147 |
7148 | 7148 |
7149 Maybe<PropertyAttributes> JSReceiver::GetElementAttributes( | 7149 Maybe<PropertyAttributes> JSReceiver::GetElementAttributes( |
7150 Handle<JSReceiver> object, uint32_t index) { | 7150 Handle<JSReceiver> object, uint32_t index) { |
7151 Isolate* isolate = object->GetIsolate(); | 7151 Isolate* isolate = object->GetIsolate(); |
7152 LookupIterator it(isolate, object, index, object); | 7152 LookupIterator it(isolate, object, index, object); |
7153 return GetPropertyAttributes(&it); | 7153 return GetPropertyAttributes(&it); |
7154 } | 7154 } |
7155 | 7155 |
7156 | 7156 |
7157 Maybe<PropertyAttributes> JSReceiver::GetOwnElementAttributes( | 7157 Maybe<PropertyAttributes> JSReceiver::GetOwnElementAttributes( |
7158 Handle<JSReceiver> object, uint32_t index) { | 7158 Handle<JSReceiver> object, uint32_t index) { |
7159 Isolate* isolate = object->GetIsolate(); | 7159 Isolate* isolate = object->GetIsolate(); |
7160 LookupIterator it(isolate, object, index, object, LookupIterator::HIDDEN); | 7160 LookupIterator it(isolate, object, index, object, LookupIterator::OWN); |
7161 return GetPropertyAttributes(&it); | 7161 return GetPropertyAttributes(&it); |
7162 } | 7162 } |
7163 | 7163 |
7164 | 7164 |
7165 bool JSGlobalObject::IsDetached() { | 7165 bool JSGlobalObject::IsDetached() { |
7166 return JSGlobalProxy::cast(global_proxy())->IsDetachedFrom(this); | 7166 return JSGlobalProxy::cast(global_proxy())->IsDetachedFrom(this); |
7167 } | 7167 } |
7168 | 7168 |
7169 | 7169 |
7170 bool JSGlobalProxy::IsDetachedFrom(JSGlobalObject* global) const { | 7170 bool JSGlobalProxy::IsDetachedFrom(JSGlobalObject* global) const { |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7851 #undef WRITE_INT64_FIELD | 7851 #undef WRITE_INT64_FIELD |
7852 #undef READ_BYTE_FIELD | 7852 #undef READ_BYTE_FIELD |
7853 #undef WRITE_BYTE_FIELD | 7853 #undef WRITE_BYTE_FIELD |
7854 #undef NOBARRIER_READ_BYTE_FIELD | 7854 #undef NOBARRIER_READ_BYTE_FIELD |
7855 #undef NOBARRIER_WRITE_BYTE_FIELD | 7855 #undef NOBARRIER_WRITE_BYTE_FIELD |
7856 | 7856 |
7857 } // namespace internal | 7857 } // namespace internal |
7858 } // namespace v8 | 7858 } // namespace v8 |
7859 | 7859 |
7860 #endif // V8_OBJECTS_INL_H_ | 7860 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |