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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 // data members can be present in Object. | 1155 // data members can be present in Object. |
1156 class Object { | 1156 class Object { |
1157 public: | 1157 public: |
1158 // Type testing. | 1158 // Type testing. |
1159 bool IsObject() const { return true; } | 1159 bool IsObject() const { return true; } |
1160 | 1160 |
1161 #define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const); | 1161 #define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const); |
1162 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 1162 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
1163 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 1163 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
1164 #undef IS_TYPE_FUNCTION_DECL | 1164 #undef IS_TYPE_FUNCTION_DECL |
| 1165 |
1165 #define IS_TYPE_FUNCTION_DECL(Type, Value) \ | 1166 #define IS_TYPE_FUNCTION_DECL(Type, Value) \ |
1166 INLINE(bool Is##Type(Isolate* isolate) const); | 1167 INLINE(bool Is##Type(Isolate* isolate) const); |
1167 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) | 1168 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) |
1168 #undef IS_TYPE_FUNCTION_DECL | 1169 #undef IS_TYPE_FUNCTION_DECL |
1169 | 1170 |
| 1171 INLINE(bool IsNullOrUndefined(Isolate* isolate) const); |
| 1172 |
1170 // A non-keyed store is of the form a.x = foo or a["x"] = foo whereas | 1173 // A non-keyed store is of the form a.x = foo or a["x"] = foo whereas |
1171 // a keyed store is of the form a[expression] = foo. | 1174 // a keyed store is of the form a[expression] = foo. |
1172 enum StoreFromKeyed { | 1175 enum StoreFromKeyed { |
1173 MAY_BE_STORE_FROM_KEYED, | 1176 MAY_BE_STORE_FROM_KEYED, |
1174 CERTAINLY_NOT_STORE_FROM_KEYED | 1177 CERTAINLY_NOT_STORE_FROM_KEYED |
1175 }; | 1178 }; |
1176 | 1179 |
1177 enum ShouldThrow { THROW_ON_ERROR, DONT_THROW }; | 1180 enum ShouldThrow { THROW_ON_ERROR, DONT_THROW }; |
1178 | 1181 |
1179 #define RETURN_FAILURE(isolate, should_throw, call) \ | 1182 #define RETURN_FAILURE(isolate, should_throw, call) \ |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 | 1707 |
1705 #define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const); | 1708 #define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const); |
1706 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) | 1709 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
1707 #undef IS_TYPE_FUNCTION_DECL | 1710 #undef IS_TYPE_FUNCTION_DECL |
1708 | 1711 |
1709 #define IS_TYPE_FUNCTION_DECL(Type, Value) \ | 1712 #define IS_TYPE_FUNCTION_DECL(Type, Value) \ |
1710 INLINE(bool Is##Type(Isolate* isolate) const); | 1713 INLINE(bool Is##Type(Isolate* isolate) const); |
1711 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) | 1714 ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) |
1712 #undef IS_TYPE_FUNCTION_DECL | 1715 #undef IS_TYPE_FUNCTION_DECL |
1713 | 1716 |
| 1717 INLINE(bool IsNullOrUndefined(Isolate* isolate) const); |
| 1718 |
1714 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ | 1719 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \ |
1715 INLINE(bool Is##Name() const); | 1720 INLINE(bool Is##Name() const); |
1716 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 1721 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
1717 #undef DECLARE_STRUCT_PREDICATE | 1722 #undef DECLARE_STRUCT_PREDICATE |
1718 | 1723 |
1719 // Converts an address to a HeapObject pointer. | 1724 // Converts an address to a HeapObject pointer. |
1720 static inline HeapObject* FromAddress(Address address) { | 1725 static inline HeapObject* FromAddress(Address address) { |
1721 DCHECK_TAG_ALIGNED(address); | 1726 DCHECK_TAG_ALIGNED(address); |
1722 return reinterpret_cast<HeapObject*>(address + kHeapObjectTag); | 1727 return reinterpret_cast<HeapObject*>(address + kHeapObjectTag); |
1723 } | 1728 } |
(...skipping 10027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11751 } | 11756 } |
11752 }; | 11757 }; |
11753 | 11758 |
11754 | 11759 |
11755 } // NOLINT, false-positive due to second-order macros. | 11760 } // NOLINT, false-positive due to second-order macros. |
11756 } // NOLINT, false-positive due to second-order macros. | 11761 } // NOLINT, false-positive due to second-order macros. |
11757 | 11762 |
11758 #include "src/objects/object-macros-undef.h" | 11763 #include "src/objects/object-macros-undef.h" |
11759 | 11764 |
11760 #endif // V8_OBJECTS_H_ | 11765 #endif // V8_OBJECTS_H_ |
OLD | NEW |