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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 iter.Advance(); | 1186 iter.Advance(); |
1187 } | 1187 } |
1188 return PrototypeIterator::GetCurrent(iter); | 1188 return PrototypeIterator::GetCurrent(iter); |
1189 } | 1189 } |
1190 | 1190 |
1191 | 1191 |
1192 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, | 1192 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, |
1193 Handle<Object> object, | 1193 Handle<Object> object, |
1194 const char* name) { | 1194 const char* name) { |
1195 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); | 1195 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); |
1196 DCHECK(!str.is_null()); | |
1197 #ifdef DEBUG | |
1198 uint32_t index; // Assert that the name is not an array index. | |
1199 DCHECK(!str->AsArrayIndex(&index)); | |
1200 #endif // DEBUG | |
1201 return GetProperty(object, str); | 1196 return GetProperty(object, str); |
1202 } | 1197 } |
1203 | 1198 |
1204 | 1199 |
1205 MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, | 1200 MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, |
1206 Handle<JSReceiver> receiver, | 1201 Handle<JSReceiver> receiver, |
1207 uint32_t index, | 1202 uint32_t index, |
1208 Handle<Object> value, | 1203 Handle<Object> value, |
1209 LanguageMode language_mode) { | 1204 LanguageMode language_mode) { |
1210 Isolate* isolate = proxy->GetIsolate(); | 1205 Isolate* isolate = proxy->GetIsolate(); |
1211 Handle<String> name = isolate->factory()->Uint32ToString(index); | 1206 Handle<String> name = isolate->factory()->Uint32ToString(index); |
1212 return SetPropertyWithHandler(proxy, receiver, name, value, language_mode); | 1207 return SetPropertyWithHandler(proxy, receiver, name, value, language_mode); |
1213 } | 1208 } |
1214 | 1209 |
1215 | 1210 |
1216 Maybe<bool> JSProxy::HasElementWithHandler(Handle<JSProxy> proxy, | |
1217 uint32_t index) { | |
1218 Isolate* isolate = proxy->GetIsolate(); | |
1219 Handle<String> name = isolate->factory()->Uint32ToString(index); | |
1220 return HasPropertyWithHandler(proxy, name); | |
1221 } | |
1222 | |
1223 | |
1224 #define FIELD_ADDR(p, offset) \ | 1211 #define FIELD_ADDR(p, offset) \ |
1225 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) | 1212 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) |
1226 | 1213 |
1227 #define FIELD_ADDR_CONST(p, offset) \ | 1214 #define FIELD_ADDR_CONST(p, offset) \ |
1228 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) | 1215 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) |
1229 | 1216 |
1230 #define READ_FIELD(p, offset) \ | 1217 #define READ_FIELD(p, offset) \ |
1231 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) | 1218 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) |
1232 | 1219 |
1233 #define ACQUIRE_READ_FIELD(p, offset) \ | 1220 #define ACQUIRE_READ_FIELD(p, offset) \ |
(...skipping 6445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7679 #undef READ_SHORT_FIELD | 7666 #undef READ_SHORT_FIELD |
7680 #undef WRITE_SHORT_FIELD | 7667 #undef WRITE_SHORT_FIELD |
7681 #undef READ_BYTE_FIELD | 7668 #undef READ_BYTE_FIELD |
7682 #undef WRITE_BYTE_FIELD | 7669 #undef WRITE_BYTE_FIELD |
7683 #undef NOBARRIER_READ_BYTE_FIELD | 7670 #undef NOBARRIER_READ_BYTE_FIELD |
7684 #undef NOBARRIER_WRITE_BYTE_FIELD | 7671 #undef NOBARRIER_WRITE_BYTE_FIELD |
7685 | 7672 |
7686 } } // namespace v8::internal | 7673 } } // namespace v8::internal |
7687 | 7674 |
7688 #endif // V8_OBJECTS_INL_H_ | 7675 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |