Bug 1064578 - Part 4: remove the arbitrary phase distinction we make for tables; r=jonco

--HG--
extra : rebase_source : 6116163ca5f6ca9a3eccddf434c9782fc457094c
This commit is contained in:
Terrence Cole 2014-09-22 11:47:53 -07:00
Родитель 1e308472a9
Коммит d8b71ddee4
6 изменённых файлов: 72 добавлений и 40 удалений

Просмотреть файл

@ -292,14 +292,14 @@ static const PhaseInfo phases[] = {
{ PHASE_SWEEP_SYMBOL_REGISTRY, "Sweep Symbol Registry", PHASE_SWEEP },
{ PHASE_SWEEP_COMPARTMENTS, "Sweep Compartments", PHASE_SWEEP },
{ PHASE_SWEEP_DISCARD_CODE, "Sweep Discard Code", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_TABLES, "Sweep Tables", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_TABLES_INNER_VIEWS, "Sweep Inner Views", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_WRAPPER, "Sweep Cross Compartment Wrappers", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_BASE_SHAPE, "Sweep Base Shapes", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_INITIAL_SHAPE, "Sweep Initial Shapes", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_TYPE_OBJECT, "Sweep Type Objects", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_BREAKPOINT, "Sweep Breakpoints", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_TABLES_REGEXP, "Sweep Regexps", PHASE_SWEEP_TABLES },
{ PHASE_SWEEP_INNER_VIEWS, "Sweep Inner Views", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_CC_WRAPPER, "Sweep Cross Compartment Wrappers", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_BASE_SHAPE, "Sweep Base Shapes", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_INITIAL_SHAPE, "Sweep Initial Shapes", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_TYPE_OBJECT, "Sweep Type Objects", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_BREAKPOINT, "Sweep Breakpoints", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_REGEXP, "Sweep Regexps", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_SWEEP_MISC, "Sweep Miscellaneous", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_DISCARD_ANALYSIS, "Discard Analysis", PHASE_SWEEP_COMPARTMENTS },
{ PHASE_DISCARD_TI, "Discard TI", PHASE_DISCARD_ANALYSIS },
{ PHASE_FREE_TI_ARENA, "Free TI Arena", PHASE_DISCARD_ANALYSIS },

Просмотреть файл

@ -43,14 +43,14 @@ enum Phase {
PHASE_SWEEP_SYMBOL_REGISTRY,
PHASE_SWEEP_COMPARTMENTS,
PHASE_SWEEP_DISCARD_CODE,
PHASE_SWEEP_TABLES,
PHASE_SWEEP_TABLES_INNER_VIEWS,
PHASE_SWEEP_TABLES_WRAPPER,
PHASE_SWEEP_TABLES_BASE_SHAPE,
PHASE_SWEEP_TABLES_INITIAL_SHAPE,
PHASE_SWEEP_TABLES_TYPE_OBJECT,
PHASE_SWEEP_TABLES_BREAKPOINT,
PHASE_SWEEP_TABLES_REGEXP,
PHASE_SWEEP_INNER_VIEWS,
PHASE_SWEEP_CC_WRAPPER,
PHASE_SWEEP_BASE_SHAPE,
PHASE_SWEEP_INITIAL_SHAPE,
PHASE_SWEEP_TYPE_OBJECT,
PHASE_SWEEP_BREAKPOINT,
PHASE_SWEEP_REGEXP,
PHASE_SWEEP_MISC,
PHASE_DISCARD_ANALYSIS,
PHASE_DISCARD_TI,
PHASE_FREE_TI_ARENA,

Просмотреть файл

@ -122,10 +122,8 @@ Zone::sweep(FreeOp *fop, bool releaseTypes, bool *oom)
}
if (!fop->runtime()->debuggerList.isEmpty()) {
gcstats::MaybeAutoPhase ap1(gc.stats, !gc.isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES);
gcstats::MaybeAutoPhase ap2(gc.stats, !gc.isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_BREAKPOINT);
gcstats::PHASE_SWEEP_BREAKPOINT);
sweepBreakpoints(fop);
}
}

