Commits

Brian Burg committed a64cfbe

NEW: tmp-mgr

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; }
+ 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.