From 581747c8692789309dabcf0f1f59ab1f1936c5f2 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 9 Dec 2014 06:20:01 -0800 Subject: [PATCH] Make it possible to turn on OBJECT_PRINT without DEBUG BUG=none R=machenbach@chromium.org LOG=n NOTREECHECKS=true Review URL: https://codereview.chromium.org/771323006 Cr-Commit-Position: refs/heads/master@{#25723} --- src/objects-printer.cc | 4 ++-- src/objects.h | 8 +++++--- src/transitions.h | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/objects-printer.cc b/src/objects-printer.cc index 89dd061576..c8c418622a 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -1122,7 +1122,7 @@ int Name::NameShortPrint(Vector str) { #endif // TRACE_MAPS -#ifdef DEBUG +#if defined(DEBUG) || defined(OBJECT_PRINT) // This method is only meant to be called from gdb for debugging purposes. // Since the string can also be in two-byte encoding, non-Latin1 characters // will be ignored in the output. @@ -1210,5 +1210,5 @@ void JSObject::PrintTransitions(std::ostream& os) { // NOLINT if (!map()->HasTransitionArray()) return; map()->transitions()->PrintTransitions(os, false); } -#endif // DEBUG +#endif // defined(DEBUG) || defined(OBJECT_PRINT) } } // namespace v8::internal diff --git a/src/objects.h b/src/objects.h index fb5cb6bf42..75573fce92 100644 --- a/src/objects.h +++ b/src/objects.h @@ -2143,7 +2143,7 @@ class JSObject: public JSReceiver { void PrintProperties(std::ostream& os); // NOLINT void PrintElements(std::ostream& os); // NOLINT #endif -#ifdef DEBUG +#if defined(DEBUG) || defined(OBJECT_PRINT) void PrintTransitions(std::ostream& os); // NOLINT #endif @@ -3070,13 +3070,15 @@ class DescriptorArray: public FixedArray { static const int kDescriptorValue = 2; static const int kDescriptorSize = 3; -#ifdef DEBUG +#if defined(DEBUG) || defined(OBJECT_PRINT) // For our gdb macros, we should perhaps change these in the future. void Print(); // Print all the descriptors. void PrintDescriptors(std::ostream& os); // NOLINT +#endif +#ifdef DEBUG // Is the descriptor array sorted and without duplicates? bool IsSortedNoDuplicates(int valid_descriptors = -1); @@ -8961,7 +8963,7 @@ class String: public Name { // Dispatched behavior. void StringShortPrint(StringStream* accumulator); void PrintUC16(std::ostream& os, int start = 0, int end = -1); // NOLINT -#ifdef DEBUG +#if defined(DEBUG) || defined(OBJECT_PRINT) char* ToAsciiArray(); #endif DECLARE_PRINTER(String) diff --git a/src/transitions.h b/src/transitions.h index 6e979ed7a5..c6ed223390 100644 --- a/src/transitions.h +++ b/src/transitions.h @@ -155,13 +155,15 @@ class TransitionArray: public FixedArray { static const int kTransitionTarget = 1; static const int kTransitionSize = 2; -#ifdef DEBUG +#if defined(DEBUG) || defined(OBJECT_PRINT) // For our gdb macros, we should perhaps change these in the future. void Print(); // Print all the transitions. void PrintTransitions(std::ostream& os, bool print_header = true); // NOLINT +#endif +#ifdef DEBUG bool IsSortedNoDuplicates(int valid_entries = -1); bool IsConsistentWithBackPointers(Map* current_map); bool IsEqualTo(TransitionArray* other);