Bug 904809 - OdinMonkey: root ProfiledFunction::name (r=sstangl)
authorLuke Wagner <luke@mozilla.com>
Thu, 15 Aug 2013 10:34:46 -0500
changeset 142784 16ff56b1021ee01f3dee50ef1aebd94eccac0fe3
parent 142783 2766d0ee65c5c54b9594199dde88ab1fee3a93e5
child 142785 f25d46b4f39fb704bbb8c4185cb14f2379d77e08
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssstangl
bugs904809
milestone26.0a1
Bug 904809 - OdinMonkey: root ProfiledFunction::name (r=sstangl)
js/src/jit/AsmJSModule.h
--- a/js/src/jit/AsmJSModule.h
+++ b/js/src/jit/AsmJSModule.h
@@ -296,17 +296,23 @@ class AsmJSModule
 
         ProfiledFunction(JSAtom *name, unsigned start, unsigned end,
                          unsigned line = 0U, unsigned column = 0U)
           : name(name),
             startCodeOffset(start),
             endCodeOffset(end),
             lineno(line),
             columnIndex(column)
-        { }
+        {
+            JS_ASSERT(name->isTenured());
+        }
+
+        void trace(JSTracer *trc) {
+            MarkStringUnbarriered(trc, &name, "asm.js profiled function name");
+        }
     };
 #endif
 
 #if defined(JS_ION_PERF)
     struct ProfiledBlocksFunction : public ProfiledFunction
     {
         ion::PerfSpewer::BasicBlocksVector blocks;
 
@@ -386,16 +392,26 @@ class AsmJSModule
         for (unsigned i = 0; i < globals_.length(); i++)
             globals_[i].trace(trc);
         for (unsigned i = 0; i < exports_.length(); i++)
             exports_[i].trace(trc);
         for (unsigned i = 0; i < exits_.length(); i++) {
             if (exitIndexToGlobalDatum(i).fun)
                 MarkObject(trc, &exitIndexToGlobalDatum(i).fun, "asm.js imported function");
         }
+#if defined(MOZ_VTUNE)
+        for (unsigned i = 0; i < profiledFunctions_.length(); i++)
+            profiledFunctions_[i].trace(trc);
+#endif
+#if defined(JS_ION_PERF)
+        for (unsigned i = 0; i < perfProfiledFunctions_.length(); i++)
+            perfProfiledFunctions_[i].trace(trc);
+        for (unsigned i = 0; i < perfProfiledBlocksFunctions_.length(); i++)
+            perfProfiledBlocksFunctions_[i].trace(trc);
+#endif
         if (maybeHeap_)
             MarkObject(trc, &maybeHeap_, "asm.js heap");
 
         if (globalArgumentName_)
             MarkString(trc, &globalArgumentName_, "asm.js global argument name");
         if (importArgumentName_)
             MarkString(trc, &importArgumentName_, "asm.js import argument name");
         if (bufferArgumentName_)