Reviewers: Michael Achenbach,

Description:
Make it possible to turn on OBJECT_PRINT without DEBUG

BUG=none
[email protected]
LOG=n
NOTREECHECKS=true

Please review this at https://codereview.chromium.org/771323006/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+12, -8 lines):
  M build/features.gypi
  M src/objects.h
  M src/objects-printer.cc
  M src/transitions.h


Index: build/features.gypi
diff --git a/build/features.gypi b/build/features.gypi
index c5b7c425b14aedf1630e57573cce3528c3ff96c2..da3bf6349e36c7fb48ec6a71e046476516ffdd43 100644
--- a/build/features.gypi
+++ b/build/features.gypi
@@ -33,9 +33,9 @@

     'v8_enable_gdbjit%': 0,

-    'v8_object_print%': 0,
+    'v8_object_print%': 1,

-    'v8_enable_verify_heap%': 0,
+    'v8_enable_verify_heap%': 1,

     'v8_trace_maps%': 0,

Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 89dd06157686995d4241513fcb774e8c1b09664b..c8c418622a749d58bae5ad2ac3482d8ec3193a26 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -1122,7 +1122,7 @@ int Name::NameShortPrint(Vector<char> 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index c6f8b10a9e4563f4896a4fa227aa498a28e00af1..b43d6ce446cf7e01a47d7e6c51fb5eb3f562cd29 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);

@@ -8958,7 +8960,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)
Index: src/transitions.h
diff --git a/src/transitions.h b/src/transitions.h
index 6e979ed7a50286ba9d0084e00b6bc02b88212b36..c6ed2233906bf4a23455b3a2ab2ec67f151cf312 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);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to