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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 return GetProperty(object, str); | 1196 return GetProperty(object, str); |
1197 } | 1197 } |
1198 | 1198 |
1199 | 1199 |
1200 MaybeHandle<Object> JSObject::DefinePropertyOrElement( | |
1201 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, | |
1202 PropertyAttributes attributes, ExecutableAccessorInfoHandling handling) { | |
1203 uint32_t index; | |
1204 if (name->AsArrayIndex(&index)) { | |
1205 return SetOwnElementIgnoreAttributes(object, index, value, attributes, | |
1206 handling); | |
1207 } | |
1208 | |
1209 // TODO(verwaest): Is this necessary? | |
1210 if (name->IsString()) name = String::Flatten(Handle<String>::cast(name)); | |
1211 return SetOwnPropertyIgnoreAttributes(object, name, value, attributes, | |
1212 handling); | |
1213 } | |
1214 | |
1215 | |
1216 #define FIELD_ADDR(p, offset) \ | 1200 #define FIELD_ADDR(p, offset) \ |
1217 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) | 1201 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) |
1218 | 1202 |
1219 #define FIELD_ADDR_CONST(p, offset) \ | 1203 #define FIELD_ADDR_CONST(p, offset) \ |
1220 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) | 1204 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) |
1221 | 1205 |
1222 #define READ_FIELD(p, offset) \ | 1206 #define READ_FIELD(p, offset) \ |
1223 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) | 1207 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) |
1224 | 1208 |
1225 #define ACQUIRE_READ_FIELD(p, offset) \ | 1209 #define ACQUIRE_READ_FIELD(p, offset) \ |
(...skipping 6137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7363 #undef READ_SHORT_FIELD | 7347 #undef READ_SHORT_FIELD |
7364 #undef WRITE_SHORT_FIELD | 7348 #undef WRITE_SHORT_FIELD |
7365 #undef READ_BYTE_FIELD | 7349 #undef READ_BYTE_FIELD |
7366 #undef WRITE_BYTE_FIELD | 7350 #undef WRITE_BYTE_FIELD |
7367 #undef NOBARRIER_READ_BYTE_FIELD | 7351 #undef NOBARRIER_READ_BYTE_FIELD |
7368 #undef NOBARRIER_WRITE_BYTE_FIELD | 7352 #undef NOBARRIER_WRITE_BYTE_FIELD |
7369 | 7353 |
7370 } } // namespace v8::internal | 7354 } } // namespace v8::internal |
7371 | 7355 |
7372 #endif // V8_OBJECTS_INL_H_ | 7356 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |