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

Unified Diff: src/objects-debug.cc

Issue 4100005: Version 2.5.2 (Closed)
Patch Set: Created 10 years, 2 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/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698