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

Side by Side Diff: src/objects-printer.cc

Issue 771323006: Make it possible to turn on OBJECT_PRINT without DEBUG (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 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 unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/transitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 } else { 1115 } else {
1116 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); 1116 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get());
1117 } 1117 }
1118 } 1118 }
1119 } 1119 }
1120 1120
1121 1121
1122 #endif // TRACE_MAPS 1122 #endif // TRACE_MAPS
1123 1123
1124 1124
1125 #ifdef DEBUG 1125 #if defined(DEBUG) || defined(OBJECT_PRINT)
1126 // This method is only meant to be called from gdb for debugging purposes. 1126 // This method is only meant to be called from gdb for debugging purposes.
1127 // Since the string can also be in two-byte encoding, non-Latin1 characters 1127 // Since the string can also be in two-byte encoding, non-Latin1 characters
1128 // will be ignored in the output. 1128 // will be ignored in the output.
1129 char* String::ToAsciiArray() { 1129 char* String::ToAsciiArray() {
1130 // Static so that subsequent calls frees previously allocated space. 1130 // Static so that subsequent calls frees previously allocated space.
1131 // This also means that previous results will be overwritten. 1131 // This also means that previous results will be overwritten.
1132 static char* buffer = NULL; 1132 static char* buffer = NULL;
1133 if (buffer != NULL) delete[] buffer; 1133 if (buffer != NULL) delete[] buffer;
1134 buffer = new char[length() + 1]; 1134 buffer = new char[length() + 1];
1135 WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length()); 1135 WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 } 1203 }
1204 os << " -> " << Brief(GetTarget(i)) << "\n"; 1204 os << " -> " << Brief(GetTarget(i)) << "\n";
1205 } 1205 }
1206 } 1206 }
1207 1207
1208 1208
1209 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1209 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1210 if (!map()->HasTransitionArray()) return; 1210 if (!map()->HasTransitionArray()) return;
1211 map()->transitions()->PrintTransitions(os, false); 1211 map()->transitions()->PrintTransitions(os, false);
1212 } 1212 }
1213 #endif // DEBUG 1213 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1214 } } // namespace v8::internal 1214 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698