Commits

Brian Burg committed a64cfbe

NEW: tmp-mgr

  • Participants
  • Parent commits 2f98538

Comments (0)

Files changed (2)

 xpcom-nsIProbeService
 tmp-dispatch
 tmp-defs
+tmp-mgr
 
 
 
+# HG changeset patch
+# Parent 745bea3a1b0f0c57b3cd39a2cab21ecc8a320fc9
+diff --git a/js/src/jsprobemgr.cpp b/js/src/jsprobemgr.cpp
+--- a/js/src/jsprobemgr.cpp
++++ b/js/src/jsprobemgr.cpp
+@@ -1550,9 +1550,7 @@
+     void *payloadbuf;
+     void *bufp;
+ 
+-    JS_BeginRequest(adminCx);
+-    payloadbuf = JS_malloc(adminCx, order.totalBytes);
+-    JS_EndRequest(adminCx);
++    payloadbuf = rt->malloc_(order.totalBytes);
+ 
+     /* zero the memory for debugging niceness */
+     memset(payloadbuf, 0L, order.totalBytes);
+@@ -1590,7 +1588,7 @@
+         ProbeValue tmp = curArg;
+         for (PickItem::TransformVec::iterator it = item->transforms.begin();
+              it != item->transforms.end(); it++) {
+-            if (!(ProbeFunctionData[*it].fn)(adminCx, &tmp)) {
++            if (!(ProbeFunctionData[*it].fn)(rt, &tmp)) {
+                 PR_LOG(gProbeManagerLog, PR_LOG_ERROR, ("Error when applying transform %d (%s)\n", ProbeFunctionData[*it].transform, ProbeFunctionData[*it].fn_name));
+             }
+         }
+diff --git a/js/src/jsprobemgr.h b/js/src/jsprobemgr.h
+--- a/js/src/jsprobemgr.h
++++ b/js/src/jsprobemgr.h
+@@ -197,6 +197,10 @@
+     /* TODO: inline everything that this calls, as well (EventQueue.push) */
+     bool fireProbe(ProbePoint probe, ...);
+ 
++    /* use these to avoid reentrancy on a different thread (say, by
++     * triggering a GC or heap resize event on probe runtime) */
++    bool isProbeRuntime(JSRuntime *runtime) const { return runtime == rt; }
++
+     bool isScriptRunning() const { return m_scriptRunning; }
+     bool hasPendingScripts() const { return m_pendingScriptCount; }
+