Bug 1435570: Handle null script filenames in CacheIR spew r=evilpie
authorMatthew Gaudet <mgaudet@mozilla.com>
Sat, 03 Feb 2018 19:08:56 -0500
changeset 402611 56056bad50c07a6fe4473f8c49e3497372e4f151
parent 402610 af6cc52c9b8b737e4734710ad6786dacdb59d923
child 402612 b5cfc56349734b20935ff9d89dc7028933ea8856
push id33393
push userrgurzau@mozilla.com
push dateTue, 06 Feb 2018 21:54:26 +0000
treeherdermozilla-central@0790ec12200d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1435570
milestone60.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 1435570: Handle null script filenames in CacheIR spew r=evilpie Scripts can have null as a filename, as evidenced by jit-test/tests/basic/null-filename-Error.js
js/src/jit/CacheIRSpewer.cpp
--- a/js/src/jit/CacheIRSpewer.cpp
+++ b/js/src/jit/CacheIRSpewer.cpp
@@ -73,20 +73,20 @@ CacheIRSpewer::init()
     return true;
 }
 
 void
 CacheIRSpewer::beginCache(LockGuard<Mutex>&, const IRGenerator& gen)
 {
     MOZ_ASSERT(enabled());
     JSONPrinter& j = json.ref();
-
+    const char* filename = gen.script_->filename();
     j.beginObject();
     j.property("name", CacheKindNames[uint8_t(gen.cacheKind_)]);
-    j.property("file", gen.script_->filename());
+    j.property("file", filename ? filename : "null");
     j.property("mode", int(gen.mode_));
     if (jsbytecode* pc = gen.pc_) {
         unsigned column;
         j.property("line", PCToLineNumber(gen.script_, pc, &column));
         j.property("column", column);
         j.formatProperty("pc", "%p", pc);
     }
 }