Bug 1214961 - Sweep XPConnect incrementally; r=mccr8, r=jonco
This patch splits up the "wrapped-js" table by compartment in order to allow us to visit the miminal number of wrapped-js in each GC sweeping slice, instead of visiting the entire table repeatedly. This dramatically reduces our sweeping overhead, reducing the number of GC slices, and making them more likely to fall within budget.
This commit is contained in:
@@ -21,7 +21,7 @@ using namespace mozilla::jsipc;
|
||||
using mozilla::AutoSafeJSContext;
|
||||
|
||||
static void
|
||||
UpdateChildWeakPointersAfterGC(JSRuntime* rt, void* data)
|
||||
UpdateChildWeakPointersBeforeSweepingZoneGroup(JSRuntime* rt, void* data)
|
||||
{
|
||||
static_cast<JavaScriptChild*>(data)->updateWeakPointers();
|
||||
}
|
||||
@@ -34,7 +34,7 @@ JavaScriptChild::JavaScriptChild(JSRuntime* rt)
|
||||
|
||||
JavaScriptChild::~JavaScriptChild()
|
||||
{
|
||||
JS_RemoveWeakPointerCallback(rt_, UpdateChildWeakPointersAfterGC);
|
||||
JS_RemoveWeakPointerZoneGroupCallback(rt_, UpdateChildWeakPointersBeforeSweepingZoneGroup);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -45,7 +45,7 @@ JavaScriptChild::init()
|
||||
if (!WrapperAnswer::init())
|
||||
return false;
|
||||
|
||||
JS_AddWeakPointerCallback(rt_, UpdateChildWeakPointersAfterGC, this);
|
||||
JS_AddWeakPointerZoneGroupCallback(rt_, UpdateChildWeakPointersBeforeSweepingZoneGroup, this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user