Reviewers: jkummerow,

Message:
PTAL.

Removing this method again because in gdb you could just as well use
  call string->ToCString(0,0,0,-1,0).p
instead of
  call string->ToAsciiArray()
The former supports UTF8 and has a better memory management with SmartPointer.


Description:
Removing String::ToAsciiArray() since String::ToCString does a better job.


Please review this at http://codereview.chromium.org/7461126/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/objects-printer.cc
  M src/objects.h


Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 35735724e8717289e574c35aa8764ef9a0ada490..5d84bf3c2949ccb772038b8a62a824a4646bdf08 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -564,21 +564,6 @@ void String::StringPrint(FILE* out) {
 }


-// 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()));
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index e23b43b45fa52be6ada8a2b3df3b6db4e85322a9..ce0a54c821eaa512661e4478ac76d50465e33cc9 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5951,8 +5951,6 @@ class String: public HeapObject {
     StringPrint(stdout);
   }
   void StringPrint(FILE* out);
-
-  char* ToAsciiArray();
 #endif
 #ifdef DEBUG
   void StringVerify();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to