| 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 6263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6274 bool JSReceiver::HasProperty(Handle<JSReceiver> object, | 6274 bool JSReceiver::HasProperty(Handle<JSReceiver> object, |
| 6275 Handle<Name> name) { | 6275 Handle<Name> name) { |
| 6276 if (object->IsJSProxy()) { | 6276 if (object->IsJSProxy()) { |
| 6277 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6277 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
| 6278 return JSProxy::HasPropertyWithHandler(proxy, name); | 6278 return JSProxy::HasPropertyWithHandler(proxy, name); |
| 6279 } | 6279 } |
| 6280 return GetPropertyAttribute(object, name) != ABSENT; | 6280 return GetPropertyAttribute(object, name) != ABSENT; |
| 6281 } | 6281 } |
| 6282 | 6282 |
| 6283 | 6283 |
| 6284 bool JSReceiver::HasLocalProperty(Handle<JSReceiver> object, | 6284 bool JSReceiver::HasOwnProperty(Handle<JSReceiver> object, Handle<Name> name) { |
| 6285 Handle<Name> name) { | |
| 6286 if (object->IsJSProxy()) { | 6285 if (object->IsJSProxy()) { |
| 6287 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6286 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
| 6288 return JSProxy::HasPropertyWithHandler(proxy, name); | 6287 return JSProxy::HasPropertyWithHandler(proxy, name); |
| 6289 } | 6288 } |
| 6290 return GetLocalPropertyAttribute(object, name) != ABSENT; | 6289 return GetOwnPropertyAttribute(object, name) != ABSENT; |
| 6291 } | 6290 } |
| 6292 | 6291 |
| 6293 | 6292 |
| 6294 PropertyAttributes JSReceiver::GetPropertyAttribute(Handle<JSReceiver> object, | 6293 PropertyAttributes JSReceiver::GetPropertyAttribute(Handle<JSReceiver> object, |
| 6295 Handle<Name> key) { | 6294 Handle<Name> key) { |
| 6296 uint32_t index; | 6295 uint32_t index; |
| 6297 if (object->IsJSObject() && key->AsArrayIndex(&index)) { | 6296 if (object->IsJSObject() && key->AsArrayIndex(&index)) { |
| 6298 return GetElementAttribute(object, index); | 6297 return GetElementAttribute(object, index); |
| 6299 } | 6298 } |
| 6300 return GetPropertyAttributeWithReceiver(object, object, key); | 6299 return GetPropertyAttributeWithReceiver(object, object, key); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6339 bool JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) { | 6338 bool JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) { |
| 6340 if (object->IsJSProxy()) { | 6339 if (object->IsJSProxy()) { |
| 6341 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6340 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
| 6342 return JSProxy::HasElementWithHandler(proxy, index); | 6341 return JSProxy::HasElementWithHandler(proxy, index); |
| 6343 } | 6342 } |
| 6344 return JSObject::GetElementAttributeWithReceiver( | 6343 return JSObject::GetElementAttributeWithReceiver( |
| 6345 Handle<JSObject>::cast(object), object, index, true) != ABSENT; | 6344 Handle<JSObject>::cast(object), object, index, true) != ABSENT; |
| 6346 } | 6345 } |
| 6347 | 6346 |
| 6348 | 6347 |
| 6349 bool JSReceiver::HasLocalElement(Handle<JSReceiver> object, uint32_t index) { | 6348 bool JSReceiver::HasOwnElement(Handle<JSReceiver> object, uint32_t index) { |
| 6350 if (object->IsJSProxy()) { | 6349 if (object->IsJSProxy()) { |
| 6351 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6350 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
| 6352 return JSProxy::HasElementWithHandler(proxy, index); | 6351 return JSProxy::HasElementWithHandler(proxy, index); |
| 6353 } | 6352 } |
| 6354 return JSObject::GetElementAttributeWithReceiver( | 6353 return JSObject::GetElementAttributeWithReceiver( |
| 6355 Handle<JSObject>::cast(object), object, index, false) != ABSENT; | 6354 Handle<JSObject>::cast(object), object, index, false) != ABSENT; |
| 6356 } | 6355 } |
| 6357 | 6356 |
| 6358 | 6357 |
| 6359 PropertyAttributes JSReceiver::GetLocalElementAttribute( | 6358 PropertyAttributes JSReceiver::GetOwnElementAttribute( |
| 6360 Handle<JSReceiver> object, uint32_t index) { | 6359 Handle<JSReceiver> object, uint32_t index) { |
| 6361 if (object->IsJSProxy()) { | 6360 if (object->IsJSProxy()) { |
| 6362 return JSProxy::GetElementAttributeWithHandler( | 6361 return JSProxy::GetElementAttributeWithHandler( |
| 6363 Handle<JSProxy>::cast(object), object, index); | 6362 Handle<JSProxy>::cast(object), object, index); |
| 6364 } | 6363 } |
| 6365 return JSObject::GetElementAttributeWithReceiver( | 6364 return JSObject::GetElementAttributeWithReceiver( |
| 6366 Handle<JSObject>::cast(object), object, index, false); | 6365 Handle<JSObject>::cast(object), object, index, false); |
| 6367 } | 6366 } |
| 6368 | 6367 |
| 6369 | 6368 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6858 #undef READ_SHORT_FIELD | 6857 #undef READ_SHORT_FIELD |
| 6859 #undef WRITE_SHORT_FIELD | 6858 #undef WRITE_SHORT_FIELD |
| 6860 #undef READ_BYTE_FIELD | 6859 #undef READ_BYTE_FIELD |
| 6861 #undef WRITE_BYTE_FIELD | 6860 #undef WRITE_BYTE_FIELD |
| 6862 #undef NOBARRIER_READ_BYTE_FIELD | 6861 #undef NOBARRIER_READ_BYTE_FIELD |
| 6863 #undef NOBARRIER_WRITE_BYTE_FIELD | 6862 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 6864 | 6863 |
| 6865 } } // namespace v8::internal | 6864 } } // namespace v8::internal |
| 6866 | 6865 |
| 6867 #endif // V8_OBJECTS_INL_H_ | 6866 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |