OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 Handle<Object> object, | 1085 Handle<Object> object, |
1086 uint32_t index) { | 1086 uint32_t index) { |
1087 // GetElement can trigger a getter which can cause allocation. | 1087 // GetElement can trigger a getter which can cause allocation. |
1088 // This was not always the case. This ASSERT is here to catch | 1088 // This was not always the case. This ASSERT is here to catch |
1089 // leftover incorrect uses. | 1089 // leftover incorrect uses. |
1090 ASSERT(AllowHeapAllocation::IsAllowed()); | 1090 ASSERT(AllowHeapAllocation::IsAllowed()); |
1091 return Object::GetElementWithReceiver(isolate, object, object, index); | 1091 return Object::GetElementWithReceiver(isolate, object, object, index); |
1092 } | 1092 } |
1093 | 1093 |
1094 | 1094 |
1095 Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate, | |
1096 Handle<Object> object, | |
1097 uint32_t index) { | |
1098 Handle<Object> result = | |
1099 Object::GetElementWithReceiver( | |
1100 isolate, object, object, index).ToHandleChecked(); | |
1101 return result; | |
1102 } | |
1103 | |
1104 | |
1105 MaybeObject* Object::GetProperty(Name* key) { | |
1106 PropertyAttributes attributes; | |
1107 return GetPropertyWithReceiver(this, key, &attributes); | |
1108 } | |
1109 | |
1110 | |
1111 #define FIELD_ADDR(p, offset) \ | 1095 #define FIELD_ADDR(p, offset) \ |
1112 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) | 1096 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) |
1113 | 1097 |
1114 #define READ_FIELD(p, offset) \ | 1098 #define READ_FIELD(p, offset) \ |
1115 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) | 1099 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) |
1116 | 1100 |
1117 #define ACQUIRE_READ_FIELD(p, offset) \ | 1101 #define ACQUIRE_READ_FIELD(p, offset) \ |
1118 reinterpret_cast<Object*>( \ | 1102 reinterpret_cast<Object*>( \ |
1119 Acquire_Load(reinterpret_cast<AtomicWord*>(FIELD_ADDR(p, offset)))) | 1103 Acquire_Load(reinterpret_cast<AtomicWord*>(FIELD_ADDR(p, offset)))) |
1120 | 1104 |
(...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3017 | 3001 |
3018 | 3002 |
3019 void Name::set_hash_field(uint32_t value) { | 3003 void Name::set_hash_field(uint32_t value) { |
3020 WRITE_UINT32_FIELD(this, kHashFieldOffset, value); | 3004 WRITE_UINT32_FIELD(this, kHashFieldOffset, value); |
3021 #if V8_HOST_ARCH_64_BIT | 3005 #if V8_HOST_ARCH_64_BIT |
3022 WRITE_UINT32_FIELD(this, kHashFieldOffset + kIntSize, 0); | 3006 WRITE_UINT32_FIELD(this, kHashFieldOffset + kIntSize, 0); |
3023 #endif | 3007 #endif |
3024 } | 3008 } |
3025 | 3009 |
3026 | 3010 |
3027 Handle<Object> GlobalObject::GetPropertyNoExceptionThrown( | |
3028 Handle<GlobalObject> global, | |
3029 Handle<Name> name) { | |
3030 Handle<Object> result = Object::GetProperty(global, name); | |
3031 CHECK_NOT_EMPTY_HANDLE(name->GetIsolate(), result); | |
3032 return result; | |
3033 } | |
3034 | |
3035 | |
3036 bool Name::Equals(Name* other) { | 3011 bool Name::Equals(Name* other) { |
3037 if (other == this) return true; | 3012 if (other == this) return true; |
3038 if ((this->IsInternalizedString() && other->IsInternalizedString()) || | 3013 if ((this->IsInternalizedString() && other->IsInternalizedString()) || |
3039 this->IsSymbol() || other->IsSymbol()) { | 3014 this->IsSymbol() || other->IsSymbol()) { |
3040 return false; | 3015 return false; |
3041 } | 3016 } |
3042 return String::cast(this)->SlowEquals(String::cast(other)); | 3017 return String::cast(this)->SlowEquals(String::cast(other)); |
3043 } | 3018 } |
3044 | 3019 |
3045 | 3020 |
(...skipping 4003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7049 #undef READ_SHORT_FIELD | 7024 #undef READ_SHORT_FIELD |
7050 #undef WRITE_SHORT_FIELD | 7025 #undef WRITE_SHORT_FIELD |
7051 #undef READ_BYTE_FIELD | 7026 #undef READ_BYTE_FIELD |
7052 #undef WRITE_BYTE_FIELD | 7027 #undef WRITE_BYTE_FIELD |
7053 #undef NOBARRIER_READ_BYTE_FIELD | 7028 #undef NOBARRIER_READ_BYTE_FIELD |
7054 #undef NOBARRIER_WRITE_BYTE_FIELD | 7029 #undef NOBARRIER_WRITE_BYTE_FIELD |
7055 | 7030 |
7056 } } // namespace v8::internal | 7031 } } // namespace v8::internal |
7057 | 7032 |
7058 #endif // V8_OBJECTS_INL_H_ | 7033 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |