#define DECLARE_VERIFIER(Name)
#endif
+#ifdef OBJECT_PRINT
+#define DECLARE_PRINTER(Name) void Name##Print(FILE* out = stdout);
+#else
+#define DECLARE_PRINTER(Name)
+#endif
+
class MaybeObject BASE_EMBEDDED {
public:
inline bool IsFailure();
// 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() {
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.
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:
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.
// 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.
// 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:
// 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:
// 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:
// 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:
// 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:
// 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:
// 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:
// 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:
// 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:
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();
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
// 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;
// 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);
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.
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.
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.
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.
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
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.
// 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
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.
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;
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;
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;
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;
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;
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
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.
// 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;
// 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;
// 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;
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.
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.
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;