OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 MUST_USE_RESULT static MaybeHandle<Object> BitwiseAnd(Isolate* isolate, | 1208 MUST_USE_RESULT static MaybeHandle<Object> BitwiseAnd(Isolate* isolate, |
1209 Handle<Object> lhs, | 1209 Handle<Object> lhs, |
1210 Handle<Object> rhs); | 1210 Handle<Object> rhs); |
1211 MUST_USE_RESULT static MaybeHandle<Object> BitwiseOr(Isolate* isolate, | 1211 MUST_USE_RESULT static MaybeHandle<Object> BitwiseOr(Isolate* isolate, |
1212 Handle<Object> lhs, | 1212 Handle<Object> lhs, |
1213 Handle<Object> rhs); | 1213 Handle<Object> rhs); |
1214 MUST_USE_RESULT static MaybeHandle<Object> BitwiseXor(Isolate* isolate, | 1214 MUST_USE_RESULT static MaybeHandle<Object> BitwiseXor(Isolate* isolate, |
1215 Handle<Object> lhs, | 1215 Handle<Object> lhs, |
1216 Handle<Object> rhs); | 1216 Handle<Object> rhs); |
1217 | 1217 |
1218 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( | 1218 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it); |
1219 LookupIterator* it, LanguageMode language_mode = SLOPPY); | |
1220 | 1219 |
1221 // ES6 [[Set]] (when passed DONT_THROW) | 1220 // ES6 [[Set]] (when passed DONT_THROW) |
1222 // Invariants for this and related functions (unless stated otherwise): | 1221 // Invariants for this and related functions (unless stated otherwise): |
1223 // 1) When the result is Nothing, an exception is pending. | 1222 // 1) When the result is Nothing, an exception is pending. |
1224 // 2) When passed THROW_ON_ERROR, the result is never Just(false). | 1223 // 2) When passed THROW_ON_ERROR, the result is never Just(false). |
1225 // In some cases, an exception is thrown regardless of the ShouldThrow | 1224 // In some cases, an exception is thrown regardless of the ShouldThrow |
1226 // argument. These cases are either in accordance with the spec or not | 1225 // argument. These cases are either in accordance with the spec or not |
1227 // covered by it (eg., concerning API callbacks). | 1226 // covered by it (eg., concerning API callbacks). |
1228 MUST_USE_RESULT static Maybe<bool> SetProperty(LookupIterator* it, | 1227 MUST_USE_RESULT static Maybe<bool> SetProperty(LookupIterator* it, |
1229 Handle<Object> value, | 1228 Handle<Object> value, |
1230 LanguageMode language_mode, | 1229 LanguageMode language_mode, |
1231 StoreFromKeyed store_mode); | 1230 StoreFromKeyed store_mode); |
1232 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 1231 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
1233 Handle<Object> object, Handle<Name> name, Handle<Object> value, | 1232 Handle<Object> object, Handle<Name> name, Handle<Object> value, |
1234 LanguageMode language_mode, | 1233 LanguageMode language_mode, |
1235 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 1234 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
1236 | 1235 |
1237 MUST_USE_RESULT static Maybe<bool> SetSuperProperty( | 1236 MUST_USE_RESULT static Maybe<bool> SetSuperProperty( |
1238 LookupIterator* it, Handle<Object> value, LanguageMode language_mode, | 1237 LookupIterator* it, Handle<Object> value, LanguageMode language_mode, |
1239 StoreFromKeyed store_mode); | 1238 StoreFromKeyed store_mode); |
1240 | 1239 |
1241 MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty( | 1240 MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty( |
1242 LookupIterator* it, LanguageMode language_mode); | 1241 LookupIterator* it); |
1243 MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty( | 1242 MUST_USE_RESULT static MaybeHandle<Object> ReadAbsentProperty( |
1244 Isolate* isolate, Handle<Object> receiver, Handle<Object> name, | 1243 Isolate* isolate, Handle<Object> receiver, Handle<Object> name); |
1245 LanguageMode language_mode); | |
1246 MUST_USE_RESULT static Maybe<bool> CannotCreateProperty( | 1244 MUST_USE_RESULT static Maybe<bool> CannotCreateProperty( |
1247 Isolate* isolate, Handle<Object> receiver, Handle<Object> name, | 1245 Isolate* isolate, Handle<Object> receiver, Handle<Object> name, |
1248 Handle<Object> value, ShouldThrow should_throw); | 1246 Handle<Object> value, ShouldThrow should_throw); |
1249 MUST_USE_RESULT static Maybe<bool> WriteToReadOnlyProperty( | 1247 MUST_USE_RESULT static Maybe<bool> WriteToReadOnlyProperty( |
1250 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); | 1248 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); |
1251 MUST_USE_RESULT static Maybe<bool> WriteToReadOnlyProperty( | 1249 MUST_USE_RESULT static Maybe<bool> WriteToReadOnlyProperty( |
1252 Isolate* isolate, Handle<Object> receiver, Handle<Object> name, | 1250 Isolate* isolate, Handle<Object> receiver, Handle<Object> name, |
1253 Handle<Object> value, ShouldThrow should_throw); | 1251 Handle<Object> value, ShouldThrow should_throw); |
1254 MUST_USE_RESULT static Maybe<bool> RedefineIncompatibleProperty( | 1252 MUST_USE_RESULT static Maybe<bool> RedefineIncompatibleProperty( |
1255 Isolate* isolate, Handle<Object> name, Handle<Object> value, | 1253 Isolate* isolate, Handle<Object> name, Handle<Object> value, |
1256 ShouldThrow should_throw); | 1254 ShouldThrow should_throw); |
1257 MUST_USE_RESULT static Maybe<bool> SetDataProperty(LookupIterator* it, | 1255 MUST_USE_RESULT static Maybe<bool> SetDataProperty(LookupIterator* it, |
1258 Handle<Object> value); | 1256 Handle<Object> value); |
1259 MUST_USE_RESULT static Maybe<bool> AddDataProperty( | 1257 MUST_USE_RESULT static Maybe<bool> AddDataProperty( |
1260 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 1258 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
1261 ShouldThrow should_throw, StoreFromKeyed store_mode); | 1259 ShouldThrow should_throw, StoreFromKeyed store_mode); |
1262 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( | 1260 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( |
1263 Handle<Object> object, Handle<Name> name, | 1261 Handle<Object> object, Handle<Name> name); |
1264 LanguageMode language_mode = SLOPPY); | |
1265 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( | 1262 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( |
1266 Handle<Object> receiver, Handle<Name> name, Handle<JSReceiver> holder, | 1263 Handle<Object> receiver, Handle<Name> name, Handle<JSReceiver> holder); |
1267 LanguageMode language_mode = SLOPPY); | |
1268 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( | 1264 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
1269 Isolate* isolate, Handle<Object> object, const char* key, | 1265 Isolate* isolate, Handle<Object> object, const char* key); |
1270 LanguageMode language_mode = SLOPPY); | |
1271 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( | 1266 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
1272 Handle<Object> object, Handle<Name> name, | 1267 Handle<Object> object, Handle<Name> name); |
1273 LanguageMode language_mode = SLOPPY); | |
1274 | 1268 |
1275 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithAccessor( | 1269 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithAccessor( |
1276 LookupIterator* it, LanguageMode language_mode); | 1270 LookupIterator* it); |
1277 MUST_USE_RESULT static Maybe<bool> SetPropertyWithAccessor( | 1271 MUST_USE_RESULT static Maybe<bool> SetPropertyWithAccessor( |
1278 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); | 1272 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); |
1279 | 1273 |
1280 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithDefinedGetter( | 1274 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithDefinedGetter( |
1281 Handle<Object> receiver, | 1275 Handle<Object> receiver, |
1282 Handle<JSReceiver> getter); | 1276 Handle<JSReceiver> getter); |
1283 MUST_USE_RESULT static Maybe<bool> SetPropertyWithDefinedSetter( | 1277 MUST_USE_RESULT static Maybe<bool> SetPropertyWithDefinedSetter( |
1284 Handle<Object> receiver, Handle<JSReceiver> setter, Handle<Object> value, | 1278 Handle<Object> receiver, Handle<JSReceiver> setter, Handle<Object> value, |
1285 ShouldThrow should_throw); | 1279 ShouldThrow should_throw); |
1286 | 1280 |
1287 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( | 1281 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( |
1288 Isolate* isolate, Handle<Object> object, uint32_t index, | 1282 Isolate* isolate, Handle<Object> object, uint32_t index); |
1289 LanguageMode language_mode = SLOPPY); | |
1290 | 1283 |
1291 MUST_USE_RESULT static inline MaybeHandle<Object> SetElement( | 1284 MUST_USE_RESULT static inline MaybeHandle<Object> SetElement( |
1292 Isolate* isolate, Handle<Object> object, uint32_t index, | 1285 Isolate* isolate, Handle<Object> object, uint32_t index, |
1293 Handle<Object> value, LanguageMode language_mode); | 1286 Handle<Object> value, LanguageMode language_mode); |
1294 | 1287 |
1295 // Returns the permanent hash code associated with this object. May return | 1288 // Returns the permanent hash code associated with this object. May return |
1296 // undefined if not yet created. | 1289 // undefined if not yet created. |
1297 Object* GetHash(); | 1290 Object* GetHash(); |
1298 | 1291 |
1299 // Returns undefined for JSObjects, but returns the hash code for simple | 1292 // Returns undefined for JSObjects, but returns the hash code for simple |
(...skipping 8440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9740 PropertyDescriptor* desc, ShouldThrow should_throw); | 9733 PropertyDescriptor* desc, ShouldThrow should_throw); |
9741 | 9734 |
9742 // ES6 9.5.7 | 9735 // ES6 9.5.7 |
9743 MUST_USE_RESULT static Maybe<bool> HasProperty(Isolate* isolate, | 9736 MUST_USE_RESULT static Maybe<bool> HasProperty(Isolate* isolate, |
9744 Handle<JSProxy> proxy, | 9737 Handle<JSProxy> proxy, |
9745 Handle<Name> name); | 9738 Handle<Name> name); |
9746 | 9739 |
9747 // ES6 9.5.8 | 9740 // ES6 9.5.8 |
9748 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( | 9741 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( |
9749 Isolate* isolate, Handle<JSProxy> proxy, Handle<Name> name, | 9742 Isolate* isolate, Handle<JSProxy> proxy, Handle<Name> name, |
9750 Handle<Object> receiver, LanguageMode language_mode); | 9743 Handle<Object> receiver); |
9751 | 9744 |
9752 // ES6 9.5.9 | 9745 // ES6 9.5.9 |
9753 MUST_USE_RESULT static Maybe<bool> SetProperty(Handle<JSProxy> proxy, | 9746 MUST_USE_RESULT static Maybe<bool> SetProperty(Handle<JSProxy> proxy, |
9754 Handle<Name> name, | 9747 Handle<Name> name, |
9755 Handle<Object> value, | 9748 Handle<Object> value, |
9756 Handle<Object> receiver, | 9749 Handle<Object> receiver, |
9757 LanguageMode language_mode); | 9750 LanguageMode language_mode); |
9758 | 9751 |
9759 // ES6 9.5.10 (when passed SLOPPY) | 9752 // ES6 9.5.10 (when passed SLOPPY) |
9760 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( | 9753 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10850 } | 10843 } |
10851 return value; | 10844 return value; |
10852 } | 10845 } |
10853 }; | 10846 }; |
10854 | 10847 |
10855 | 10848 |
10856 } // NOLINT, false-positive due to second-order macros. | 10849 } // NOLINT, false-positive due to second-order macros. |
10857 } // NOLINT, false-positive due to second-order macros. | 10850 } // NOLINT, false-positive due to second-order macros. |
10858 | 10851 |
10859 #endif // V8_OBJECTS_H_ | 10852 #endif // V8_OBJECTS_H_ |
OLD | NEW |