Index: src/objects-debug.cc |
=================================================================== |
--- src/objects-debug.cc (revision 5696) |
+++ src/objects-debug.cc (working copy) |
@@ -40,31 +40,37 @@ |
static const char* TypeToString(InstanceType type); |
-void Object::Print() { |
- if (IsSmi()) { |
- Smi::cast(this)->SmiPrint(); |
- } else if (IsFailure()) { |
+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 { |
Failure::cast(this)->FailurePrint(); |
- } else { |
- HeapObject::cast(this)->HeapObjectPrint(); |
} |
Flush(); |
} |
-void Object::PrintLn() { |
+void MaybeObject::PrintLn() { |
Print(); |
PrintF("\n"); |
} |
-void Object::Verify() { |
- if (IsSmi()) { |
- Smi::cast(this)->SmiVerify(); |
- } else if (IsFailure()) { |
+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 { |
Failure::cast(this)->FailureVerify(); |
- } else { |
- HeapObject::cast(this)->HeapObjectVerify(); |
} |
} |