Index: src/objects.h |
=================================================================== |
--- src/objects.h (revision 6074) |
+++ src/objects.h (working copy) |
@@ -607,10 +607,18 @@ |
return reinterpret_cast<Object*>(this); |
} |
+#ifdef OBJECT_PRINT |
+ // Prints this object with details. |
+ inline void Print() { |
+ Print(stdout); |
+ }; |
+ inline void PrintLn() { |
+ PrintLn(stdout); |
+ } |
+ void Print(FILE* out); |
+ void PrintLn(FILE* out); |
+#endif |
#ifdef DEBUG |
- // Prints this object with details. |
- void Print(); |
- void PrintLn(); |
// Verifies the object. |
void Verify(); |
#endif |
@@ -762,7 +770,10 @@ |
#endif |
// Prints this object without details. |
- void ShortPrint(); |
+ inline void ShortPrint() { |
+ ShortPrint(stdout); |
+ } |
+ void ShortPrint(FILE* out); |
// Prints this object without details to a message accumulator. |
void ShortPrint(StringStream* accumulator); |
@@ -801,7 +812,10 @@ |
static inline Smi* cast(Object* object); |
// Dispatched behavior. |
- void SmiPrint(); |
+ inline void SmiPrint() { |
+ SmiPrint(stdout); |
+ } |
+ void SmiPrint(FILE* out); |
void SmiPrint(StringStream* accumulator); |
#ifdef DEBUG |
void SmiVerify(); |
@@ -870,7 +884,7 @@ |
static inline Failure* cast(MaybeObject* object); |
// Dispatched behavior. |
- void FailurePrint(); |
+ void FailurePrint(FILE* out); |
void FailurePrint(StringStream* accumulator); |
#ifdef DEBUG |
void FailureVerify(); |
@@ -1099,14 +1113,23 @@ |
// Dispatched behavior. |
void HeapObjectShortPrint(StringStream* accumulator); |
+#ifdef OBJECT_PRINT |
+ inline void HeapObjectPrint() { |
+ HeapObjectPrint(stdout); |
+ } |
+ void HeapObjectPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void HeapObjectPrint(); |
void HeapObjectVerify(); |
inline void VerifyObjectField(int offset); |
inline void VerifySmiField(int offset); |
+#endif |
- void PrintHeader(const char* id); |
+#ifdef OBJECT_PRINT |
+ void PrintHeader(FILE* out, const char* id); |
+#endif |
+#ifdef DEBUG |
// Verify a pointer is a valid HeapObject pointer that points to object |
// areas in the heap. |
static void VerifyHeapPointer(Object* p); |
@@ -1189,7 +1212,10 @@ |
// Dispatched behavior. |
Object* HeapNumberToBoolean(); |
- void HeapNumberPrint(); |
+ inline void HeapNumberPrint() { |
+ HeapNumberPrint(stdout); |
+ } |
+ void HeapNumberPrint(FILE* out); |
void HeapNumberPrint(StringStream* accumulator); |
#ifdef DEBUG |
void HeapNumberVerify(); |
@@ -1649,12 +1675,28 @@ |
// Dispatched behavior. |
void JSObjectShortPrint(StringStream* accumulator); |
+#ifdef OBJECT_PRINT |
+ inline void JSObjectPrint() { |
+ JSObjectPrint(stdout); |
+ } |
+ void JSObjectPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSObjectPrint(); |
void JSObjectVerify(); |
- void PrintProperties(); |
- void PrintElements(); |
+#endif |
+#ifdef OBJECT_PRINT |
+ inline void PrintProperties() { |
+ PrintProperties(stdout); |
+ } |
+ void PrintProperties(FILE* out); |
+ inline void PrintElements() { |
+ PrintElements(stdout); |
+ } |
+ void PrintElements(FILE* out); |
+#endif |
+ |
+#ifdef DEBUG |
// Structure for collecting spill information about JSObjects. |
class SpillInformation { |
public: |
@@ -1835,8 +1877,13 @@ |
static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void FixedArrayPrint() { |
+ FixedArrayPrint(stdout); |
+ } |
+ void FixedArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void FixedArrayPrint(); |
void FixedArrayVerify(); |
// Checks if two FixedArrays have identical contents. |
bool IsEqualTo(FixedArray* other); |
@@ -2012,10 +2059,15 @@ |
static const int kEnumCacheBridgeCacheOffset = |
kEnumCacheBridgeEnumOffset + kPointerSize; |
-#ifdef DEBUG |
+#ifdef OBJECT_PRINT |
// Print all the descriptors. |
- void PrintDescriptors(); |
+ inline void PrintDescriptors() { |
+ PrintDescriptors(stdout); |
+ } |
+ void PrintDescriptors(FILE* out); |
+#endif |
+#ifdef DEBUG |
// Is the descriptor array sorted and without duplicates? |
bool IsSortedNoDuplicates(); |
@@ -2396,8 +2448,11 @@ |
// Ensure enough space for n additional elements. |
MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key); |
-#ifdef DEBUG |
- void Print(); |
+#ifdef OBJECT_PRINT |
+ inline void Print() { |
+ Print(stdout); |
+ } |
+ void Print(FILE* out); |
#endif |
// Returns the key (slow). |
Object* SlowReverseLookup(Object* value); |
@@ -2619,8 +2674,13 @@ |
inline int ByteArraySize() { |
return SizeFor(this->length()); |
} |
+#ifdef OBJECT_PRINT |
+ inline void ByteArrayPrint() { |
+ ByteArrayPrint(stdout); |
+ } |
+ void ByteArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ByteArrayPrint(); |
void ByteArrayVerify(); |
#endif |
@@ -2669,8 +2729,13 @@ |
// Casting. |
static inline PixelArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void PixelArrayPrint() { |
+ PixelArrayPrint(stdout); |
+ } |
+ void PixelArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void PixelArrayPrint(); |
void PixelArrayVerify(); |
#endif // DEBUG |
@@ -2741,8 +2806,13 @@ |
// Casting. |
static inline ExternalByteArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalByteArrayPrint() { |
+ ExternalByteArrayPrint(stdout); |
+ } |
+ void ExternalByteArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalByteArrayPrint(); |
void ExternalByteArrayVerify(); |
#endif // DEBUG |
@@ -2764,8 +2834,13 @@ |
// Casting. |
static inline ExternalUnsignedByteArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalUnsignedByteArrayPrint() { |
+ ExternalUnsignedByteArrayPrint(stdout); |
+ } |
+ void ExternalUnsignedByteArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalUnsignedByteArrayPrint(); |
void ExternalUnsignedByteArrayVerify(); |
#endif // DEBUG |
@@ -2787,8 +2862,13 @@ |
// Casting. |
static inline ExternalShortArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalShortArrayPrint() { |
+ ExternalShortArrayPrint(stdout); |
+ } |
+ void ExternalShortArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalShortArrayPrint(); |
void ExternalShortArrayVerify(); |
#endif // DEBUG |
@@ -2810,8 +2890,13 @@ |
// Casting. |
static inline ExternalUnsignedShortArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalUnsignedShortArrayPrint() { |
+ ExternalUnsignedShortArrayPrint(stdout); |
+ } |
+ void ExternalUnsignedShortArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalUnsignedShortArrayPrint(); |
void ExternalUnsignedShortArrayVerify(); |
#endif // DEBUG |
@@ -2833,8 +2918,13 @@ |
// Casting. |
static inline ExternalIntArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalIntArrayPrint() { |
+ ExternalIntArrayPrint(stdout); |
+ } |
+ void ExternalIntArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalIntArrayPrint(); |
void ExternalIntArrayVerify(); |
#endif // DEBUG |
@@ -2856,8 +2946,13 @@ |
// Casting. |
static inline ExternalUnsignedIntArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalUnsignedIntArrayPrint() { |
+ ExternalUnsignedIntArrayPrint(stdout); |
+ } |
+ void ExternalUnsignedIntArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalUnsignedIntArrayPrint(); |
void ExternalUnsignedIntArrayVerify(); |
#endif // DEBUG |
@@ -2879,8 +2974,13 @@ |
// Casting. |
static inline ExternalFloatArray* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ExternalFloatArrayPrint() { |
+ ExternalFloatArrayPrint(stdout); |
+ } |
+ void ExternalFloatArrayPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ExternalFloatArrayPrint(); |
void ExternalFloatArrayVerify(); |
#endif // DEBUG |
@@ -2960,8 +3060,8 @@ |
// Casting. |
static inline DeoptimizationInputData* cast(Object* obj); |
-#ifdef DEBUG |
- void DeoptimizationInputDataPrint(); |
+#ifdef OBJECT_PRINT |
+ void DeoptimizationInputDataPrint(FILE* out); |
#endif |
private: |
@@ -2999,8 +3099,8 @@ |
// Casting. |
static inline DeoptimizationOutputData* cast(Object* obj); |
-#ifdef DEBUG |
- void DeoptimizationOutputDataPrint(); |
+#ifdef OBJECT_PRINT |
+ void DeoptimizationOutputDataPrint(FILE* out); |
#endif |
}; |
@@ -3049,7 +3149,10 @@ |
static const char* Kind2String(Kind kind); |
static const char* ICState2String(InlineCacheState state); |
static const char* PropertyType2String(PropertyType type); |
- void Disassemble(const char* name); |
+ inline void Disassemble(const char* name) { |
+ Disassemble(name, stdout); |
+ } |
+ void Disassemble(const char* name, FILE* out); |
#endif // ENABLE_DISASSEMBLER |
// [instruction_size]: Size of the native instructions |
@@ -3242,8 +3345,13 @@ |
template<typename StaticVisitor> |
inline void CodeIterateBody(); |
+#ifdef OBJECT_PRINT |
+ inline void CodePrint() { |
+ CodePrint(stdout); |
+ } |
+ void CodePrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void CodePrint(); |
void CodeVerify(); |
#endif |
@@ -3531,8 +3639,13 @@ |
void ClearNonLiveTransitions(Object* real_prototype); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void MapPrint() { |
+ MapPrint(stdout); |
+ } |
+ void MapPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void MapPrint(); |
void MapVerify(); |
void SharedMapVerify(); |
#endif |
@@ -3688,8 +3801,13 @@ |
// resource is accessible. Otherwise, always return true. |
inline bool HasValidSource(); |
+#ifdef OBJECT_PRINT |
+ inline void ScriptPrint() { |
+ ScriptPrint(stdout); |
+ } |
+ void ScriptPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ScriptPrint(); |
void ScriptVerify(); |
#endif |
@@ -4052,8 +4170,13 @@ |
// 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 |
#ifdef DEBUG |
- void SharedFunctionInfoPrint(); |
void SharedFunctionInfoVerify(); |
#endif |
@@ -4285,7 +4408,10 @@ |
DECL_ACCESSORS(next_function_link, Object) |
// Prints the name of the function using PrintF. |
- void PrintName(); |
+ inline void PrintName() { |
+ PrintName(stdout); |
+ } |
+ void PrintName(FILE* out); |
// Casting. |
static inline JSFunction* cast(Object* obj); |
@@ -4295,8 +4421,13 @@ |
void JSFunctionIterateBody(int object_size, ObjectVisitor* v); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void JSFunctionPrint() { |
+ JSFunctionPrint(stdout); |
+ } |
+ void JSFunctionPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSFunctionPrint(); |
void JSFunctionVerify(); |
#endif |
@@ -4345,8 +4476,13 @@ |
static inline JSGlobalProxy* cast(Object* obj); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void JSGlobalProxyPrint() { |
+ JSGlobalProxyPrint(stdout); |
+ } |
+ void JSGlobalProxyPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSGlobalProxyPrint(); |
void JSGlobalProxyVerify(); |
#endif |
@@ -4416,8 +4552,13 @@ |
static inline JSGlobalObject* cast(Object* obj); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void JSGlobalObjectPrint() { |
+ JSGlobalObjectPrint(stdout); |
+ } |
+ void JSGlobalObjectPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSGlobalObjectPrint(); |
void JSGlobalObjectVerify(); |
#endif |
@@ -4445,8 +4586,13 @@ |
static inline JSBuiltinsObject* cast(Object* obj); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void JSBuiltinsObjectPrint() { |
+ JSBuiltinsObjectPrint(stdout); |
+ } |
+ void JSBuiltinsObjectPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSBuiltinsObjectPrint(); |
void JSBuiltinsObjectVerify(); |
#endif |
@@ -4483,8 +4629,13 @@ |
static inline JSValue* cast(Object* obj); |
// Dispatched behavior. |
+#ifdef OBJECT_PRINT |
+ inline void JSValuePrint() { |
+ JSValuePrint(stdout); |
+ } |
+ void JSValuePrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void JSValuePrint(); |
void JSValueVerify(); |
#endif |
@@ -4673,8 +4824,13 @@ |
static inline CodeCache* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void CodeCachePrint() { |
+ CodeCachePrint(stdout); |
+ } |
+ void CodeCachePrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void CodeCachePrint(); |
void CodeCacheVerify(); |
#endif |
@@ -4975,8 +5131,13 @@ |
// Dispatched behavior. |
void StringShortPrint(StringStream* accumulator); |
+#ifdef OBJECT_PRINT |
+ inline void StringPrint() { |
+ StringPrint(stdout); |
+ } |
+ void StringPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void StringPrint(); |
void StringVerify(); |
#endif |
inline bool IsFlat(); |
@@ -5531,8 +5692,13 @@ |
#ifdef DEBUG |
void JSGlobalPropertyCellVerify(); |
- void JSGlobalPropertyCellPrint(); |
#endif |
+#ifdef OBJECT_PRINT |
+ inline void JSGlobalPropertyCellPrint() { |
+ JSGlobalPropertyCellPrint(stdout); |
+ } |
+ void JSGlobalPropertyCellPrint(FILE* out); |
+#endif |
// Layout description. |
static const int kValueOffset = HeapObject::kHeaderSize; |
@@ -5566,8 +5732,13 @@ |
template<typename StaticVisitor> |
inline void ProxyIterateBody(); |
+#ifdef OBJECT_PRINT |
+ inline void ProxyPrint() { |
+ ProxyPrint(stdout); |
+ } |
+ void ProxyPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ProxyPrint(); |
void ProxyVerify(); |
#endif |
@@ -5616,8 +5787,13 @@ |
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 |
#ifdef DEBUG |
- void JSArrayPrint(); |
void JSArrayVerify(); |
#endif |
@@ -5688,8 +5864,13 @@ |
static inline AccessorInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void AccessorInfoPrint() { |
+ AccessorInfoPrint(stdout); |
+ } |
+ void AccessorInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void AccessorInfoPrint(); |
void AccessorInfoVerify(); |
#endif |
@@ -5719,8 +5900,13 @@ |
static inline AccessCheckInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void AccessCheckInfoPrint() { |
+ AccessCheckInfoPrint(stdout); |
+ } |
+ void AccessCheckInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void AccessCheckInfoPrint(); |
void AccessCheckInfoVerify(); |
#endif |
@@ -5745,8 +5931,13 @@ |
static inline InterceptorInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void InterceptorInfoPrint() { |
+ InterceptorInfoPrint(stdout); |
+ } |
+ void InterceptorInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void InterceptorInfoPrint(); |
void InterceptorInfoVerify(); |
#endif |
@@ -5770,8 +5961,13 @@ |
static inline CallHandlerInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void CallHandlerInfoPrint() { |
+ CallHandlerInfoPrint(stdout); |
+ } |
+ void CallHandlerInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void CallHandlerInfoPrint(); |
void CallHandlerInfoVerify(); |
#endif |
@@ -5827,8 +6023,13 @@ |
static inline FunctionTemplateInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void FunctionTemplateInfoPrint() { |
+ FunctionTemplateInfoPrint(stdout); |
+ } |
+ void FunctionTemplateInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void FunctionTemplateInfoPrint(); |
void FunctionTemplateInfoVerify(); |
#endif |
@@ -5870,8 +6071,13 @@ |
static inline ObjectTemplateInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void ObjectTemplateInfoPrint() { |
+ ObjectTemplateInfoPrint(stdout); |
+ } |
+ void ObjectTemplateInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void ObjectTemplateInfoPrint(); |
void ObjectTemplateInfoVerify(); |
#endif |
@@ -5889,8 +6095,13 @@ |
static inline SignatureInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void SignatureInfoPrint() { |
+ SignatureInfoPrint(stdout); |
+ } |
+ void SignatureInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void SignatureInfoPrint(); |
void SignatureInfoVerify(); |
#endif |
@@ -5909,8 +6120,13 @@ |
static inline TypeSwitchInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void TypeSwitchInfoPrint() { |
+ TypeSwitchInfoPrint(stdout); |
+ } |
+ void TypeSwitchInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void TypeSwitchInfoPrint(); |
void TypeSwitchInfoVerify(); |
#endif |
@@ -5956,8 +6172,13 @@ |
static inline DebugInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void DebugInfoPrint() { |
+ DebugInfoPrint(stdout); |
+ } |
+ void DebugInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void DebugInfoPrint(); |
void DebugInfoVerify(); |
#endif |
@@ -6009,8 +6230,13 @@ |
static inline BreakPointInfo* cast(Object* obj); |
+#ifdef OBJECT_PRINT |
+ inline void BreakPointInfoPrint() { |
+ BreakPointInfoPrint(stdout); |
+ } |
+ void BreakPointInfoPrint(FILE* out); |
+#endif |
#ifdef DEBUG |
- void BreakPointInfoPrint(); |
void BreakPointInfoVerify(); |
#endif |