Commit 46beb691 authored by Wan-Teh Chang's avatar Wan-Teh Chang
Browse files

Merge mozilla-inbound and my changes

parents 5865ef3d 7a6d0e3a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1475,6 +1475,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGlobalWindow)
    cb.NoteNativeChild(timeout, &NS_CYCLE_COLLECTION_NAME(nsTimeout));
  }

  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLocalStorage)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSessionStorage)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mApplicationCache)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocumentPrincipal)
@@ -1512,6 +1513,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
    tmp->mListenerManager->Disconnect();
    NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mListenerManager)
  }
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mLocalStorage)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mSessionStorage)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mApplicationCache)
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDocumentPrincipal)
+1 −3
Original line number Diff line number Diff line
@@ -915,7 +915,6 @@ static const char js_relimit_option_str[]= JS_OPTIONS_DOT_STR "relimit";
#ifdef JS_GC_ZEAL
static const char js_zeal_option_str[]        = JS_OPTIONS_DOT_STR "gczeal";
static const char js_zeal_frequency_str[]     = JS_OPTIONS_DOT_STR "gczeal.frequency";
static const char js_zeal_compartment_str[]   = JS_OPTIONS_DOT_STR "gczeal.compartment_gc";
#endif
static const char js_methodjit_content_str[]  = JS_OPTIONS_DOT_STR "methodjit.content";
static const char js_methodjit_chrome_str[]   = JS_OPTIONS_DOT_STR "methodjit.chrome";
@@ -1022,9 +1021,8 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
#ifdef JS_GC_ZEAL
  PRInt32 zeal = Preferences::GetInt(js_zeal_option_str, -1);
  PRInt32 frequency = Preferences::GetInt(js_zeal_frequency_str, JS_DEFAULT_ZEAL_FREQ);
  bool compartment = Preferences::GetBool(js_zeal_compartment_str, false);
  if (zeal >= 0)
    ::JS_SetGCZeal(context->mContext, (PRUint8)zeal, frequency, compartment);
    ::JS_SetGCZeal(context->mContext, (PRUint8)zeal, frequency);
#endif

  return 0;
+1 −1
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ CreateJSContextForWorker(WorkerPrivate* aWorkerPrivate)
    NS_ASSERTION(zeal <= 3, "Bad zeal value!");

    PRUint32 frequency = zeal <= 2 ? JS_DEFAULT_ZEAL_FREQ : 1;
    JS_SetGCZeal(workerCx, zeal, frequency, false);
    JS_SetGCZeal(workerCx, zeal, frequency);
  }
#endif

+2 −1
Original line number Diff line number Diff line
@@ -3877,7 +3877,7 @@ WorkerPrivate::UpdateGCZealInternal(JSContext* aCx, PRUint8 aGCZeal)
  AssertIsOnWorkerThread();

  PRUint32 frequency = aGCZeal <= 2 ? JS_DEFAULT_ZEAL_FREQ : 1;
  JS_SetGCZeal(aCx, aGCZeal, frequency, false);
  JS_SetGCZeal(aCx, aGCZeal, frequency);

  for (PRUint32 index = 0; index < mChildWorkers.Length(); index++) {
    mChildWorkers[index]->UpdateGCZeal(aCx, aGCZeal);
@@ -3891,6 +3891,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
{
  AssertIsOnWorkerThread();

  js::PrepareForFullGC(JS_GetRuntime(aCx));
  if (aShrinking) {
    js::ShrinkingGC(aCx, js::gcreason::DOM_WORKER);
  }
+1 −1
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ GCZeal(JSContext *cx,
  if (!JS_ValueToECMAUint32(cx, argv[0], &zeal))
    return JS_FALSE;

  JS_SetGCZeal(cx, PRUint8(zeal), JS_DEFAULT_ZEAL_FREQ, JS_FALSE);
  JS_SetGCZeal(cx, PRUint8(zeal), JS_DEFAULT_ZEAL_FREQ);
  return JS_TRUE;
}
#endif
Loading