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

Unified Diff: src/objects.h

Issue 5998001: 1. Added support for object printing for release mode using the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
===================================================================
--- src/objects.h (revision 6066)
+++ src/objects.h (working copy)
@@ -607,10 +607,12 @@
return reinterpret_cast<Object*>(this);
}
+#ifdef OBJECT_PRINT
+ // Prints this object with details.
+ void Print(FILE* out = stdout);
Søren Thygesen Gjesse 2010/12/17 13:44:04 The Google C++ Style Guide does not allow default
+ void PrintLn(FILE* out = stdout);
+#endif
#ifdef DEBUG
- // Prints this object with details.
- void Print();
- void PrintLn();
// Verifies the object.
void Verify();
#endif
@@ -762,7 +764,7 @@
#endif
// Prints this object without details.
- void ShortPrint();
+ void ShortPrint(FILE* out = stdout);
// Prints this object without details to a message accumulator.
void ShortPrint(StringStream* accumulator);
@@ -801,7 +803,7 @@
static inline Smi* cast(Object* object);
// Dispatched behavior.
- void SmiPrint();
+ void SmiPrint(FILE* out = stdout);
void SmiPrint(StringStream* accumulator);
#ifdef DEBUG
void SmiVerify();
@@ -870,7 +872,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 +1101,20 @@
// Dispatched behavior.
void HeapObjectShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+ void HeapObjectPrint(FILE* out = stdout);
+#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 +1197,7 @@
// Dispatched behavior.
Object* HeapNumberToBoolean();
- void HeapNumberPrint();
+ void HeapNumberPrint(FILE* out = stdout);
void HeapNumberPrint(StringStream* accumulator);
#ifdef DEBUG
void HeapNumberVerify();
@@ -1649,12 +1657,18 @@
// Dispatched behavior.
void JSObjectShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+ void JSObjectPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSObjectPrint();
void JSObjectVerify();
- void PrintProperties();
- void PrintElements();
+#endif
+#ifdef OBJECT_PRINT
+ void PrintProperties(FILE* out = stdout);
+ void PrintElements(FILE* out = stdout);
+#endif
+#ifdef DEBUG
// Structure for collecting spill information about JSObjects.
class SpillInformation {
public:
@@ -1835,8 +1849,10 @@
static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize;
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void FixedArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void FixedArrayPrint();
void FixedArrayVerify();
// Checks if two FixedArrays have identical contents.
bool IsEqualTo(FixedArray* other);
@@ -2012,10 +2028,12 @@
static const int kEnumCacheBridgeCacheOffset =
kEnumCacheBridgeEnumOffset + kPointerSize;
-#ifdef DEBUG
+#ifdef OBJECT_PRINT
// Print all the descriptors.
- void PrintDescriptors();
+ void PrintDescriptors(FILE* out = stdout);
+#endif
+#ifdef DEBUG
// Is the descriptor array sorted and without duplicates?
bool IsSortedNoDuplicates();
@@ -2396,8 +2414,8 @@
// Ensure enough space for n additional elements.
MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
-#ifdef DEBUG
- void Print();
+#ifdef OBJECT_PRINT
+ void Print(FILE* out = stdout);
#endif
// Returns the key (slow).
Object* SlowReverseLookup(Object* value);
@@ -2619,8 +2637,10 @@
inline int ByteArraySize() {
return SizeFor(this->length());
}
+#ifdef OBJECT_PRINT
+ void ByteArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ByteArrayPrint();
void ByteArrayVerify();
#endif
@@ -2669,8 +2689,10 @@
// Casting.
static inline PixelArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void PixelArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void PixelArrayPrint();
void PixelArrayVerify();
#endif // DEBUG
@@ -2741,8 +2763,10 @@
// Casting.
static inline ExternalByteArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalByteArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalByteArrayPrint();
void ExternalByteArrayVerify();
#endif // DEBUG
@@ -2764,8 +2788,10 @@
// Casting.
static inline ExternalUnsignedByteArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalUnsignedByteArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalUnsignedByteArrayPrint();
void ExternalUnsignedByteArrayVerify();
#endif // DEBUG
@@ -2787,8 +2813,10 @@
// Casting.
static inline ExternalShortArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalShortArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalShortArrayPrint();
void ExternalShortArrayVerify();
#endif // DEBUG
@@ -2810,8 +2838,10 @@
// Casting.
static inline ExternalUnsignedShortArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalUnsignedShortArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalUnsignedShortArrayPrint();
void ExternalUnsignedShortArrayVerify();
#endif // DEBUG
@@ -2833,8 +2863,10 @@
// Casting.
static inline ExternalIntArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalIntArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalIntArrayPrint();
void ExternalIntArrayVerify();
#endif // DEBUG
@@ -2856,8 +2888,10 @@
// Casting.
static inline ExternalUnsignedIntArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalUnsignedIntArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalUnsignedIntArrayPrint();
void ExternalUnsignedIntArrayVerify();
#endif // DEBUG
@@ -2879,8 +2913,10 @@
// Casting.
static inline ExternalFloatArray* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ExternalFloatArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ExternalFloatArrayPrint();
void ExternalFloatArrayVerify();
#endif // DEBUG
@@ -2960,8 +2996,8 @@
// Casting.
static inline DeoptimizationInputData* cast(Object* obj);
-#ifdef DEBUG
- void DeoptimizationInputDataPrint();
+#ifdef OBJECT_PRINT
+ void DeoptimizationInputDataPrint(FILE* out);
#endif
private:
@@ -2999,8 +3035,8 @@
// Casting.
static inline DeoptimizationOutputData* cast(Object* obj);
-#ifdef DEBUG
- void DeoptimizationOutputDataPrint();
+#ifdef OBJECT_PRINT
+ void DeoptimizationOutputDataPrint(FILE* out);
#endif
};
@@ -3049,7 +3085,7 @@
static const char* Kind2String(Kind kind);
static const char* ICState2String(InlineCacheState state);
static const char* PropertyType2String(PropertyType type);
- void Disassemble(const char* name);
+ void Disassemble(const char* name, FILE* out = stdout);
#endif // ENABLE_DISASSEMBLER
// [instruction_size]: Size of the native instructions
@@ -3242,8 +3278,10 @@
template<typename StaticVisitor>
inline void CodeIterateBody();
+#ifdef OBJECT_PRINT
+ void CodePrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void CodePrint();
void CodeVerify();
#endif
@@ -3531,8 +3569,10 @@
void ClearNonLiveTransitions(Object* real_prototype);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void MapPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void MapPrint();
void MapVerify();
void SharedMapVerify();
#endif
@@ -3688,8 +3728,10 @@
// resource is accessible. Otherwise, always return true.
inline bool HasValidSource();
+#ifdef OBJECT_PRINT
+ void ScriptPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ScriptPrint();
void ScriptVerify();
#endif
@@ -4052,8 +4094,10 @@
// Dispatched behavior.
// Set max_length to -1 for unlimited length.
void SourceCodePrint(StringStream* accumulator, int max_length);
+#ifdef OBJECT_PRINT
+ void SharedFunctionInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void SharedFunctionInfoPrint();
void SharedFunctionInfoVerify();
#endif
@@ -4285,7 +4329,7 @@
DECL_ACCESSORS(next_function_link, Object)
// Prints the name of the function using PrintF.
- void PrintName();
+ void PrintName(FILE* out = stdout);
// Casting.
static inline JSFunction* cast(Object* obj);
@@ -4295,8 +4339,10 @@
void JSFunctionIterateBody(int object_size, ObjectVisitor* v);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSFunctionPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSFunctionPrint();
void JSFunctionVerify();
#endif
@@ -4345,8 +4391,10 @@
static inline JSGlobalProxy* cast(Object* obj);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSGlobalProxyPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSGlobalProxyPrint();
void JSGlobalProxyVerify();
#endif
@@ -4416,8 +4464,10 @@
static inline JSGlobalObject* cast(Object* obj);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSGlobalObjectPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSGlobalObjectPrint();
void JSGlobalObjectVerify();
#endif
@@ -4445,8 +4495,10 @@
static inline JSBuiltinsObject* cast(Object* obj);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSBuiltinsObjectPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSBuiltinsObjectPrint();
void JSBuiltinsObjectVerify();
#endif
@@ -4483,8 +4535,10 @@
static inline JSValue* cast(Object* obj);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSValuePrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSValuePrint();
void JSValueVerify();
#endif
@@ -4673,8 +4727,10 @@
static inline CodeCache* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void CodeCachePrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void CodeCachePrint();
void CodeCacheVerify();
#endif
@@ -4975,8 +5031,10 @@
// Dispatched behavior.
void StringShortPrint(StringStream* accumulator);
+#ifdef OBJECT_PRINT
+ void StringPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void StringPrint();
void StringVerify();
#endif
inline bool IsFlat();
@@ -5531,8 +5589,10 @@
#ifdef DEBUG
void JSGlobalPropertyCellVerify();
- void JSGlobalPropertyCellPrint();
#endif
+#ifdef OBJECT_PRINT
+ void JSGlobalPropertyCellPrint(FILE* out = stdout);
+#endif
// Layout description.
static const int kValueOffset = HeapObject::kHeaderSize;
@@ -5566,8 +5626,10 @@
template<typename StaticVisitor>
inline void ProxyIterateBody();
+#ifdef OBJECT_PRINT
+ void ProxyPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ProxyPrint();
void ProxyVerify();
#endif
@@ -5616,8 +5678,10 @@
inline void EnsureSize(int minimum_size_of_backing_fixed_array);
// Dispatched behavior.
+#ifdef OBJECT_PRINT
+ void JSArrayPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void JSArrayPrint();
void JSArrayVerify();
#endif
@@ -5688,8 +5752,10 @@
static inline AccessorInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void AccessorInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void AccessorInfoPrint();
void AccessorInfoVerify();
#endif
@@ -5719,8 +5785,10 @@
static inline AccessCheckInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void AccessCheckInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void AccessCheckInfoPrint();
void AccessCheckInfoVerify();
#endif
@@ -5745,8 +5813,10 @@
static inline InterceptorInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void InterceptorInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void InterceptorInfoPrint();
void InterceptorInfoVerify();
#endif
@@ -5770,8 +5840,10 @@
static inline CallHandlerInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void CallHandlerInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void CallHandlerInfoPrint();
void CallHandlerInfoVerify();
#endif
@@ -5827,8 +5899,10 @@
static inline FunctionTemplateInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void FunctionTemplateInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void FunctionTemplateInfoPrint();
void FunctionTemplateInfoVerify();
#endif
@@ -5870,8 +5944,10 @@
static inline ObjectTemplateInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void ObjectTemplateInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void ObjectTemplateInfoPrint();
void ObjectTemplateInfoVerify();
#endif
@@ -5889,8 +5965,10 @@
static inline SignatureInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void SignatureInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void SignatureInfoPrint();
void SignatureInfoVerify();
#endif
@@ -5909,8 +5987,10 @@
static inline TypeSwitchInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void TypeSwitchInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void TypeSwitchInfoPrint();
void TypeSwitchInfoVerify();
#endif
@@ -5956,8 +6036,10 @@
static inline DebugInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void DebugInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void DebugInfoPrint();
void DebugInfoVerify();
#endif
@@ -6009,8 +6091,10 @@
static inline BreakPointInfo* cast(Object* obj);
+#ifdef OBJECT_PRINT
+ void BreakPointInfoPrint(FILE* out = stdout);
+#endif
#ifdef DEBUG
- void BreakPointInfoPrint();
void BreakPointInfoVerify();
#endif
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698