Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: src/objects-inl.h

Issue 1180943002: Reland of Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where re… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
1200 #define FIELD_ADDR(p, offset) \ 1216 #define FIELD_ADDR(p, offset) \
1201 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) 1217 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag)
1202 1218
1203 #define FIELD_ADDR_CONST(p, offset) \ 1219 #define FIELD_ADDR_CONST(p, offset) \
1204 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) 1220 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag)
1205 1221
1206 #define READ_FIELD(p, offset) \ 1222 #define READ_FIELD(p, offset) \
1207 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) 1223 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset)))
1208 1224
1209 #define ACQUIRE_READ_FIELD(p, offset) \ 1225 #define ACQUIRE_READ_FIELD(p, offset) \
(...skipping 6137 matching lines...) Expand 10 before | Expand all | Expand 10 after
7347 #undef READ_SHORT_FIELD 7363 #undef READ_SHORT_FIELD
7348 #undef WRITE_SHORT_FIELD 7364 #undef WRITE_SHORT_FIELD
7349 #undef READ_BYTE_FIELD 7365 #undef READ_BYTE_FIELD
7350 #undef WRITE_BYTE_FIELD 7366 #undef WRITE_BYTE_FIELD
7351 #undef NOBARRIER_READ_BYTE_FIELD 7367 #undef NOBARRIER_READ_BYTE_FIELD
7352 #undef NOBARRIER_WRITE_BYTE_FIELD 7368 #undef NOBARRIER_WRITE_BYTE_FIELD
7353 7369
7354 } } // namespace v8::internal 7370 } } // namespace v8::internal
7355 7371
7356 #endif // V8_OBJECTS_INL_H_ 7372 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698