Commits

Brian Burg committed 7bdc1ae

NEW: tmp-idl

Comments (0)

Files changed (2)

 tmp-dispatch
 tmp-defs
 tmp-mgr
+tmp-idl
 
 
 
+# HG changeset patch
+# Parent 1e9d1bfd4b6ae675761f66b50e595fe3154f0ddf
+diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h
+--- a/js/src/jsprobes.h
++++ b/js/src/jsprobes.h
+@@ -45,7 +45,7 @@
+ #endif
+ #include "jspubtd.h"
+ #include "jsprvtd.h"
+-
++#include "jscompartment.h"
+ #include "jsprobedefs.h"
+ #include "jsprobemgr.h"
+ 
+@@ -179,8 +179,8 @@
+  * Multiple compartments' GC will be interleaved during a global collection
+  * (eg, compartment 1 starts, compartment 2 starts, compartment 1 ends, ...)
+  */
+-bool GCStart(JSCompartment *compartment);
+-bool GCEnd(JSCompartment *compartment);
++bool GCStart(JSRuntime *runtime, JSCompartment *compartment);
++bool GCEnd(JSRuntime *runtime, JSCompartment *compartment);
+ 
+ bool GCStartMarkPhase(JSCompartment *compartment);
+ bool GCEndMarkPhase(JSCompartment *compartment);
+@@ -231,8 +231,8 @@
+ bool ETWCalloutEnd(JSContext *cx, JSFunction *fun);
+ bool ETWAcquireMemory(JSContext *cx, void *address, size_t nbytes);
+ bool ETWReleaseMemory(JSContext *cx, void *address, size_t nbytes);
+-bool ETWGCStart(JSCompartment *compartment);
+-bool ETWGCEnd(JSCompartment *compartment);
++bool ETWGCStart(JSRuntime *runtime, JSCompartment *compartment);
++bool ETWGCEnd(JSRuntime *runtime, JSCompartment *compartment);
+ bool ETWGCStartMarkPhase(JSCompartment *compartment);
+ bool ETWGCEndMarkPhase(JSCompartment *compartment);
+ bool ETWGCStartSweepPhase(JSCompartment *compartment);
+@@ -369,7 +369,9 @@
+ #endif
+ #ifdef MOZ_JSPROBES
+     ProbeManager *mgr = ProbeManager::manager();
+-    if (!mgr || !mgr->fireProbe(JS_WILL_RESIZE_HEAP, compartment, oldSize, newSize))
++    if (!mgr 
++        || mgr->isProbeRuntime(compartment->rt) 
++        || !mgr->fireProbe(JS_WILL_RESIZE_HEAP, compartment, oldSize, newSize))
+         ok = false;
+ #endif
+ 
+@@ -555,25 +557,30 @@
+ }
+ 
+ inline bool
+-Probes::GCStart(JSCompartment *compartment)
++Probes::GCStart(JSRuntime *runtime, JSCompartment *compartment)
+ {
+     bool ok = true;
+ 
+ #ifdef MOZ_ETW
+-    if (ProfilingActive && !ETWGCStart(compartment))
++    if (ProfilingActive && !ETWGCStart(runtime, compartment))
+         ok = false;
+ #endif
+ #ifdef MOZ_JSPROBES
+     ProbeManager *mgr = ProbeManager::manager();
+-    if (!compartment || !mgr || !mgr->fireProbe(GC_DID_START, compartment))
+-        ok = false;
++    if (!compartment) {
++        if (!mgr || !mgr->fireProbe(GLOBAL_GC_DID_START, runtime))
++            ok = false;
++    } else {
++        if (!mgr || !mgr->fireProbe(COMPARTMENT_GC_DID_START, runtime, compartment))
++            ok = false;
++    }
+ #endif
+ 
+     return ok;
+ }
+ 
+ inline bool
+-Probes::GCEnd(JSCompartment *compartment)
++Probes::GCEnd(JSRuntime *runtime, JSCompartment *compartment)
+ {
+     bool ok = true;
+ 
+@@ -581,10 +588,16 @@
+     if (ProfilingActive && !ETWGCEnd(compartment))
+         ok = false;
+ #endif
++
+ #ifdef MOZ_JSPROBES
+     ProbeManager *mgr = ProbeManager::manager();
+-    if (!compartment || !mgr || !mgr->fireProbe(GC_WILL_END, compartment))
+-        ok = false;
++    if (!compartment) {
++        if (!mgr || !mgr->fireProbe(GLOBAL_GC_WILL_END, runtime))
++            ok = false;
++    } else {
++        if (!mgr || !mgr->fireProbe(COMPARTMENT_GC_WILL_END, runtime, compartment))
++            ok = false;
++    }
+ #endif
+     return ok;
+ }
+diff --git a/toolkit/components/probes/nsIProbeService.idl b/toolkit/components/probes/nsIProbeService.idl
+--- a/toolkit/components/probes/nsIProbeService.idl
++++ b/toolkit/components/probes/nsIProbeService.idl
+@@ -50,31 +50,33 @@
+   /* These constants should be in sync with the probes as numbered in
+    * the file js/src/jsprobes.tbl
+    */
+-  const PRInt32 JS_RUNTIME_CREATE      =  1;
+-  const PRInt32 JS_RUNTIME_DESTROY     =  2;
+-  const PRInt32 JS_SHUTDOWN            =  3;
+-  const PRInt32 JS_FUNCTION_ENTER      =  4;
+-  const PRInt32 JS_FUNCTION_EXIT       =  5;
+-  const PRInt32 JS_WILL_EXECUTE_SCRIPT =  6;
+-  const PRInt32 JS_DID_EXECUTE_SCRIPT  =  7;
+-  const PRInt32 JS_WILL_RESIZE_HEAP    =  8;
+-  const PRInt32 JS_OBJECT_CREATE       =  9;
+-  const PRInt32 JS_OBJECT_RESIZE       = 10;
+-  const PRInt32 JS_OBJECT_FINALIZE     = 11;
+-  const PRInt32 JS_STRING_CREATE       = 12;
+-  const PRInt32 JS_STRING_FINALIZE     = 13;
+-  const PRInt32 JS_WILL_COMPILE_SCRIPT = 14;
+-  const PRInt32 JS_DID_COMPILE_SCRIPT  = 15;
+-  const PRInt32 JS_WILL_CALL_NATIVE    = 16;
+-  const PRInt32 JS_DID_CALL_NATIVE     = 17;
+-  const PRInt32 JS_ACQUIRE_MEMORY      = 18;
+-  const PRInt32 JS_RELEASE_MEMORY      = 19;
+-  const PRInt32 GC_DID_START           = 20;
+-  const PRInt32 GC_WILL_END            = 21;
+-  const PRInt32 GC_MARK_PHASE_START    = 22;
+-  const PRInt32 GC_MARK_PHASE_END      = 23;
+-  const PRInt32 GC_SWEEP_PHASE_START   = 24;
+-  const PRInt32 GC_SWEEP_PHASE_END     = 25;
++  const PRInt32 JS_RUNTIME_CREATE          =  1;
++  const PRInt32 JS_RUNTIME_DESTROY         =  2;
++  const PRInt32 JS_SHUTDOWN                =  3;
++  const PRInt32 JS_FUNCTION_ENTER          =  4;
++  const PRInt32 JS_FUNCTION_EXIT           =  5;
++  const PRInt32 JS_WILL_EXECUTE_SCRIPT     =  6;
++  const PRInt32 JS_DID_EXECUTE_SCRIPT      =  7;
++  const PRInt32 JS_WILL_RESIZE_HEAP        =  8;
++  const PRInt32 JS_OBJECT_CREATE           =  9;
++  const PRInt32 JS_OBJECT_RESIZE           = 10;
++  const PRInt32 JS_OBJECT_FINALIZE         = 11;
++  const PRInt32 JS_STRING_CREATE           = 12;
++  const PRInt32 JS_STRING_FINALIZE         = 13;
++  const PRInt32 JS_WILL_COMPILE_SCRIPT     = 14;
++  const PRInt32 JS_DID_COMPILE_SCRIPT      = 15;
++  const PRInt32 JS_WILL_CALL_NATIVE        = 16;
++  const PRInt32 JS_DID_CALL_NATIVE         = 17;
++  const PRInt32 JS_ACQUIRE_MEMORY          = 18;
++  const PRInt32 JS_RELEASE_MEMORY          = 19;
++  const PRInt32 COMPARTMENT_GC_DID_START   = 20;
++  const PRInt32 COMPARTMENT_GC_WILL_END    = 21;
++  const PRInt32 GLOBAL_GC_DID_START        = 22;
++  const PRInt32 GLOBAL_GC_WILL_END         = 23;
++  const PRInt32 GC_MARK_PHASE_START        = 24;
++  const PRInt32 GC_MARK_PHASE_END          = 25;
++  const PRInt32 GC_SWEEP_PHASE_START       = 26;
++  const PRInt32 GC_SWEEP_PHASE_END         = 27;
+ 
+   /**
+    * Add a handler that should execute whenever the specified probe is fired.