Default new contexts to a NULL compartment (bug 623800, r=dmandelin).
authorAndreas Gal <gal@mozilla.com>
Thu, 13 Jan 2011 14:11:15 -0800
changeset 60583 57896fa8bb787db9d341c8939f65e1403f5da75d
parent 60582 c8cb1ab7612aeef4da89d843601073e941dfa6ec
child 60584 c2da7ca610ba865924e336afd562a9527b84265c
push id18037
push usercleary@mozilla.com
push dateFri, 14 Jan 2011 17:42:55 +0000
treeherdermozilla-central@4e0501a0c5e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmandelin
bugs623800
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Default new contexts to a NULL compartment (bug 623800, r=dmandelin).
js/src/jscntxt.cpp
js/src/jstracer.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -1987,17 +1987,17 @@ DSTOffsetCache::purge()
  */
 DSTOffsetCache::DSTOffsetCache()
 {
     purge();
 }
 
 JSContext::JSContext(JSRuntime *rt)
   : runtime(rt),
-    compartment(rt->defaultCompartment),
+    compartment(NULL),
     regs(NULL),
     busyArrays(thisInInitializer())
 {}
 
 void
 JSContext::resetCompartment()
 {
     JSObject *scopeobj;
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -7584,20 +7584,16 @@ disable_debugger_exceptions() { }
 
 #define K *1024
 #define M K K
 #define G K M
 
 void
 SetMaxCodeCacheBytes(JSContext* cx, uint32 bytes)
 {
-#ifdef DEBUG
-    TraceMonitor* tm = &JS_TRACE_MONITOR(cx);
-    JS_ASSERT(tm->codeAlloc && tm->dataAlloc && tm->traceAlloc);
-#endif
     if (bytes > 1 G)
         bytes = 1 G;
     if (bytes < 128 K)
         bytes = 128 K;
     JS_THREAD_DATA(cx)->maxCodeCacheBytes = bytes;
 }
 
 bool