Bug 1397856 replacing Sprinter with js::GenericPrinter r=nbp,Yoric
authorsourav3 <sourav.mukherjee619@gmail.com>
Thu, 14 Sep 2017 02:17:02 +0800
changeset 430406 e1cdf9566f460ec744390218fea97a4b1486c9b5
parent 430405 beec84e86e7e0537db2b12f2e4d12e383910936a
child 430407 9cff81ada79469b69384bc4f8e5a1e7c94e9a1a9
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, Yoric
bugs1397856
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397856 replacing Sprinter with js::GenericPrinter r=nbp,Yoric MozReview-Commit-ID: FQ89BijH5VV *** Bug 1397856 removing empty line MozReview-Commit-ID: EwJSL3K6ree
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3783,21 +3783,16 @@ js::DumpBacktrace(JSContext* cx, FILE* f
 {
     Fprinter out(fp);
     js::DumpBacktrace(cx, out);
 }
 
 JS_FRIEND_API(void)
 js::DumpBacktrace(JSContext* cx, js::GenericPrinter& out)
 {
-    Sprinter sprinter(cx, false);
-    if (!sprinter.init()) {
-        out.put("js::DumpBacktrace: OOM\n");
-        return;
-    }
     size_t depth = 0;
     for (AllFramesIter i(cx); !i.done(); ++i, ++depth) {
         const char* filename;
         unsigned line;
         if (i.hasScript()) {
             filename = JS_GetScriptFilename(i.script());
             line = PCToLineNumber(i.script(), i.pc());
         } else {
@@ -3806,31 +3801,27 @@ js::DumpBacktrace(JSContext* cx, js::Gen
         }
         char frameType =
             i.isInterp() ? 'i' :
             i.isBaseline() ? 'b' :
             i.isIon() ? 'I' :
             i.isWasm() ? 'W' :
             '?';
 
-        sprinter.printf("#%zu %14p %c   %s:%d",
+        out.printf("#%zu %14p %c   %s:%d",
                         depth, i.rawFramePtr(), frameType, filename, line);
 
         if (i.hasScript()) {
-            sprinter.printf(" (%p @ %zu)\n",
+            out.printf(" (%p @ %zu)\n",
                             i.script(), i.script()->pcToOffset(i.pc()));
         } else {
-            sprinter.printf(" (%p)\n", i.pc());
+            out.printf(" (%p)\n", i.pc());
         }
     }
-    out.printf("%s", sprinter.string());
-#ifdef XP_WIN32
-    if (IsDebuggerPresent())
-        OutputDebugStringA(sprinter.string());
-#endif
+
 }
 
 JS_FRIEND_API(void)
 js::DumpBacktrace(JSContext* cx)
 {
     DumpBacktrace(cx, stdout);
 }