| 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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 if ((call).IsNothing()) return value; \ | 1057 if ((call).IsNothing()) return value; \ |
| 1058 } while (false) | 1058 } while (false) |
| 1059 | 1059 |
| 1060 #define MAYBE_RETURN_NULL(call) MAYBE_RETURN(call, MaybeHandle<Object>()) | 1060 #define MAYBE_RETURN_NULL(call) MAYBE_RETURN(call, MaybeHandle<Object>()) |
| 1061 | 1061 |
| 1062 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ | 1062 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ |
| 1063 INLINE(bool Is##Name() const); | 1063 INLINE(bool Is##Name() const); |
| 1064 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 1064 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 1065 #undef DECLARE_STRUCT_PREDICATE | 1065 #undef DECLARE_STRUCT_PREDICATE |
| 1066 | 1066 |
| 1067 INLINE(bool IsTheHole(Isolate* isolate) const); |
| 1068 INLINE(bool IsUndefined(Isolate* isolate) const); |
| 1069 |
| 1067 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. | 1070 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. |
| 1068 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); | 1071 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); |
| 1069 | 1072 |
| 1070 INLINE(bool IsNameDictionary() const); | 1073 INLINE(bool IsNameDictionary() const); |
| 1071 INLINE(bool IsGlobalDictionary() const); | 1074 INLINE(bool IsGlobalDictionary() const); |
| 1072 INLINE(bool IsSeededNumberDictionary() const); | 1075 INLINE(bool IsSeededNumberDictionary() const); |
| 1073 INLINE(bool IsUnseededNumberDictionary() const); | 1076 INLINE(bool IsUnseededNumberDictionary() const); |
| 1074 INLINE(bool IsOrderedHashSet() const); | 1077 INLINE(bool IsOrderedHashSet() const); |
| 1075 INLINE(bool IsOrderedHashMap() const); | 1078 INLINE(bool IsOrderedHashMap() const); |
| 1076 static bool IsPromise(Handle<Object> object); | 1079 static bool IsPromise(Handle<Object> object); |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 | 1556 |
| 1554 #define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const); | 1557 #define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const); |
| 1555 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 1558 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
| 1556 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) | 1559 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) |
| 1557 #undef IS_TYPE_FUNCTION_DECL | 1560 #undef IS_TYPE_FUNCTION_DECL |
| 1558 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ | 1561 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ |
| 1559 INLINE(bool Is##Name() const); | 1562 INLINE(bool Is##Name() const); |
| 1560 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 1563 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 1561 #undef DECLARE_STRUCT_PREDICATE | 1564 #undef DECLARE_STRUCT_PREDICATE |
| 1562 | 1565 |
| 1566 INLINE(bool IsTheHole(Isolate* isolate) const); |
| 1567 INLINE(bool IsUndefined(Isolate* isolate) const); |
| 1568 |
| 1563 // Converts an address to a HeapObject pointer. | 1569 // Converts an address to a HeapObject pointer. |
| 1564 static inline HeapObject* FromAddress(Address address) { | 1570 static inline HeapObject* FromAddress(Address address) { |
| 1565 DCHECK_TAG_ALIGNED(address); | 1571 DCHECK_TAG_ALIGNED(address); |
| 1566 return reinterpret_cast<HeapObject*>(address + kHeapObjectTag); | 1572 return reinterpret_cast<HeapObject*>(address + kHeapObjectTag); |
| 1567 } | 1573 } |
| 1568 | 1574 |
| 1569 // Returns the address of this HeapObject. | 1575 // Returns the address of this HeapObject. |
| 1570 inline Address address() { | 1576 inline Address address() { |
| 1571 return reinterpret_cast<Address>(this) - kHeapObjectTag; | 1577 return reinterpret_cast<Address>(this) - kHeapObjectTag; |
| 1572 } | 1578 } |
| (...skipping 9220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10793 } | 10799 } |
| 10794 return value; | 10800 return value; |
| 10795 } | 10801 } |
| 10796 }; | 10802 }; |
| 10797 | 10803 |
| 10798 | 10804 |
| 10799 } // NOLINT, false-positive due to second-order macros. | 10805 } // NOLINT, false-positive due to second-order macros. |
| 10800 } // NOLINT, false-positive due to second-order macros. | 10806 } // NOLINT, false-positive due to second-order macros. |
| 10801 | 10807 |
| 10802 #endif // V8_OBJECTS_H_ | 10808 #endif // V8_OBJECTS_H_ |
| OLD | NEW |