Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Unified Diff: src/objects.h

Issue 2043183003: Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifying checks Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.cc ('k') | src/objects.cc » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index e8f7213ced9e17852598f5943d28ff1da0e4db05..1ba66ef8e82e36ffc29289549acec1a37cd38e3b 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1001,17 +1001,17 @@ template <class C> inline bool Is(Object* obj);
V(WeakHashTable) \
V(OrderedHashTable)
-#define ODDBALL_LIST(V) \
- V(Undefined) \
- V(Null) \
- V(TheHole) \
- V(Exception) \
- V(Uninitialized) \
- V(True) \
- V(False) \
- V(ArgumentsMarker) \
- V(OptimizedOut) \
- V(StaleRegister)
+#define ODDBALL_LIST(V) \
+ V(Undefined, undefined_value) \
+ V(Null, null_value) \
+ V(TheHole, the_hole_value) \
+ V(Exception, exception) \
+ V(Uninitialized, uninitialized_value) \
+ V(True, true_value) \
+ V(False, false_value) \
+ V(ArgumentsMarker, arguments_marker) \
+ V(OptimizedOut, optimized_out) \
+ V(StaleRegister, stale_register)
// The element types selection for CreateListFromArrayLike.
enum class ElementTypes { kAll, kStringAndSymbol };
@@ -1027,9 +1027,13 @@ class Object {
// Type testing.
bool IsObject() const { return true; }
-#define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const);
+// TODO(cbruni): clean up once isolate-based versions are in place.
Michael Starzinger 2016/06/08 15:58:20 nit: This TODO should actually be addressed by thi
Camillo Bruni 2016/06/10 09:28:57 nah, let's just keep the todos alive a bit longer
+#define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const);
OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
+#undef IS_TYPE_FUNCTION_DECL
+#define IS_TYPE_FUNCTION_DECL(Type, Value) \
+ INLINE(bool Is##Type(Isolate* isolate) const);
ODDBALL_LIST(IS_TYPE_FUNCTION_DECL)
#undef IS_TYPE_FUNCTION_DECL
@@ -1064,9 +1068,6 @@ class Object {
STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
#undef DECLARE_STRUCT_PREDICATE
- INLINE(bool IsTheHole(Isolate* isolate) const);
- INLINE(bool IsUndefined(Isolate* isolate) const);
-
// ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray.
MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object);
@@ -1550,18 +1551,20 @@ class HeapObject: public Object {
inline Isolate* GetIsolate() const;
// TODO(cbruni): clean up once isolate-based versions are in place.
Michael Starzinger 2016/06/08 15:58:20 nit: This TODO should actually be addressed by thi
-#define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const);
+#define IS_TYPE_FUNCTION_DECL(Type) INLINE(bool Is##Type() const);
HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
+#undef IS_TYPE_FUNCTION_DECL
+
+#define IS_TYPE_FUNCTION_DECL(Type, Value) \
+ INLINE(bool Is##Type(Isolate* isolate) const);
ODDBALL_LIST(IS_TYPE_FUNCTION_DECL)
#undef IS_TYPE_FUNCTION_DECL
+
#define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \
INLINE(bool Is##Name() const);
STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
#undef DECLARE_STRUCT_PREDICATE
- INLINE(bool IsTheHole(Isolate* isolate) const);
- INLINE(bool IsUndefined(Isolate* isolate) const);
-
// Converts an address to a HeapObject pointer.
static inline HeapObject* FromAddress(Address address) {
DCHECK_TAG_ALIGNED(address);
« no previous file with comments | « src/messages.cc ('k') | src/objects.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698