Bug 1617851: Add location information to Ion abort messages in non-debug mode. r=jandem
☠☠ backed out by 011ad9ff2608 ☠ ☠
authorAndré Bargull <andre.bargull@gmail.com>
Wed, 01 Apr 2020 15:48:09 +0000
changeset 521668 9514a3c5e611a24d1dacd19b9daeb5e1cc1b2827
parent 521667 6ae6f2b454d8bdbbb2ca0351d2a3c9a9f5e2fe1a
child 521669 52c711dbc6f86783c4c47622e06a3577bf99e634
push id111771
push usercsabou@mozilla.com
push dateWed, 01 Apr 2020 17:55:10 +0000
treeherderautoland@9514a3c5e611 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1617851
milestone76.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 1617851: Add location information to Ion abort messages in non-debug mode. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D64043
js/src/jit/Ion.cpp
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1845,18 +1845,20 @@ static bool ScriptIsTooLarge(JSContext* 
   size_t maxScriptSize = canCompileOffThread
                              ? JitOptions.ionMaxScriptSize
                              : JitOptions.ionMaxScriptSizeMainThread;
   size_t maxLocalsAndArgs = canCompileOffThread
                                 ? JitOptions.ionMaxLocalsAndArgs
                                 : JitOptions.ionMaxLocalsAndArgsMainThread;
 
   if (script->length() > maxScriptSize || numLocalsAndArgs > maxLocalsAndArgs) {
-    JitSpew(JitSpew_IonAbort, "Script too large (%zu bytes) (%zu locals/args)",
-            script->length(), numLocalsAndArgs);
+    JitSpew(JitSpew_IonAbort,
+            "Script too large (%zu bytes) (%zu locals/args) @ %s:%u:%u",
+            script->length(), numLocalsAndArgs, script->filename(),
+            script->lineno(), script->column());
     TrackIonAbort(cx, script, script->code(), "too large");
     return true;
   }
 
   return false;
 }
 
 bool CanIonCompileScript(JSContext* cx, JSScript* script) {
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -185,39 +185,45 @@ IonBuilder::IonBuilder(JSContext* analys
 
   if (!info_->isAnalysis()) {
     script()->jitScript()->setIonCompiledOrInlined();
   }
 }
 
 mozilla::GenericErrorResult<AbortReason> IonBuilder::abort(AbortReason r) {
   auto res = mirGen_.abort(r);
+  unsigned line, column;
 #ifdef DEBUG
-  JitSpew(JitSpew_IonAbort, "aborted @ %s:%d", script()->filename(),
-          PCToLineNumber(script(), pc));
+  line = PCToLineNumber(script(), pc, &column);
 #else
-  JitSpew(JitSpew_IonAbort, "aborted @ %s", script()->filename());
+  line = script()->lineno();
+  column = script()->column();
 #endif
+  JitSpew(JitSpew_IonAbort, "aborted @ %s:%u:%u", script()->filename(), line,
+          column);
   return res;
 }
 
 mozilla::GenericErrorResult<AbortReason> IonBuilder::abort(AbortReason r,
                                                            const char* message,
                                                            ...) {
   // Don't call PCToLineNumber in release builds.
   va_list ap;
   va_start(ap, message);
   auto res = mirGen_.abortFmt(r, message, ap);
   va_end(ap);
+  unsigned line, column;
 #ifdef DEBUG
-  JitSpew(JitSpew_IonAbort, "aborted @ %s:%d", script()->filename(),
-          PCToLineNumber(script(), pc));
+  line = PCToLineNumber(script(), pc, &column);
 #else
-  JitSpew(JitSpew_IonAbort, "aborted @ %s", script()->filename());
+  line = script()->lineno();
+  column = script()->column();
 #endif
+  JitSpew(JitSpew_IonAbort, "aborted @ %s:%u:%u", script()->filename(), line,
+          column);
   return res;
 }
 
 IonBuilder* IonBuilder::outermostBuilder() {
   IonBuilder* builder = this;
   while (builder->callerBuilder_) {
     builder = builder->callerBuilder_;
   }