Decouple jscntxt.h from jstracer.h so that xpconnect doesn't try to include all of
authorshaver@mozilla.org
Thu, 10 Jul 2008 17:29:16 -0400
changeset 17583 584d2a3dbb9c0691471eb9cf1d2f8e7e3a66bbf9
parent 17582 7f92daca9d4b07f5b93c35541ceb2e52ad0670c2
child 17584 abf6ecb322d18005e3bce34c6e302919a3241784
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherdermozilla-central@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Decouple jscntxt.h from jstracer.h so that xpconnect doesn't try to include all of nanojit.
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jstracer.h
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -59,16 +59,17 @@
 #include "jslock.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsscan.h"
 #include "jsscope.h"
 #include "jsscript.h"
 #include "jsstr.h"
+#include "jstracer.h"
 
 #ifdef JS_THREADSAFE
 #include "prtypes.h"
 
 /*
  * The index for JSThread info, returned by PR_NewThreadPrivateIndex.  The
  * index value is visible and shared by all threads, but the data associated
  * with it is private to each thread.
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -51,17 +51,16 @@
 #include "jsdhash.h"
 #include "jsgc.h"
 #include "jsinterp.h"
 #include "jsobj.h"
 #include "jsprvtd.h"
 #include "jspubtd.h"
 #include "jsregexp.h"
 #include "jsutil.h"
-#include "jstracer.h"
 
 JS_BEGIN_EXTERN_C
 
 /*
  * js_GetSrcNote cache to avoid O(n^2) growth in finding a source note for a
  * given pc in a script. We use the script->code pointer to tag the cache,
  * instead of the script address itself, so that source notes are always found
  * by offset from the bytecode with which they were generated.
@@ -89,16 +88,31 @@ typedef struct JSGSNCache {
         }                                                                     \
         GSN_CACHE_METER(cache, clears);                                       \
     JS_END_MACRO
 
 /* These helper macros take a cx as parameter and operate on its GSN cache. */
 #define JS_CLEAR_GSN_CACHE(cx)      GSN_CACHE_CLEAR(&JS_GSN_CACHE(cx))
 #define JS_METER_GSN_CACHE(cx,cnt)  GSN_CACHE_METER(&JS_GSN_CACHE(cx), cnt)
 
+namespace nanojit {
+    class Fragmento;
+}
+class TraceRecorder;
+
+/*
+ * Trace monitor. Every JSThread (if JS_THREADSAFE) or JSRuntime (if not
+ * JS_THREADSAFE) has an associated trace monitor that keeps track of loop
+ * frequencies for all JavaScript code loaded into that runtime.
+ */
+struct JSTraceMonitor {
+    nanojit::Fragmento*     fragmento;
+    TraceRecorder*          recorder;
+};
+
 #ifdef JS_THREADSAFE
 
 /*
  * Structure uniquely representing a thread.  It holds thread-private data
  * that can be accessed without a global lock.
  */
 struct JSThread {
     /* Linked list of all contexts active on this thread. */
--- a/js/src/jstracer.h
+++ b/js/src/jstracer.h
@@ -208,26 +208,16 @@ public:
     void stop();
 
 #define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format)               \
     bool op();
 # include "jsopcode.tbl"
 #undef OPDEF
 };
 
-/*
- * Trace monitor. Every JSThread (if JS_THREADSAFE) or JSRuntime (if not
- * JS_THREADSAFE) has an associated trace monitor that keeps track of loop
- * frequencies for all JavaScript code loaded into that runtime.
- */
-struct JSTraceMonitor {
-    nanojit::Fragmento*     fragmento;
-    TraceRecorder*          recorder;
-};
-
 #define TRACING_ENABLED(cx)       JS_HAS_OPTION(cx, JSOPTION_JIT)
 
 extern bool
 js_LoopEdge(JSContext* cx);
 
 extern void
 js_AbortRecording(JSContext* cx, const char* reason);