Index: src/objects-debug.cc |
diff --git a/src/objects-debug.cc b/src/objects-debug.cc |
index 5883f8b343caf967a3529b689ee843d5b1ce0054..c0e5610abaf33f1332bd33e2543c1bda75aa3bfa 100644 |
--- a/src/objects-debug.cc |
+++ b/src/objects-debug.cc |
@@ -40,31 +40,37 @@ namespace internal { |
static const char* TypeToString(InstanceType type); |
-void Object::Print() { |
- if (IsSmi()) { |
- Smi::cast(this)->SmiPrint(); |
- } else if (IsFailure()) { |
- Failure::cast(this)->FailurePrint(); |
+void MaybeObject::Print() { |
+ Object* this_as_object; |
+ if (ToObject(&this_as_object)) { |
+ if (this_as_object->IsSmi()) { |
+ Smi::cast(this_as_object)->SmiPrint(); |
+ } else { |
+ HeapObject::cast(this_as_object)->HeapObjectPrint(); |
+ } |
} else { |
- HeapObject::cast(this)->HeapObjectPrint(); |
+ Failure::cast(this)->FailurePrint(); |
} |
Flush(); |
} |
-void Object::PrintLn() { |
+void MaybeObject::PrintLn() { |
Print(); |
PrintF("\n"); |
} |
-void Object::Verify() { |
- if (IsSmi()) { |
- Smi::cast(this)->SmiVerify(); |
- } else if (IsFailure()) { |
- Failure::cast(this)->FailureVerify(); |
+void MaybeObject::Verify() { |
+ Object* this_as_object; |
+ if (ToObject(&this_as_object)) { |
+ if (this_as_object->IsSmi()) { |
+ Smi::cast(this_as_object)->SmiVerify(); |
+ } else { |
+ HeapObject::cast(this_as_object)->HeapObjectVerify(); |
+ } |
} else { |
- HeapObject::cast(this)->HeapObjectVerify(); |
+ Failure::cast(this)->FailureVerify(); |
} |
} |