| 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/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 INLINE(bool IsUnseededNumberDictionary() const); | 1061 INLINE(bool IsUnseededNumberDictionary() const); |
| 1062 INLINE(bool IsOrderedHashSet() const); | 1062 INLINE(bool IsOrderedHashSet() const); |
| 1063 INLINE(bool IsOrderedHashMap() const); | 1063 INLINE(bool IsOrderedHashMap() const); |
| 1064 static bool IsPromise(Handle<Object> object); | 1064 static bool IsPromise(Handle<Object> object); |
| 1065 | 1065 |
| 1066 // Extract the number. | 1066 // Extract the number. |
| 1067 inline double Number() const; | 1067 inline double Number() const; |
| 1068 INLINE(bool IsNaN() const); | 1068 INLINE(bool IsNaN() const); |
| 1069 INLINE(bool IsMinusZero() const); | 1069 INLINE(bool IsMinusZero() const); |
| 1070 bool ToInt32(int32_t* value); | 1070 bool ToInt32(int32_t* value); |
| 1071 bool ToUint32(uint32_t* value); | 1071 inline bool ToUint32(uint32_t* value); |
| 1072 | 1072 |
| 1073 inline Representation OptimalRepresentation(); | 1073 inline Representation OptimalRepresentation(); |
| 1074 | 1074 |
| 1075 inline ElementsKind OptimalElementsKind(); | 1075 inline ElementsKind OptimalElementsKind(); |
| 1076 | 1076 |
| 1077 inline bool FitsRepresentation(Representation representation); | 1077 inline bool FitsRepresentation(Representation representation); |
| 1078 | 1078 |
| 1079 // Checks whether two valid primitive encodings of a property name resolve to | 1079 // Checks whether two valid primitive encodings of a property name resolve to |
| 1080 // the same logical property. E.g., the smi 1, the string "1" and the double | 1080 // the same logical property. E.g., the smi 1, the string "1" and the double |
| 1081 // 1 all refer to the same property, so this helper will return true. | 1081 // 1 all refer to the same property, so this helper will return true. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 bool StrictEquals(Object* that); | 1113 bool StrictEquals(Object* that); |
| 1114 | 1114 |
| 1115 // Convert to a JSObject if needed. | 1115 // Convert to a JSObject if needed. |
| 1116 // native_context is used when creating wrapper object. | 1116 // native_context is used when creating wrapper object. |
| 1117 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( | 1117 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( |
| 1118 Isolate* isolate, Handle<Object> object); | 1118 Isolate* isolate, Handle<Object> object); |
| 1119 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( | 1119 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( |
| 1120 Isolate* isolate, Handle<Object> object, Handle<Context> context); | 1120 Isolate* isolate, Handle<Object> object, Handle<Context> context); |
| 1121 | 1121 |
| 1122 // ES6 section 7.1.14 ToPropertyKey | 1122 // ES6 section 7.1.14 ToPropertyKey |
| 1123 MUST_USE_RESULT static MaybeHandle<Name> ToName(Isolate* isolate, | 1123 MUST_USE_RESULT static inline MaybeHandle<Name> ToName(Isolate* isolate, |
| 1124 Handle<Object> input); | 1124 Handle<Object> input); |
| 1125 | 1125 |
| 1126 // ES6 section 7.1.1 ToPrimitive | 1126 // ES6 section 7.1.1 ToPrimitive |
| 1127 MUST_USE_RESULT static inline MaybeHandle<Object> ToPrimitive( | 1127 MUST_USE_RESULT static inline MaybeHandle<Object> ToPrimitive( |
| 1128 Handle<Object> input, ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 1128 Handle<Object> input, ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
| 1129 | 1129 |
| 1130 // ES6 section 7.1.3 ToNumber | 1130 // ES6 section 7.1.3 ToNumber |
| 1131 MUST_USE_RESULT static MaybeHandle<Object> ToNumber(Handle<Object> input); | 1131 MUST_USE_RESULT static MaybeHandle<Object> ToNumber(Handle<Object> input); |
| 1132 | 1132 |
| 1133 // ES6 section 7.1.4 ToInteger | 1133 // ES6 section 7.1.4 ToInteger |
| 1134 MUST_USE_RESULT static MaybeHandle<Object> ToInteger(Isolate* isolate, | 1134 MUST_USE_RESULT static MaybeHandle<Object> ToInteger(Isolate* isolate, |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 // Return the map of the root of object's prototype chain. | 1365 // Return the map of the root of object's prototype chain. |
| 1366 Map* GetRootMap(Isolate* isolate); | 1366 Map* GetRootMap(Isolate* isolate); |
| 1367 | 1367 |
| 1368 // Helper for SetProperty and SetSuperProperty. | 1368 // Helper for SetProperty and SetSuperProperty. |
| 1369 // Return value is only meaningful if [found] is set to true on return. | 1369 // Return value is only meaningful if [found] is set to true on return. |
| 1370 MUST_USE_RESULT static Maybe<bool> SetPropertyInternal( | 1370 MUST_USE_RESULT static Maybe<bool> SetPropertyInternal( |
| 1371 LookupIterator* it, Handle<Object> value, LanguageMode language_mode, | 1371 LookupIterator* it, Handle<Object> value, LanguageMode language_mode, |
| 1372 StoreFromKeyed store_mode, bool* found); | 1372 StoreFromKeyed store_mode, bool* found); |
| 1373 | 1373 |
| 1374 MUST_USE_RESULT static MaybeHandle<Name> ConvertToName(Isolate* isolate, |
| 1375 Handle<Object> input); |
| 1376 |
| 1374 DISALLOW_IMPLICIT_CONSTRUCTORS(Object); | 1377 DISALLOW_IMPLICIT_CONSTRUCTORS(Object); |
| 1375 }; | 1378 }; |
| 1376 | 1379 |
| 1377 | 1380 |
| 1378 // In objects.h to be usable without objects-inl.h inclusion. | 1381 // In objects.h to be usable without objects-inl.h inclusion. |
| 1379 bool Object::IsSmi() const { return HAS_SMI_TAG(this); } | 1382 bool Object::IsSmi() const { return HAS_SMI_TAG(this); } |
| 1380 bool Object::IsHeapObject() const { return Internals::HasHeapObjectTag(this); } | 1383 bool Object::IsHeapObject() const { return Internals::HasHeapObjectTag(this); } |
| 1381 | 1384 |
| 1382 | 1385 |
| 1383 struct Brief { | 1386 struct Brief { |
| (...skipping 9487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10871 } | 10874 } |
| 10872 return value; | 10875 return value; |
| 10873 } | 10876 } |
| 10874 }; | 10877 }; |
| 10875 | 10878 |
| 10876 | 10879 |
| 10877 } // NOLINT, false-positive due to second-order macros. | 10880 } // NOLINT, false-positive due to second-order macros. |
| 10878 } // NOLINT, false-positive due to second-order macros. | 10881 } // NOLINT, false-positive due to second-order macros. |
| 10879 | 10882 |
| 10880 #endif // V8_OBJECTS_H_ | 10883 #endif // V8_OBJECTS_H_ |
| OLD | NEW |