 Chromium Code Reviews
 Chromium Code Reviews Issue 11567007:
  Cleanup object printer declaration.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 11567007:
  Cleanup object printer declaration.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/objects.h | 
| diff --git a/src/objects.h b/src/objects.h | 
| index 6a1542280d020fa59b6abfca431361c5f573b3cf..952077de817b88547a81f8001159bf810eee2cf9 100644 | 
| --- a/src/objects.h | 
| +++ b/src/objects.h | 
| @@ -756,6 +756,14 @@ template <class C> static inline bool Is(Object* obj); | 
| #define DECLARE_VERIFIER(Name) | 
| #endif | 
| +#ifdef OBJECT_PRINT | 
| +#define DECLARE_PRINTER(Name) \ | 
| + inline void Name##Print() { Name##Print(stdout); } \ | 
| 
Sven Panne
2012/12/13 10:05:11
Drop this...
 | 
| + void Name##Print(FILE* out); | 
| 
Sven Panne
2012/12/13 10:05:11
... and use "FILE* out = stdout" here, it's cleane
 | 
| +#else | 
| +#define DECLARE_PRINTER(Name) | 
| +#endif | 
| + | 
| class MaybeObject BASE_EMBEDDED { | 
| public: | 
| inline bool IsFailure(); | 
| @@ -2109,12 +2117,7 @@ class JSObject: public JSReceiver { | 
| // Dispatched behavior. | 
| void JSObjectShortPrint(StringStream* accumulator); | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSObjectPrint() { | 
| - JSObjectPrint(stdout); | 
| - } | 
| - void JSObjectPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSObject) | 
| DECLARE_VERIFIER(JSObject) | 
| #ifdef OBJECT_PRINT | 
| inline void PrintProperties() { | 
| @@ -2408,12 +2411,7 @@ class FixedArray: public FixedArrayBase { | 
| static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void FixedArrayPrint() { | 
| - FixedArrayPrint(stdout); | 
| - } | 
| - void FixedArrayPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(FixedArray) | 
| DECLARE_VERIFIER(FixedArray) | 
| #ifdef DEBUG | 
| // Checks if two FixedArrays have identical contents. | 
| @@ -2500,12 +2498,7 @@ class FixedDoubleArray: public FixedArrayBase { | 
| static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize; | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void FixedDoubleArrayPrint() { | 
| - FixedDoubleArrayPrint(stdout); | 
| - } | 
| - void FixedDoubleArrayPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(FixedDoubleArray) | 
| DECLARE_VERIFIER(FixedDoubleArray) | 
| private: | 
| @@ -3705,12 +3698,7 @@ class ByteArray: public FixedArrayBase { | 
| inline int ByteArraySize() { | 
| return SizeFor(this->length()); | 
| } | 
| -#ifdef OBJECT_PRINT | 
| - inline void ByteArrayPrint() { | 
| - ByteArrayPrint(stdout); | 
| - } | 
| - void ByteArrayPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(ByteArray) | 
| DECLARE_VERIFIER(ByteArray) | 
| // Layout description. | 
| @@ -3739,12 +3727,8 @@ class FreeSpace: public HeapObject { | 
| // Casting. | 
| static inline FreeSpace* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void FreeSpacePrint() { | 
| - FreeSpacePrint(stdout); | 
| - } | 
| - void FreeSpacePrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(FreeSpace) | 
| DECLARE_VERIFIER(FreeSpace) | 
| // Layout description. | 
| @@ -3819,12 +3803,8 @@ class ExternalPixelArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalPixelArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalPixelArrayPrint() { | 
| - ExternalPixelArrayPrint(stdout); | 
| - } | 
| - void ExternalPixelArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalPixelArray) | 
| DECLARE_VERIFIER(ExternalPixelArray) | 
| private: | 
| @@ -3846,12 +3826,8 @@ class ExternalByteArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalByteArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalByteArrayPrint() { | 
| - ExternalByteArrayPrint(stdout); | 
| - } | 
| - void ExternalByteArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalByteArray) | 
| DECLARE_VERIFIER(ExternalByteArray) | 
| private: | 
| @@ -3873,12 +3849,8 @@ class ExternalUnsignedByteArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalUnsignedByteArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalUnsignedByteArrayPrint() { | 
| - ExternalUnsignedByteArrayPrint(stdout); | 
| - } | 
| - void ExternalUnsignedByteArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalUnsignedByteArray) | 
| DECLARE_VERIFIER(ExternalUnsignedByteArray) | 
| private: | 
| @@ -3900,12 +3872,8 @@ class ExternalShortArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalShortArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalShortArrayPrint() { | 
| - ExternalShortArrayPrint(stdout); | 
| - } | 
| - void ExternalShortArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalShortArray) | 
| DECLARE_VERIFIER(ExternalShortArray) | 
| private: | 
| @@ -3927,12 +3895,8 @@ class ExternalUnsignedShortArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalUnsignedShortArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalUnsignedShortArrayPrint() { | 
| - ExternalUnsignedShortArrayPrint(stdout); | 
| - } | 
| - void ExternalUnsignedShortArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalUnsignedShortArray) | 
| DECLARE_VERIFIER(ExternalUnsignedShortArray) | 
| private: | 
| @@ -3954,12 +3918,8 @@ class ExternalIntArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalIntArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalIntArrayPrint() { | 
| - ExternalIntArrayPrint(stdout); | 
| - } | 
| - void ExternalIntArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalIntArray) | 
| DECLARE_VERIFIER(ExternalIntArray) | 
| private: | 
| @@ -3981,12 +3941,8 @@ class ExternalUnsignedIntArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalUnsignedIntArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalUnsignedIntArrayPrint() { | 
| - ExternalUnsignedIntArrayPrint(stdout); | 
| - } | 
| - void ExternalUnsignedIntArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalUnsignedIntArray) | 
| DECLARE_VERIFIER(ExternalUnsignedIntArray) | 
| private: | 
| @@ -4008,12 +3964,8 @@ class ExternalFloatArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalFloatArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalFloatArrayPrint() { | 
| - ExternalFloatArrayPrint(stdout); | 
| - } | 
| - void ExternalFloatArrayPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalFloatArray) | 
| DECLARE_VERIFIER(ExternalFloatArray) | 
| private: | 
| @@ -4035,12 +3987,8 @@ class ExternalDoubleArray: public ExternalArray { | 
| // Casting. | 
| static inline ExternalDoubleArray* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ExternalDoubleArrayPrint() { | 
| - ExternalDoubleArrayPrint(stdout); | 
| - } | 
| - void ExternalDoubleArrayPrint(FILE* out); | 
| -#endif // OBJECT_PRINT | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ExternalDoubleArray) | 
| DECLARE_VERIFIER(ExternalDoubleArray) | 
| private: | 
| @@ -4552,12 +4500,8 @@ class Code: public HeapObject { | 
| template<typename StaticVisitor> | 
| inline void CodeIterateBody(Heap* heap); | 
| -#ifdef OBJECT_PRINT | 
| - inline void CodePrint() { | 
| - CodePrint(stdout); | 
| - } | 
| - void CodePrint(FILE* out); | 
| -#endif | 
| + | 
| + DECLARE_PRINTER(Code) | 
| DECLARE_VERIFIER(Code) | 
| void ClearInlineCaches(); | 
| @@ -5133,12 +5077,7 @@ class Map: public HeapObject { | 
| void ZapTransitions(); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void MapPrint() { | 
| - MapPrint(stdout); | 
| - } | 
| - void MapPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(Map) | 
| DECLARE_VERIFIER(Map) | 
| #ifdef VERIFY_HEAP | 
| @@ -5339,12 +5278,8 @@ class Script: public Struct { | 
| // resource is accessible. Otherwise, always return true. | 
| inline bool HasValidSource(); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ScriptPrint() { | 
| - ScriptPrint(stdout); | 
| - } | 
| - void ScriptPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(Script) | 
| DECLARE_VERIFIER(Script) | 
| static const int kSourceOffset = HeapObject::kHeaderSize; | 
| @@ -5819,12 +5754,7 @@ class SharedFunctionInfo: public HeapObject { | 
| // Dispatched behavior. | 
| // Set max_length to -1 for unlimited length. | 
| void SourceCodePrint(StringStream* accumulator, int max_length); | 
| -#ifdef OBJECT_PRINT | 
| - inline void SharedFunctionInfoPrint() { | 
| - SharedFunctionInfoPrint(stdout); | 
| - } | 
| - void SharedFunctionInfoPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(SharedFunctionInfo) | 
| DECLARE_VERIFIER(SharedFunctionInfo) | 
| void ResetForNewContext(int new_ic_age); | 
| @@ -6053,12 +5983,7 @@ class JSModule: public JSObject { | 
| static inline JSModule* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSModulePrint() { | 
| - JSModulePrint(stdout); | 
| - } | 
| - void JSModulePrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSModule) | 
| DECLARE_VERIFIER(JSModule) | 
| // Layout description. | 
| @@ -6212,12 +6137,7 @@ class JSFunction: public JSObject { | 
| void JSFunctionIterateBody(int object_size, ObjectVisitor* v); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSFunctionPrint() { | 
| - JSFunctionPrint(stdout); | 
| - } | 
| - void JSFunctionPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSFunction) | 
| DECLARE_VERIFIER(JSFunction) | 
| // Returns the number of allocated literals. | 
| @@ -6271,12 +6191,7 @@ class JSGlobalProxy : public JSObject { | 
| static inline JSGlobalProxy* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSGlobalProxyPrint() { | 
| - JSGlobalProxyPrint(stdout); | 
| - } | 
| - void JSGlobalProxyPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSGlobalProxy) | 
| DECLARE_VERIFIER(JSGlobalProxy) | 
| // Layout description. | 
| @@ -6349,12 +6264,7 @@ class JSGlobalObject: public GlobalObject { | 
| static inline JSGlobalObject* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSGlobalObjectPrint() { | 
| - JSGlobalObjectPrint(stdout); | 
| - } | 
| - void JSGlobalObjectPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSGlobalObject) | 
| DECLARE_VERIFIER(JSGlobalObject) | 
| // Layout description. | 
| @@ -6381,12 +6291,7 @@ class JSBuiltinsObject: public GlobalObject { | 
| static inline JSBuiltinsObject* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSBuiltinsObjectPrint() { | 
| - JSBuiltinsObjectPrint(stdout); | 
| - } | 
| - void JSBuiltinsObjectPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSBuiltinsObject) | 
| DECLARE_VERIFIER(JSBuiltinsObject) | 
| // Layout description. The size of the builtins object includes | 
| @@ -6422,12 +6327,7 @@ class JSValue: public JSObject { | 
| static inline JSValue* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSValuePrint() { | 
| - JSValuePrint(stdout); | 
| - } | 
| - void JSValuePrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSValue) | 
| DECLARE_VERIFIER(JSValue) | 
| // Layout description. | 
| @@ -6476,12 +6376,7 @@ class JSDate: public JSObject { | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSDatePrint() { | 
| - JSDatePrint(stdout); | 
| - } | 
| - void JSDatePrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSDate) | 
| DECLARE_VERIFIER(JSDate) | 
| // The order is important. It must be kept in sync with date macros | 
| @@ -6573,12 +6468,7 @@ class JSMessageObject: public JSObject { | 
| static inline JSMessageObject* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSMessageObjectPrint() { | 
| - JSMessageObjectPrint(stdout); | 
| - } | 
| - void JSMessageObjectPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSMessageObject) | 
| DECLARE_VERIFIER(JSMessageObject) | 
| // Layout description. | 
| @@ -6819,12 +6709,8 @@ class CodeCache: public Struct { | 
| static inline CodeCache* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void CodeCachePrint() { | 
| - CodeCachePrint(stdout); | 
| - } | 
| - void CodeCachePrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(CodeCache) | 
| DECLARE_VERIFIER(CodeCache) | 
| static const int kDefaultCacheOffset = HeapObject::kHeaderSize; | 
| @@ -6908,12 +6794,8 @@ class PolymorphicCodeCache: public Struct { | 
| static inline PolymorphicCodeCache* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void PolymorphicCodeCachePrint() { | 
| - PolymorphicCodeCachePrint(stdout); | 
| - } | 
| - void PolymorphicCodeCachePrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(PolymorphicCodeCache) | 
| DECLARE_VERIFIER(PolymorphicCodeCache) | 
| static const int kCacheOffset = HeapObject::kHeaderSize; | 
| @@ -6961,12 +6843,8 @@ class TypeFeedbackInfo: public Struct { | 
| static inline TypeFeedbackInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void TypeFeedbackInfoPrint() { | 
| - TypeFeedbackInfoPrint(stdout); | 
| - } | 
| - void TypeFeedbackInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(TypeFeedbackInfo) | 
| DECLARE_VERIFIER(TypeFeedbackInfo) | 
| static const int kStorage1Offset = HeapObject::kHeaderSize; | 
| @@ -7007,12 +6885,8 @@ class AliasedArgumentsEntry: public Struct { | 
| static inline AliasedArgumentsEntry* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void AliasedArgumentsEntryPrint() { | 
| - AliasedArgumentsEntryPrint(stdout); | 
| - } | 
| - void AliasedArgumentsEntryPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(AliasedArgumentsEntry) | 
| DECLARE_VERIFIER(AliasedArgumentsEntry) | 
| static const int kAliasedContextSlot = HeapObject::kHeaderSize; | 
| @@ -8121,15 +7995,10 @@ class JSGlobalPropertyCell: public HeapObject { | 
| return address() + kValueOffset; | 
| } | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(JSGlobalPropertyCell) | 
| DECLARE_VERIFIER(JSGlobalPropertyCell) | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSGlobalPropertyCellPrint() { | 
| - JSGlobalPropertyCellPrint(stdout); | 
| - } | 
| - void JSGlobalPropertyCellPrint(FILE* out); | 
| -#endif | 
| - | 
| // Layout description. | 
| static const int kValueOffset = HeapObject::kHeaderSize; | 
| static const int kSize = kValueOffset + kPointerSize; | 
| @@ -8219,12 +8088,7 @@ class JSProxy: public JSReceiver { | 
| Handle<Object> args[]); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSProxyPrint() { | 
| - JSProxyPrint(stdout); | 
| - } | 
| - void JSProxyPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSProxy) | 
| DECLARE_VERIFIER(JSProxy) | 
| // Layout description. We add padding so that a proxy has the same | 
| @@ -8260,12 +8124,7 @@ class JSFunctionProxy: public JSProxy { | 
| static inline JSFunctionProxy* cast(Object* obj); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSFunctionProxyPrint() { | 
| - JSFunctionProxyPrint(stdout); | 
| - } | 
| - void JSFunctionProxyPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSFunctionProxy) | 
| DECLARE_VERIFIER(JSFunctionProxy) | 
| // Layout description. | 
| @@ -8295,12 +8154,8 @@ class JSSet: public JSObject { | 
| // Casting. | 
| static inline JSSet* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSSetPrint() { | 
| - JSSetPrint(stdout); | 
| - } | 
| - void JSSetPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(JSSet) | 
| DECLARE_VERIFIER(JSSet) | 
| static const int kTableOffset = JSObject::kHeaderSize; | 
| @@ -8320,12 +8175,8 @@ class JSMap: public JSObject { | 
| // Casting. | 
| static inline JSMap* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSMapPrint() { | 
| - JSMapPrint(stdout); | 
| - } | 
| - void JSMapPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(JSMap) | 
| DECLARE_VERIFIER(JSMap) | 
| static const int kTableOffset = JSObject::kHeaderSize; | 
| @@ -8348,12 +8199,8 @@ class JSWeakMap: public JSObject { | 
| // Casting. | 
| static inline JSWeakMap* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSWeakMapPrint() { | 
| - JSWeakMapPrint(stdout); | 
| - } | 
| - void JSWeakMapPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(JSWeakMap) | 
| DECLARE_VERIFIER(JSWeakMap) | 
| static const int kTableOffset = JSObject::kHeaderSize; | 
| @@ -8383,12 +8230,8 @@ class Foreign: public HeapObject { | 
| template<typename StaticVisitor> | 
| inline void ForeignIterateBody(); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ForeignPrint() { | 
| - ForeignPrint(stdout); | 
| - } | 
| - void ForeignPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(Foreign) | 
| DECLARE_VERIFIER(Foreign) | 
| // Layout description. | 
| @@ -8441,12 +8284,7 @@ class JSArray: public JSObject { | 
| inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 
| // Dispatched behavior. | 
| -#ifdef OBJECT_PRINT | 
| - inline void JSArrayPrint() { | 
| - JSArrayPrint(stdout); | 
| - } | 
| - void JSArrayPrint(FILE* out); | 
| -#endif | 
| + DECLARE_PRINTER(JSArray) | 
| DECLARE_VERIFIER(JSArray) | 
| // Number of element slots to pre-allocate for an empty array. | 
| @@ -8520,12 +8358,8 @@ class AccessorInfo: public Struct { | 
| static inline AccessorInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void AccessorInfoPrint() { | 
| - AccessorInfoPrint(stdout); | 
| - } | 
| - void AccessorInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(AccessorInfo) | 
| DECLARE_VERIFIER(AccessorInfo) | 
| static const int kGetterOffset = HeapObject::kHeaderSize; | 
| @@ -8587,9 +8421,8 @@ class AccessorPair: public Struct { | 
| return IsJSAccessor(getter()) || IsJSAccessor(setter()); | 
| } | 
| -#ifdef OBJECT_PRINT | 
| - void AccessorPairPrint(FILE* out = stdout); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(AccessorPair) | 
| DECLARE_VERIFIER(AccessorPair) | 
| static const int kGetterOffset = HeapObject::kHeaderSize; | 
| @@ -8618,12 +8451,8 @@ class AccessCheckInfo: public Struct { | 
| static inline AccessCheckInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void AccessCheckInfoPrint() { | 
| - AccessCheckInfoPrint(stdout); | 
| - } | 
| - void AccessCheckInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(AccessCheckInfo) | 
| DECLARE_VERIFIER(AccessCheckInfo) | 
| static const int kNamedCallbackOffset = HeapObject::kHeaderSize; | 
| @@ -8647,12 +8476,8 @@ class InterceptorInfo: public Struct { | 
| static inline InterceptorInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void InterceptorInfoPrint() { | 
| - InterceptorInfoPrint(stdout); | 
| - } | 
| - void InterceptorInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(InterceptorInfo) | 
| DECLARE_VERIFIER(InterceptorInfo) | 
| static const int kGetterOffset = HeapObject::kHeaderSize; | 
| @@ -8675,12 +8500,8 @@ class CallHandlerInfo: public Struct { | 
| static inline CallHandlerInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void CallHandlerInfoPrint() { | 
| - CallHandlerInfoPrint(stdout); | 
| - } | 
| - void CallHandlerInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(CallHandlerInfo) | 
| DECLARE_VERIFIER(CallHandlerInfo) | 
| static const int kCallbackOffset = HeapObject::kHeaderSize; | 
| @@ -8734,12 +8555,8 @@ class FunctionTemplateInfo: public TemplateInfo { | 
| static inline FunctionTemplateInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void FunctionTemplateInfoPrint() { | 
| - FunctionTemplateInfoPrint(stdout); | 
| - } | 
| - void FunctionTemplateInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(FunctionTemplateInfo) | 
| DECLARE_VERIFIER(FunctionTemplateInfo) | 
| static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; | 
| @@ -8781,12 +8598,8 @@ class ObjectTemplateInfo: public TemplateInfo { | 
| static inline ObjectTemplateInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void ObjectTemplateInfoPrint() { | 
| - ObjectTemplateInfoPrint(stdout); | 
| - } | 
| - void ObjectTemplateInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(ObjectTemplateInfo) | 
| DECLARE_VERIFIER(ObjectTemplateInfo) | 
| static const int kConstructorOffset = TemplateInfo::kHeaderSize; | 
| @@ -8803,12 +8616,8 @@ class SignatureInfo: public Struct { | 
| static inline SignatureInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void SignatureInfoPrint() { | 
| - SignatureInfoPrint(stdout); | 
| - } | 
| - void SignatureInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(SignatureInfo) | 
| DECLARE_VERIFIER(SignatureInfo) | 
| static const int kReceiverOffset = Struct::kHeaderSize; | 
| @@ -8826,12 +8635,8 @@ class TypeSwitchInfo: public Struct { | 
| static inline TypeSwitchInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void TypeSwitchInfoPrint() { | 
| - TypeSwitchInfoPrint(stdout); | 
| - } | 
| - void TypeSwitchInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(TypeSwitchInfo) | 
| DECLARE_VERIFIER(TypeSwitchInfo) | 
| static const int kTypesOffset = Struct::kHeaderSize; | 
| @@ -8876,12 +8681,8 @@ class DebugInfo: public Struct { | 
| static inline DebugInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void DebugInfoPrint() { | 
| - DebugInfoPrint(stdout); | 
| - } | 
| - void DebugInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(DebugInfo) | 
| DECLARE_VERIFIER(DebugInfo) | 
| static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 
| @@ -8932,12 +8733,8 @@ class BreakPointInfo: public Struct { | 
| static inline BreakPointInfo* cast(Object* obj); | 
| -#ifdef OBJECT_PRINT | 
| - inline void BreakPointInfoPrint() { | 
| - BreakPointInfoPrint(stdout); | 
| - } | 
| - void BreakPointInfoPrint(FILE* out); | 
| -#endif | 
| + // Dispatched behavior. | 
| + DECLARE_PRINTER(BreakPointInfo) | 
| DECLARE_VERIFIER(BreakPointInfo) | 
| static const int kCodePositionIndex = Struct::kHeaderSize; |