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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 Handle<Object> rhs); | 1295 Handle<Object> rhs); |
1296 | 1296 |
1297 // ES6 section 7.3.19 OrdinaryHasInstance (C, O). | 1297 // ES6 section 7.3.19 OrdinaryHasInstance (C, O). |
1298 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryHasInstance( | 1298 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryHasInstance( |
1299 Isolate* isolate, Handle<Object> callable, Handle<Object> object); | 1299 Isolate* isolate, Handle<Object> callable, Handle<Object> object); |
1300 | 1300 |
1301 // ES6 section 12.10.4 Runtime Semantics: InstanceofOperator(O, C) | 1301 // ES6 section 12.10.4 Runtime Semantics: InstanceofOperator(O, C) |
1302 MUST_USE_RESULT static MaybeHandle<Object> InstanceOf( | 1302 MUST_USE_RESULT static MaybeHandle<Object> InstanceOf( |
1303 Isolate* isolate, Handle<Object> object, Handle<Object> callable); | 1303 Isolate* isolate, Handle<Object> object, Handle<Object> callable); |
1304 | 1304 |
1305 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(LookupIterator* it); | 1305 V8_EXPORT_PRIVATE MUST_USE_RESULT static MaybeHandle<Object> GetProperty( |
| 1306 LookupIterator* it); |
1306 | 1307 |
1307 // ES6 [[Set]] (when passed DONT_THROW) | 1308 // ES6 [[Set]] (when passed DONT_THROW) |
1308 // Invariants for this and related functions (unless stated otherwise): | 1309 // Invariants for this and related functions (unless stated otherwise): |
1309 // 1) When the result is Nothing, an exception is pending. | 1310 // 1) When the result is Nothing, an exception is pending. |
1310 // 2) When passed THROW_ON_ERROR, the result is never Just(false). | 1311 // 2) When passed THROW_ON_ERROR, the result is never Just(false). |
1311 // In some cases, an exception is thrown regardless of the ShouldThrow | 1312 // In some cases, an exception is thrown regardless of the ShouldThrow |
1312 // argument. These cases are either in accordance with the spec or not | 1313 // argument. These cases are either in accordance with the spec or not |
1313 // covered by it (eg., concerning API callbacks). | 1314 // covered by it (eg., concerning API callbacks). |
1314 MUST_USE_RESULT static Maybe<bool> SetProperty(LookupIterator* it, | 1315 MUST_USE_RESULT static Maybe<bool> SetProperty(LookupIterator* it, |
1315 Handle<Object> value, | 1316 Handle<Object> value, |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 PropertyDescriptor* current, Handle<Name> property_name, | 1959 PropertyDescriptor* current, Handle<Name> property_name, |
1959 ShouldThrow should_throw); | 1960 ShouldThrow should_throw); |
1960 // ES6 9.1.6.3 | 1961 // ES6 9.1.6.3 |
1961 // |it| can be NULL in cases where the ES spec passes |undefined| as the | 1962 // |it| can be NULL in cases where the ES spec passes |undefined| as the |
1962 // receiver. Exactly one of |it| and |property_name| must be provided. | 1963 // receiver. Exactly one of |it| and |property_name| must be provided. |
1963 MUST_USE_RESULT static Maybe<bool> ValidateAndApplyPropertyDescriptor( | 1964 MUST_USE_RESULT static Maybe<bool> ValidateAndApplyPropertyDescriptor( |
1964 Isolate* isolate, LookupIterator* it, bool extensible, | 1965 Isolate* isolate, LookupIterator* it, bool extensible, |
1965 PropertyDescriptor* desc, PropertyDescriptor* current, | 1966 PropertyDescriptor* desc, PropertyDescriptor* current, |
1966 ShouldThrow should_throw, Handle<Name> property_name = Handle<Name>()); | 1967 ShouldThrow should_throw, Handle<Name> property_name = Handle<Name>()); |
1967 | 1968 |
1968 MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor( | 1969 V8_EXPORT_PRIVATE MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor( |
1969 Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key, | 1970 Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key, |
1970 PropertyDescriptor* desc); | 1971 PropertyDescriptor* desc); |
1971 MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor( | 1972 MUST_USE_RESULT static Maybe<bool> GetOwnPropertyDescriptor( |
1972 LookupIterator* it, PropertyDescriptor* desc); | 1973 LookupIterator* it, PropertyDescriptor* desc); |
1973 | 1974 |
1974 typedef PropertyAttributes IntegrityLevel; | 1975 typedef PropertyAttributes IntegrityLevel; |
1975 | 1976 |
1976 // ES6 7.3.14 (when passed DONT_THROW) | 1977 // ES6 7.3.14 (when passed DONT_THROW) |
1977 // 'level' must be SEALED or FROZEN. | 1978 // 'level' must be SEALED or FROZEN. |
1978 MUST_USE_RESULT static Maybe<bool> SetIntegrityLevel( | 1979 MUST_USE_RESULT static Maybe<bool> SetIntegrityLevel( |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3497 // StringTable. | 3498 // StringTable. |
3498 // | 3499 // |
3499 // No special elements in the prefix and the element size is 1 | 3500 // No special elements in the prefix and the element size is 1 |
3500 // because only the string itself (the key) needs to be stored. | 3501 // because only the string itself (the key) needs to be stored. |
3501 class StringTable: public HashTable<StringTable, | 3502 class StringTable: public HashTable<StringTable, |
3502 StringTableShape, | 3503 StringTableShape, |
3503 HashTableKey*> { | 3504 HashTableKey*> { |
3504 public: | 3505 public: |
3505 // Find string in the string table. If it is not there yet, it is | 3506 // Find string in the string table. If it is not there yet, it is |
3506 // added. The return value is the string found. | 3507 // added. The return value is the string found. |
3507 static Handle<String> LookupString(Isolate* isolate, Handle<String> key); | 3508 V8_EXPORT_PRIVATE static Handle<String> LookupString(Isolate* isolate, |
| 3509 Handle<String> key); |
3508 static Handle<String> LookupKey(Isolate* isolate, HashTableKey* key); | 3510 static Handle<String> LookupKey(Isolate* isolate, HashTableKey* key); |
3509 static String* LookupKeyIfExists(Isolate* isolate, HashTableKey* key); | 3511 static String* LookupKeyIfExists(Isolate* isolate, HashTableKey* key); |
3510 | 3512 |
3511 // Tries to internalize given string and returns string handle on success | 3513 // Tries to internalize given string and returns string handle on success |
3512 // or an empty handle otherwise. | 3514 // or an empty handle otherwise. |
3513 MUST_USE_RESULT static MaybeHandle<String> InternalizeStringIfExists( | 3515 MUST_USE_RESULT static MaybeHandle<String> InternalizeStringIfExists( |
3514 Isolate* isolate, | 3516 Isolate* isolate, |
3515 Handle<String> string); | 3517 Handle<String> string); |
3516 | 3518 |
3517 // Looks up a string that is equal to the given string and returns | 3519 // Looks up a string that is equal to the given string and returns |
(...skipping 4967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8485 kMultiline = 1 << 2, | 8487 kMultiline = 1 << 2, |
8486 kSticky = 1 << 3, | 8488 kSticky = 1 << 3, |
8487 kUnicode = 1 << 4, | 8489 kUnicode = 1 << 4, |
8488 }; | 8490 }; |
8489 typedef base::Flags<Flag> Flags; | 8491 typedef base::Flags<Flag> Flags; |
8490 | 8492 |
8491 DECL_ACCESSORS(data, Object) | 8493 DECL_ACCESSORS(data, Object) |
8492 DECL_ACCESSORS(flags, Object) | 8494 DECL_ACCESSORS(flags, Object) |
8493 DECL_ACCESSORS(source, Object) | 8495 DECL_ACCESSORS(source, Object) |
8494 | 8496 |
8495 static MaybeHandle<JSRegExp> New(Handle<String> source, Flags flags); | 8497 V8_EXPORT_PRIVATE static MaybeHandle<JSRegExp> New(Handle<String> source, |
| 8498 Flags flags); |
8496 static Handle<JSRegExp> Copy(Handle<JSRegExp> regexp); | 8499 static Handle<JSRegExp> Copy(Handle<JSRegExp> regexp); |
8497 | 8500 |
8498 static MaybeHandle<JSRegExp> Initialize(Handle<JSRegExp> regexp, | 8501 static MaybeHandle<JSRegExp> Initialize(Handle<JSRegExp> regexp, |
8499 Handle<String> source, Flags flags); | 8502 Handle<String> source, Flags flags); |
8500 static MaybeHandle<JSRegExp> Initialize(Handle<JSRegExp> regexp, | 8503 static MaybeHandle<JSRegExp> Initialize(Handle<JSRegExp> regexp, |
8501 Handle<String> source, | 8504 Handle<String> source, |
8502 Handle<String> flags_string); | 8505 Handle<String> flags_string); |
8503 | 8506 |
8504 inline Type TypeTag(); | 8507 inline Type TypeTag(); |
8505 inline int CaptureCount(); | 8508 inline int CaptureCount(); |
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11397 } | 11400 } |
11398 return value; | 11401 return value; |
11399 } | 11402 } |
11400 }; | 11403 }; |
11401 | 11404 |
11402 | 11405 |
11403 } // NOLINT, false-positive due to second-order macros. | 11406 } // NOLINT, false-positive due to second-order macros. |
11404 } // NOLINT, false-positive due to second-order macros. | 11407 } // NOLINT, false-positive due to second-order macros. |
11405 | 11408 |
11406 #endif // V8_OBJECTS_H_ | 11409 #endif // V8_OBJECTS_H_ |
OLD | NEW |