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 6670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6681 DCHECK(IsInternalizedString()); | 6681 DCHECK(IsInternalizedString()); |
6682 if (HasHashCode()) return this; | 6682 if (HasHashCode()) return this; |
6683 String* canonical = String::cast(READ_FIELD(this, kHashFieldSlot)); | 6683 String* canonical = String::cast(READ_FIELD(this, kHashFieldSlot)); |
6684 DCHECK(canonical->IsInternalizedString()); | 6684 DCHECK(canonical->IsInternalizedString()); |
6685 DCHECK(SlowEquals(canonical)); | 6685 DCHECK(SlowEquals(canonical)); |
6686 DCHECK(canonical->HasHashCode()); | 6686 DCHECK(canonical->HasHashCode()); |
6687 return canonical; | 6687 return canonical; |
6688 } | 6688 } |
6689 | 6689 |
6690 | 6690 |
6691 Object* JSReceiver::GetConstructor() { | |
6692 return map()->constructor(); | |
6693 } | |
6694 | |
6695 | |
6696 Maybe<bool> JSReceiver::HasProperty(Handle<JSReceiver> object, | 6691 Maybe<bool> JSReceiver::HasProperty(Handle<JSReceiver> object, |
6697 Handle<Name> name) { | 6692 Handle<Name> name) { |
6698 if (object->IsJSProxy()) { | 6693 if (object->IsJSProxy()) { |
6699 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); | 6694 Handle<JSProxy> proxy = Handle<JSProxy>::cast(object); |
6700 return JSProxy::HasPropertyWithHandler(proxy, name); | 6695 return JSProxy::HasPropertyWithHandler(proxy, name); |
6701 } | 6696 } |
6702 Maybe<PropertyAttributes> result = GetPropertyAttributes(object, name); | 6697 Maybe<PropertyAttributes> result = GetPropertyAttributes(object, name); |
6703 if (!result.has_value) return Maybe<bool>(); | 6698 if (!result.has_value) return Maybe<bool>(); |
6704 return maybe(result.value != ABSENT); | 6699 return maybe(result.value != ABSENT); |
6705 } | 6700 } |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7285 #undef READ_SHORT_FIELD | 7280 #undef READ_SHORT_FIELD |
7286 #undef WRITE_SHORT_FIELD | 7281 #undef WRITE_SHORT_FIELD |
7287 #undef READ_BYTE_FIELD | 7282 #undef READ_BYTE_FIELD |
7288 #undef WRITE_BYTE_FIELD | 7283 #undef WRITE_BYTE_FIELD |
7289 #undef NOBARRIER_READ_BYTE_FIELD | 7284 #undef NOBARRIER_READ_BYTE_FIELD |
7290 #undef NOBARRIER_WRITE_BYTE_FIELD | 7285 #undef NOBARRIER_WRITE_BYTE_FIELD |
7291 | 7286 |
7292 } } // namespace v8::internal | 7287 } } // namespace v8::internal |
7293 | 7288 |
7294 #endif // V8_OBJECTS_INL_H_ | 7289 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |