Bug 812393 - Sweep strings and scripts incrementally (r=jonco)

--HG--
extra : rebase_source : 301b3029444d378bcb90e7140b508f6f35187425
This commit is contained in:
Bill McCloskey 2012-11-16 11:08:32 -08:00
parent 63feebb7e0
commit 6fd6b3f8f7

View File

@ -213,6 +213,14 @@ const uint32_t Arena::FirstThingOffsets[] = {
* Finalization order for incrementally swept things. * Finalization order for incrementally swept things.
*/ */
static const AllocKind FinalizePhaseStrings[] = {
FINALIZE_EXTERNAL_STRING
};
static const AllocKind FinalizePhaseScripts[] = {
FINALIZE_SCRIPT
};
static const AllocKind FinalizePhaseShapes[] = { static const AllocKind FinalizePhaseShapes[] = {
FINALIZE_SHAPE, FINALIZE_SHAPE,
FINALIZE_BASE_SHAPE, FINALIZE_BASE_SHAPE,
@ -220,15 +228,21 @@ static const AllocKind FinalizePhaseShapes[] = {
}; };
static const AllocKind* FinalizePhases[] = { static const AllocKind* FinalizePhases[] = {
FinalizePhaseStrings,
FinalizePhaseScripts,
FinalizePhaseShapes FinalizePhaseShapes
}; };
static const int FinalizePhaseCount = sizeof(FinalizePhases) / sizeof(AllocKind*); static const int FinalizePhaseCount = sizeof(FinalizePhases) / sizeof(AllocKind*);
static const int FinalizePhaseLength[] = { static const int FinalizePhaseLength[] = {
sizeof(FinalizePhaseStrings) / sizeof(AllocKind),
sizeof(FinalizePhaseScripts) / sizeof(AllocKind),
sizeof(FinalizePhaseShapes) / sizeof(AllocKind) sizeof(FinalizePhaseShapes) / sizeof(AllocKind)
}; };
static const gcstats::Phase FinalizePhaseStatsPhase[] = { static const gcstats::Phase FinalizePhaseStatsPhase[] = {
gcstats::PHASE_SWEEP_STRING,
gcstats::PHASE_SWEEP_SCRIPT,
gcstats::PHASE_SWEEP_SHAPE gcstats::PHASE_SWEEP_SHAPE
}; };
@ -1703,14 +1717,14 @@ ArenaLists::queueStringsForSweep(FreeOp *fop)
queueForBackgroundSweep(fop, FINALIZE_SHORT_STRING); queueForBackgroundSweep(fop, FINALIZE_SHORT_STRING);
queueForBackgroundSweep(fop, FINALIZE_STRING); queueForBackgroundSweep(fop, FINALIZE_STRING);
finalizeNow(fop, FINALIZE_EXTERNAL_STRING); queueForForegroundSweep(fop, FINALIZE_EXTERNAL_STRING);
} }
void void
ArenaLists::queueScriptsForSweep(FreeOp *fop) ArenaLists::queueScriptsForSweep(FreeOp *fop)
{ {
gcstats::AutoPhase ap(fop->runtime()->gcStats, gcstats::PHASE_SWEEP_SCRIPT); gcstats::AutoPhase ap(fop->runtime()->gcStats, gcstats::PHASE_SWEEP_SCRIPT);
finalizeNow(fop, FINALIZE_SCRIPT); queueForForegroundSweep(fop, FINALIZE_SCRIPT);
} }
void void