Chromium Code Reviews| Index: vm/object.h |
| =================================================================== |
| --- vm/object.h (revision 10133) |
| +++ vm/object.h (working copy) |
| @@ -62,7 +62,8 @@ |
| reinterpret_cast<object*>(VMHandles::AllocateHandle(isolate)); \ |
| initializeHandle(obj, raw_ptr); \ |
| if (!obj->Is##object()) { \ |
| - FATAL("Handle check failed."); \ |
| + FATAL2("Handle check failed: saw %s expected %s", \ |
| + obj->GetClassName(), #object); \ |
|
Ivan Posva
2012/08/03 20:13:10
What would happen if you used ToCString() here, in
|
| } \ |
| return *obj; \ |
| } \ |
| @@ -86,7 +87,8 @@ |
| VMHandles::AllocateZoneHandle(isolate)); \ |
| initializeHandle(obj, raw_ptr); \ |
| if (!obj->Is##object()) { \ |
| - FATAL("Handle check failed."); \ |
| + FATAL2("Handle check failed: saw %s expected %s", \ |
| + obj->GetClassName(), #object); \ |
| } \ |
| return *obj; \ |
| } \ |
| @@ -104,6 +106,7 @@ |
| return reinterpret_cast<Raw##object*>(Object::null()); \ |
| } \ |
| virtual const char* ToCString() const; \ |
| + virtual const char* GetClassName() const { return #object; } \ |
| static const ObjectKind kInstanceKind = k##object; \ |
| protected: /* NOLINT */ \ |
| object() : super() {} \ |
| @@ -225,6 +228,9 @@ |
| return "Object"; |
| } |
| } |
| + virtual const char* GetClassName() const { |
| + return "Object"; |
| + } |
| bool IsNew() const { return raw()->IsNewObject(); } |
| bool IsOld() const { return raw()->IsOldObject(); } |