MIPS: More OStreamsUse OStreams more often.
authorkilvadyb@homejinni.com <kilvadyb@homejinni.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Jul 2014 16:01:09 +0000 (16:01 +0000)
committerkilvadyb@homejinni.com <kilvadyb@homejinni.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 7 Jul 2014 16:01:09 +0000 (16:01 +0000)
Port r22232 (f837b91)

Original commit message:
This is a mostly mechanical CL (more than 90% Emacs macros and
query-replace-regexp) moving FILE*/StringStream*-based APIs to
OStream-based APIs. There are a few places where this had to stop,
otherwise the CL would be even bigger, but this can easily and
incrementally cleaned up later.

BUG=
R=palfia@homejinni.com

Review URL: https://codereview.chromium.org/373773002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22250 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mips/lithium-mips.cc
src/mips/simulator-mips.cc

index 7f2a47f..f264f62 100644 (file)
@@ -322,8 +322,9 @@ void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
 
 void LStoreNamedField::PrintDataTo(StringStream* stream) {
   object()->PrintTo(stream);
-  hydrogen()->access().PrintTo(stream);
-  stream->Add(" <- ");
+  OStringStream os;
+  os << hydrogen()->access() << " <- ";
+  stream->Add(os.c_str());
   value()->PrintTo(stream);
 }
 
index f329703..052eaed 100644 (file)
@@ -455,17 +455,18 @@ void MipsDebugger::Debug() {
                  || (strcmp(cmd, "printobject") == 0)) {
         if (argc == 2) {
           int32_t value;
+          OFStream os(stdout);
           if (GetValue(arg1, &value)) {
             Object* obj = reinterpret_cast<Object*>(value);
-            PrintF("%s: \n", arg1);
+            os << arg1 << ": \n";
 #ifdef DEBUG
-            obj->PrintLn();
+            obj->Print(os);
+            os << "\n";
 #else
-            obj->ShortPrint();
-            PrintF("\n");
+            os << Brief(obj) << "\n";
 #endif
           } else {
-            PrintF("%s unrecognized\n", arg1);
+            os << arg1 << " unrecognized\n";
           }
         } else {
           PrintF("printobject <value>\n");