Просмотреть файл

@ -544,18 +544,12 @@ JSCompartment::markRoots(JSTracer *trc)
void
JSCompartment::sweepInnerViews()
{
JSRuntime *rt = runtimeFromMainThread();
gcstats::MaybeAutoPhase ap(rt->gc.stats, !rt->isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_INNER_VIEWS);
innerViews.sweep(rt);
innerViews.sweep(runtimeFromMainThread());
}
void
JSCompartment::sweepTypeObjectTables()
{
JSRuntime *rt = runtimeFromMainThread();
gcstats::MaybeAutoPhase ap(rt->gc.stats, !rt->isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_TYPE_OBJECT);
sweepNewTypeObjectTable(newTypeObjects);
sweepNewTypeObjectTable(lazyTypeObjects);
}
@ -641,10 +635,6 @@ JSCompartment::sweepNativeIterators()
void
JSCompartment::sweepCrossCompartmentWrappers()
{
JSRuntime *rt = runtimeFromMainThread();
gcstats::MaybeAutoPhase ap(rt->gc.stats, !rt->isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_WRAPPER);
/* Remove dead wrappers from the table. */
for (WrapperMap::Enum e(crossCompartmentWrappers); !e.empty(); e.popFront()) {
CrossCompartmentKey key = e.front().key();

Просмотреть файл

@ -4663,14 +4663,65 @@ GCRuntime::beginSweepingZoneGroup()
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::AutoPhase apst(stats, gcstats::PHASE_SWEEP_TABLES);
gcstats::MaybeAutoPhase apiv(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_INNER_VIEWS);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepInnerViews();
}
}
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::MaybeAutoPhase apccw(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_CC_WRAPPER);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepCrossCompartmentWrappers();
}
}
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::MaybeAutoPhase apbs(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_BASE_SHAPE);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepBaseShapeTable();
}
}
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::MaybeAutoPhase apis(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_INITIAL_SHAPE);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepInitialShapeTable();
}
}
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::MaybeAutoPhase apto(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_TYPE_OBJECT);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepTypeObjectTables();
}
}
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::MaybeAutoPhase apre(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_REGEXP);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepRegExps();
}
}
@ -4678,7 +4729,8 @@ GCRuntime::beginSweepingZoneGroup()
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_SWEEP_COMPARTMENTS);
gcstats::AutoSCC scc(stats, zoneGroupIndex);
gcstats::AutoPhase apst(stats, gcstats::PHASE_SWEEP_TABLES);
gcstats::MaybeAutoPhase apmisc(stats, !isHeapCompacting(),
gcstats::PHASE_SWEEP_MISC);
for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) {
c->sweepCallsiteClones();

Просмотреть файл

@ -1545,10 +1545,6 @@ BaseShape::assertConsistency()
void
JSCompartment::sweepBaseShapeTable()
{
GCRuntime &gc = runtimeFromMainThread()->gc;
gcstats::MaybeAutoPhase ap(gc.stats, !gc.isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_BASE_SHAPE);
if (baseShapes.initialized()) {
for (BaseShapeSet::Enum e(baseShapes); !e.empty(); e.popFront()) {
UnownedBaseShape *base = e.front().unbarrieredGet();
@ -1843,10 +1839,6 @@ EmptyShape::insertInitialShape(ExclusiveContext *cx, HandleShape shape, HandleOb
void
JSCompartment::sweepInitialShapeTable()
{
GCRuntime &gc = runtimeFromMainThread()->gc;
gcstats::MaybeAutoPhase ap(gc.stats, !gc.isHeapCompacting(),
gcstats::PHASE_SWEEP_TABLES_INITIAL_SHAPE);
if (initialShapes.initialized()) {
for (InitialShapeSet::Enum e(initialShapes); !e.empty(); e.popFront()) {
const InitialShapeEntry &entry = e.front();