Loading embedding/android/GeckoSurfaceView.java +2 −2 Original line number Diff line number Diff line Loading @@ -121,8 +121,8 @@ class GeckoSurfaceView Resources res = getResources(); File filesDir = new File(GeckoApp.sGREDir, "files"); if (filesDir.exists() == false) { File watchDir = new File(GeckoApp.sGREDir, "components"); if (watchDir.exists() == false) { // Just show the simple splash screen for "new profile" startup c.drawColor(res.getColor(R.color.splash_background)); Drawable drawable = res.getDrawable(R.drawable.splash); Loading js/src/jsapi.cpp +91 −4 Original line number Diff line number Diff line Loading @@ -636,11 +636,99 @@ JS_IsBuiltinFunctionConstructor(JSFunction *fun) static JSBool js_NewRuntimeWasCalled = JS_FALSE; JSRuntime::JSRuntime() : trustedPrincipals_(NULL) : atomsCompartment(NULL), #ifdef JS_THREADSAFE atomsCompartmentIsLocked(false), #endif state(), cxCallback(NULL), compartmentCallback(NULL), activityCallback(NULL), activityCallbackArg(NULL), protoHazardShape(0), gcSystemAvailableChunkListHead(NULL), gcUserAvailableChunkListHead(NULL), gcEmptyChunkListHead(NULL), gcEmptyChunkCount(0), gcKeepAtoms(0), gcBytes(0), gcTriggerBytes(0), gcLastBytes(0), gcMaxBytes(0), gcMaxMallocBytes(0), gcEmptyArenaPoolLifespan(0), gcNumber(0), gcMarkingTracer(NULL), gcChunkAllocationSinceLastGC(false), gcNextFullGCTime(0), gcJitReleaseTime(0), gcMode(JSGC_MODE_GLOBAL), gcIsNeeded(0), gcWeakMapList(NULL), gcTriggerCompartment(NULL), gcCurrentCompartment(NULL), gcCheckCompartment(NULL), gcPoke(false), gcMarkAndSweep(false), gcRunning(false), gcRegenShapes(false), #ifdef JS_GC_ZEAL gcZeal_(0), gcZealFrequency(0), gcNextScheduled(0), gcDebugCompartmentGC(false), #endif gcCallback(NULL), gcMallocBytes(0), gcExtraRootsTraceOp(NULL), gcExtraRootsData(NULL), NaNValue(UndefinedValue()), negativeInfinityValue(UndefinedValue()), positiveInfinityValue(UndefinedValue()), emptyString(NULL), debugMode(false), hadOutOfMemory(false), data(NULL), #ifdef JS_THREADSAFE gcLock(NULL), gcDone(NULL), requestDone(NULL), requestCount(0), gcThread(NULL), rtLock(NULL), # ifdef DEBUG rtLockOwner(0), # endif stateChange(NULL), #endif debuggerMutations(0), securityCallbacks(NULL), structuredCloneCallbacks(NULL), propertyRemovals(0), scriptFilenameTable(NULL), #ifdef JS_THREADSAFE scriptFilenameTableLock(NULL), #endif thousandsSeparator(0), decimalSeparator(0), numGrouping(0), anynameObject(NULL), functionNamespaceObject(NULL), #ifdef JS_THREADSAFE interruptCounter(0), #endif trustedPrincipals_(NULL), shapeGen(0), wrapObjectCallback(NULL), preWrapObjectCallback(NULL), inOOMReport(0) { /* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */ JS_INIT_CLIST(&contextList); JS_INIT_CLIST(&debuggerList); PodZero(&globalDebugHooks); PodZero(&atomState); } bool Loading Loading @@ -769,11 +857,10 @@ JS_NewRuntime(uint32 maxbytes) js_NewRuntimeWasCalled = JS_TRUE; } void *mem = OffTheBooks::calloc_(sizeof(JSRuntime)); if (!mem) JSRuntime *rt = OffTheBooks::new_<JSRuntime>(); if (!rt) return NULL; JSRuntime *rt = new (mem) JSRuntime(); if (!rt->init(maxbytes)) { JS_DestroyRuntime(rt); return NULL; Loading js/src/jscntxt.cpp +63 −22 Original line number Diff line number Diff line Loading @@ -319,31 +319,18 @@ js_PurgeThreads(JSContext *cx) JSContext * js_NewContext(JSRuntime *rt, size_t stackChunkSize) { JSContext *cx; JSBool first; JSContextCallback cxCallback; /* * We need to initialize the new context fully before adding it to the * runtime list. After that it can be accessed from another thread via * js_ContextIterator. */ void *mem = OffTheBooks::calloc_(sizeof *cx); if (!mem) JSContext *cx = OffTheBooks::new_<JSContext>(rt); if (!cx) return NULL; cx = new (mem) JSContext(rt); cx->debugHooks = &rt->globalDebugHooks; #if JS_STACK_GROWTH_DIRECTION > 0 cx->stackLimit = (jsuword) -1; #endif cx->iterValue.setMagic(JS_NO_ITER_VALUE); JS_STATIC_ASSERT(JSVERSION_DEFAULT == 0); JS_ASSERT(cx->findVersion() == JSVERSION_DEFAULT); VOUCH_DOES_NOT_REQUIRE_STACK(); JS_ASSERT(cx->resolveFlags == 0); if (!cx->busyArrays.init()) { Foreground::delete_(cx); return NULL; Loading @@ -360,15 +347,16 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize) * Here the GC lock is still held after js_InitContextThreadAndLockGC took it and * the GC is not running on another thread. */ bool first; for (;;) { if (rt->state == JSRTS_UP) { JS_ASSERT(!JS_CLIST_IS_EMPTY(&rt->contextList)); first = JS_FALSE; first = false; break; } if (rt->state == JSRTS_DOWN) { JS_ASSERT(JS_CLIST_IS_EMPTY(&rt->contextList)); first = JS_TRUE; first = true; rt->state = JSRTS_LAUNCHING; break; } Loading Loading @@ -417,7 +405,7 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize) JS_NOTIFY_ALL_CONDVAR(rt->stateChange); } cxCallback = rt->cxCallback; JSContextCallback cxCallback = rt->cxCallback; if (cxCallback && !cxCallback(cx, JSCONTEXT_NEW)) { js_DestroyContext(cx, JSDCM_NEW_FAILED); return NULL; Loading Loading @@ -1346,15 +1334,68 @@ DSTOffsetCache::DSTOffsetCache() } JSContext::JSContext(JSRuntime *rt) : hasVersionOverride(false), : defaultVersion(JSVERSION_DEFAULT), hasVersionOverride(false), throwing(false), exception(UndefinedValue()), runOptions(0), localeCallbacks(NULL), resolvingList(NULL), generatingError(false), #if JS_STACK_GROWTH_DIRECTION > 0 stackLimit((jsuword)-1), #else stackLimit(0), #endif runtime(rt), compartment(NULL), stack(thisDuringConstruction()), busyArrays() #ifdef JS_THREADSAFE thread_(NULL), #endif stack(thisDuringConstruction()), /* depends on cx->thread_ */ parseMapPool_(NULL), globalObject(NULL), argumentFormatMap(NULL), lastMessage(NULL), errorReporter(NULL), operationCallback(NULL), data(NULL), data2(NULL), #ifdef JS_THREADSAFE outstandingRequests(0), #endif autoGCRooters(NULL), debugHooks(&rt->globalDebugHooks), securityCallbacks(NULL), resolveFlags(0), rngSeed(0), iterValue(MagicValue(JS_NO_ITER_VALUE)), #ifdef JS_TRACER traceJitEnabled(false), #endif #ifdef JS_METHODJIT methodJitEnabled(false), profilingEnabled(false), #endif inferenceEnabled(false), #ifdef MOZ_TRACE_JSCALLS functionCallback(NULL), #endif enumerators(NULL), #ifdef JS_THREADSAFE gcBackgroundFree(NULL), #endif activeCompilations(0) #ifdef DEBUG , stackIterAssertionEnabled(true) #endif {} { PodZero(&sharpObjectMap); PodZero(&link); #ifdef JS_THREADSAFE PodZero(&threadLinks); #endif } JSContext::~JSContext() { Loading js/src/jscntxt.h +21 −8 Original line number Diff line number Diff line Loading @@ -676,6 +676,17 @@ struct JSRuntime { #if defined(MOZ_GCTIMER) || defined(JSGC_TESTPILOT) struct GCData { GCData() : firstEnter(0), firstEnterValid(false) #ifdef JSGC_TESTPILOT , infoEnabled(false), info(), start(0), count(0) #endif { } /* * Timestamp of the first GCTimer -- application runtime is determined * relative to this value. Loading Loading @@ -983,6 +994,16 @@ struct JSContext inline void setCompartment(JSCompartment *compartment); #ifdef JS_THREADSAFE private: JSThread *thread_; public: JSThread *thread() const { return thread_; } void setThread(JSThread *thread); static const size_t threadOffset() { return offsetof(JSContext, thread_); } #endif /* Current execution stack. */ js::ContextStack stack; Loading Loading @@ -1147,14 +1168,6 @@ struct JSContext inline js::LifoAlloc &typeLifoAlloc(); #ifdef JS_THREADSAFE private: JSThread *thread_; public: JSThread *thread() const { return thread_; } void setThread(JSThread *thread); static const size_t threadOffset() { return offsetof(JSContext, thread_); } unsigned outstandingRequests;/* number of JS_BeginRequest calls without the corresponding JS_EndRequest. */ Loading js/src/jsutil.h +14 −1 Original line number Diff line number Diff line Loading @@ -835,7 +835,20 @@ class MoveRef { explicit MoveRef(T &t) : pointer(&t) { } T &operator*() const { return *pointer; } T *operator->() const { return pointer; } #ifdef __GXX_EXPERIMENTAL_CXX0X__ /* * If MoveRef is used in a rvalue position (which is expected), we can * end up in a situation where, without this ifdef, we would try to pass * a T& to a move constructor, which fails. It is not clear if the compiler * should instead use the copy constructor, but for now this lets us build * with clang. See bug 689066 and llvm.org/pr11003 for the details. * Note: We can probably remove MoveRef completely once we are comfortable * using c++11. */ operator T&& () const { return static_cast<T&&>(*pointer); } #else operator T& () const { return *pointer; } #endif private: T *pointer; }; Loading Loading
embedding/android/GeckoSurfaceView.java +2 −2 Original line number Diff line number Diff line Loading @@ -121,8 +121,8 @@ class GeckoSurfaceView Resources res = getResources(); File filesDir = new File(GeckoApp.sGREDir, "files"); if (filesDir.exists() == false) { File watchDir = new File(GeckoApp.sGREDir, "components"); if (watchDir.exists() == false) { // Just show the simple splash screen for "new profile" startup c.drawColor(res.getColor(R.color.splash_background)); Drawable drawable = res.getDrawable(R.drawable.splash); Loading
js/src/jsapi.cpp +91 −4 Original line number Diff line number Diff line Loading @@ -636,11 +636,99 @@ JS_IsBuiltinFunctionConstructor(JSFunction *fun) static JSBool js_NewRuntimeWasCalled = JS_FALSE; JSRuntime::JSRuntime() : trustedPrincipals_(NULL) : atomsCompartment(NULL), #ifdef JS_THREADSAFE atomsCompartmentIsLocked(false), #endif state(), cxCallback(NULL), compartmentCallback(NULL), activityCallback(NULL), activityCallbackArg(NULL), protoHazardShape(0), gcSystemAvailableChunkListHead(NULL), gcUserAvailableChunkListHead(NULL), gcEmptyChunkListHead(NULL), gcEmptyChunkCount(0), gcKeepAtoms(0), gcBytes(0), gcTriggerBytes(0), gcLastBytes(0), gcMaxBytes(0), gcMaxMallocBytes(0), gcEmptyArenaPoolLifespan(0), gcNumber(0), gcMarkingTracer(NULL), gcChunkAllocationSinceLastGC(false), gcNextFullGCTime(0), gcJitReleaseTime(0), gcMode(JSGC_MODE_GLOBAL), gcIsNeeded(0), gcWeakMapList(NULL), gcTriggerCompartment(NULL), gcCurrentCompartment(NULL), gcCheckCompartment(NULL), gcPoke(false), gcMarkAndSweep(false), gcRunning(false), gcRegenShapes(false), #ifdef JS_GC_ZEAL gcZeal_(0), gcZealFrequency(0), gcNextScheduled(0), gcDebugCompartmentGC(false), #endif gcCallback(NULL), gcMallocBytes(0), gcExtraRootsTraceOp(NULL), gcExtraRootsData(NULL), NaNValue(UndefinedValue()), negativeInfinityValue(UndefinedValue()), positiveInfinityValue(UndefinedValue()), emptyString(NULL), debugMode(false), hadOutOfMemory(false), data(NULL), #ifdef JS_THREADSAFE gcLock(NULL), gcDone(NULL), requestDone(NULL), requestCount(0), gcThread(NULL), rtLock(NULL), # ifdef DEBUG rtLockOwner(0), # endif stateChange(NULL), #endif debuggerMutations(0), securityCallbacks(NULL), structuredCloneCallbacks(NULL), propertyRemovals(0), scriptFilenameTable(NULL), #ifdef JS_THREADSAFE scriptFilenameTableLock(NULL), #endif thousandsSeparator(0), decimalSeparator(0), numGrouping(0), anynameObject(NULL), functionNamespaceObject(NULL), #ifdef JS_THREADSAFE interruptCounter(0), #endif trustedPrincipals_(NULL), shapeGen(0), wrapObjectCallback(NULL), preWrapObjectCallback(NULL), inOOMReport(0) { /* Initialize infallibly first, so we can goto bad and JS_DestroyRuntime. */ JS_INIT_CLIST(&contextList); JS_INIT_CLIST(&debuggerList); PodZero(&globalDebugHooks); PodZero(&atomState); } bool Loading Loading @@ -769,11 +857,10 @@ JS_NewRuntime(uint32 maxbytes) js_NewRuntimeWasCalled = JS_TRUE; } void *mem = OffTheBooks::calloc_(sizeof(JSRuntime)); if (!mem) JSRuntime *rt = OffTheBooks::new_<JSRuntime>(); if (!rt) return NULL; JSRuntime *rt = new (mem) JSRuntime(); if (!rt->init(maxbytes)) { JS_DestroyRuntime(rt); return NULL; Loading
js/src/jscntxt.cpp +63 −22 Original line number Diff line number Diff line Loading @@ -319,31 +319,18 @@ js_PurgeThreads(JSContext *cx) JSContext * js_NewContext(JSRuntime *rt, size_t stackChunkSize) { JSContext *cx; JSBool first; JSContextCallback cxCallback; /* * We need to initialize the new context fully before adding it to the * runtime list. After that it can be accessed from another thread via * js_ContextIterator. */ void *mem = OffTheBooks::calloc_(sizeof *cx); if (!mem) JSContext *cx = OffTheBooks::new_<JSContext>(rt); if (!cx) return NULL; cx = new (mem) JSContext(rt); cx->debugHooks = &rt->globalDebugHooks; #if JS_STACK_GROWTH_DIRECTION > 0 cx->stackLimit = (jsuword) -1; #endif cx->iterValue.setMagic(JS_NO_ITER_VALUE); JS_STATIC_ASSERT(JSVERSION_DEFAULT == 0); JS_ASSERT(cx->findVersion() == JSVERSION_DEFAULT); VOUCH_DOES_NOT_REQUIRE_STACK(); JS_ASSERT(cx->resolveFlags == 0); if (!cx->busyArrays.init()) { Foreground::delete_(cx); return NULL; Loading @@ -360,15 +347,16 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize) * Here the GC lock is still held after js_InitContextThreadAndLockGC took it and * the GC is not running on another thread. */ bool first; for (;;) { if (rt->state == JSRTS_UP) { JS_ASSERT(!JS_CLIST_IS_EMPTY(&rt->contextList)); first = JS_FALSE; first = false; break; } if (rt->state == JSRTS_DOWN) { JS_ASSERT(JS_CLIST_IS_EMPTY(&rt->contextList)); first = JS_TRUE; first = true; rt->state = JSRTS_LAUNCHING; break; } Loading Loading @@ -417,7 +405,7 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize) JS_NOTIFY_ALL_CONDVAR(rt->stateChange); } cxCallback = rt->cxCallback; JSContextCallback cxCallback = rt->cxCallback; if (cxCallback && !cxCallback(cx, JSCONTEXT_NEW)) { js_DestroyContext(cx, JSDCM_NEW_FAILED); return NULL; Loading Loading @@ -1346,15 +1334,68 @@ DSTOffsetCache::DSTOffsetCache() } JSContext::JSContext(JSRuntime *rt) : hasVersionOverride(false), : defaultVersion(JSVERSION_DEFAULT), hasVersionOverride(false), throwing(false), exception(UndefinedValue()), runOptions(0), localeCallbacks(NULL), resolvingList(NULL), generatingError(false), #if JS_STACK_GROWTH_DIRECTION > 0 stackLimit((jsuword)-1), #else stackLimit(0), #endif runtime(rt), compartment(NULL), stack(thisDuringConstruction()), busyArrays() #ifdef JS_THREADSAFE thread_(NULL), #endif stack(thisDuringConstruction()), /* depends on cx->thread_ */ parseMapPool_(NULL), globalObject(NULL), argumentFormatMap(NULL), lastMessage(NULL), errorReporter(NULL), operationCallback(NULL), data(NULL), data2(NULL), #ifdef JS_THREADSAFE outstandingRequests(0), #endif autoGCRooters(NULL), debugHooks(&rt->globalDebugHooks), securityCallbacks(NULL), resolveFlags(0), rngSeed(0), iterValue(MagicValue(JS_NO_ITER_VALUE)), #ifdef JS_TRACER traceJitEnabled(false), #endif #ifdef JS_METHODJIT methodJitEnabled(false), profilingEnabled(false), #endif inferenceEnabled(false), #ifdef MOZ_TRACE_JSCALLS functionCallback(NULL), #endif enumerators(NULL), #ifdef JS_THREADSAFE gcBackgroundFree(NULL), #endif activeCompilations(0) #ifdef DEBUG , stackIterAssertionEnabled(true) #endif {} { PodZero(&sharpObjectMap); PodZero(&link); #ifdef JS_THREADSAFE PodZero(&threadLinks); #endif } JSContext::~JSContext() { Loading
js/src/jscntxt.h +21 −8 Original line number Diff line number Diff line Loading @@ -676,6 +676,17 @@ struct JSRuntime { #if defined(MOZ_GCTIMER) || defined(JSGC_TESTPILOT) struct GCData { GCData() : firstEnter(0), firstEnterValid(false) #ifdef JSGC_TESTPILOT , infoEnabled(false), info(), start(0), count(0) #endif { } /* * Timestamp of the first GCTimer -- application runtime is determined * relative to this value. Loading Loading @@ -983,6 +994,16 @@ struct JSContext inline void setCompartment(JSCompartment *compartment); #ifdef JS_THREADSAFE private: JSThread *thread_; public: JSThread *thread() const { return thread_; } void setThread(JSThread *thread); static const size_t threadOffset() { return offsetof(JSContext, thread_); } #endif /* Current execution stack. */ js::ContextStack stack; Loading Loading @@ -1147,14 +1168,6 @@ struct JSContext inline js::LifoAlloc &typeLifoAlloc(); #ifdef JS_THREADSAFE private: JSThread *thread_; public: JSThread *thread() const { return thread_; } void setThread(JSThread *thread); static const size_t threadOffset() { return offsetof(JSContext, thread_); } unsigned outstandingRequests;/* number of JS_BeginRequest calls without the corresponding JS_EndRequest. */ Loading
js/src/jsutil.h +14 −1 Original line number Diff line number Diff line Loading @@ -835,7 +835,20 @@ class MoveRef { explicit MoveRef(T &t) : pointer(&t) { } T &operator*() const { return *pointer; } T *operator->() const { return pointer; } #ifdef __GXX_EXPERIMENTAL_CXX0X__ /* * If MoveRef is used in a rvalue position (which is expected), we can * end up in a situation where, without this ifdef, we would try to pass * a T& to a move constructor, which fails. It is not clear if the compiler * should instead use the copy constructor, but for now this lets us build * with clang. See bug 689066 and llvm.org/pr11003 for the details. * Note: We can probably remove MoveRef completely once we are comfortable * using c++11. */ operator T&& () const { return static_cast<T&&>(*pointer); } #else operator T& () const { return *pointer; } #endif private: T *pointer; }; Loading