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 6400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6411 return map()->constructor(); | 6411 return map()->constructor(); |
6412 } | 6412 } |
6413 | 6413 |
6414 | 6414 |
6415 bool JSReceiver::HasProperty(Handle<JSReceiver> object, | 6415 bool JSReceiver::HasProperty(Handle<JSReceiver> object, |
6416 Handle<Name> name) { | 6416 Handle<Name> name) { |
6417 if (object->IsJSProxy()) { | 6417 if (object->IsJSProxy()) { |
6418 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6418 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
6419 return JSProxy::HasPropertyWithHandler(proxy, name); | 6419 return JSProxy::HasPropertyWithHandler(proxy, name); |
6420 } | 6420 } |
6421 return GetPropertyAttribute(object, name) != ABSENT; | 6421 return GetPropertyAttributes(object, name) != ABSENT; |
6422 } | 6422 } |
6423 | 6423 |
6424 | 6424 |
6425 bool JSReceiver::HasOwnProperty(Handle<JSReceiver> object, Handle<Name> name) { | 6425 bool JSReceiver::HasOwnProperty(Handle<JSReceiver> object, Handle<Name> name) { |
6426 if (object->IsJSProxy()) { | 6426 if (object->IsJSProxy()) { |
6427 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6427 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
6428 return JSProxy::HasPropertyWithHandler(proxy, name); | 6428 return JSProxy::HasPropertyWithHandler(proxy, name); |
6429 } | 6429 } |
6430 return GetOwnPropertyAttribute(object, name) != ABSENT; | 6430 return GetOwnPropertyAttributes(object, name) != ABSENT; |
6431 } | 6431 } |
6432 | 6432 |
6433 | 6433 |
6434 PropertyAttributes JSReceiver::GetPropertyAttribute(Handle<JSReceiver> object, | 6434 PropertyAttributes JSReceiver::GetPropertyAttributes(Handle<JSReceiver> object, |
6435 Handle<Name> key) { | 6435 Handle<Name> key) { |
6436 uint32_t index; | 6436 uint32_t index; |
6437 if (object->IsJSObject() && key->AsArrayIndex(&index)) { | 6437 if (object->IsJSObject() && key->AsArrayIndex(&index)) { |
6438 return GetElementAttribute(object, index); | 6438 return GetElementAttribute(object, index); |
6439 } | 6439 } |
6440 return GetPropertyAttributeWithReceiver(object, object, key); | 6440 LookupIterator it(object, key); |
| 6441 return GetPropertyAttributes(&it); |
6441 } | 6442 } |
6442 | 6443 |
6443 | 6444 |
6444 PropertyAttributes JSReceiver::GetElementAttribute(Handle<JSReceiver> object, | 6445 PropertyAttributes JSReceiver::GetElementAttribute(Handle<JSReceiver> object, |
6445 uint32_t index) { | 6446 uint32_t index) { |
6446 if (object->IsJSProxy()) { | 6447 if (object->IsJSProxy()) { |
6447 return JSProxy::GetElementAttributeWithHandler( | 6448 return JSProxy::GetElementAttributeWithHandler( |
6448 Handle<JSProxy>::cast(object), object, index); | 6449 Handle<JSProxy>::cast(object), object, index); |
6449 } | 6450 } |
6450 return JSObject::GetElementAttributeWithReceiver( | 6451 return JSObject::GetElementAttributeWithReceiver( |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6985 #undef READ_SHORT_FIELD | 6986 #undef READ_SHORT_FIELD |
6986 #undef WRITE_SHORT_FIELD | 6987 #undef WRITE_SHORT_FIELD |
6987 #undef READ_BYTE_FIELD | 6988 #undef READ_BYTE_FIELD |
6988 #undef WRITE_BYTE_FIELD | 6989 #undef WRITE_BYTE_FIELD |
6989 #undef NOBARRIER_READ_BYTE_FIELD | 6990 #undef NOBARRIER_READ_BYTE_FIELD |
6990 #undef NOBARRIER_WRITE_BYTE_FIELD | 6991 #undef NOBARRIER_WRITE_BYTE_FIELD |
6991 | 6992 |
6992 } } // namespace v8::internal | 6993 } } // namespace v8::internal |
6993 | 6994 |
6994 #endif // V8_OBJECTS_INL_H_ | 6995 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |