Version 3.5.2
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@8765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index fa03447..5cb5269 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -560,6 +560,21 @@
}
+// This method is only meant to be called from gdb for debugging purposes.
+// Since the string can also be in two-byte encoding, non-ascii characters
+// will be ignored in the output.
+char* String::ToAsciiArray() {
+ // Static so that subsequent calls frees previously allocated space.
+ // This also means that previous results will be overwritten.
+ static char* buffer = NULL;
+ if (buffer != NULL) free(buffer);
+ buffer = new char[length()+1];
+ WriteToFlat(this, buffer, 0, length());
+ buffer[length()] = 0;
+ return buffer;
+}
+
+
void JSProxy::JSProxyPrint(FILE* out) {
HeapObject::PrintHeader(out, "JSProxy");
PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));