[heap] Add timer scopes to process weak cells and clear non-live references.

BUG=

Review URL: https://codereview.chromium.org/1345273004

Cr-Commit-Position: refs/heads/master@{#30848}
This commit is contained in:
hpayer 2015-09-21 06:16:21 -07:00 committed by Commit bot
parent 704e3d809b
commit efc3fa02b0
3 changed files with 8 additions and 0 deletions

View File

@ -450,6 +450,9 @@ void GCTracer::PrintNVP() const {
current_.scopes[Scope::MC_WEAKCOLLECTION_CLEAR]);
PrintF("weakcollection_abort=%.1f ",
current_.scopes[Scope::MC_WEAKCOLLECTION_ABORT]);
PrintF("weakcells=%.1f ", current_.scopes[Scope::MC_WEAKCELL]);
PrintF("nonlive_refs=%.1f ",
current_.scopes[Scope::MC_NONLIVEREFERENCES]);
PrintF("steps_count=%d ", current_.incremental_marking_steps);
PrintF("steps_took=%.1f ", current_.incremental_marking_duration);

View File

@ -117,6 +117,8 @@ class GCTracer {
MC_WEAKCOLLECTION_PROCESS,
MC_WEAKCOLLECTION_CLEAR,
MC_WEAKCOLLECTION_ABORT,
MC_WEAKCELL,
MC_NONLIVEREFERENCES,
MC_FLUSH_CODE,
SCAVENGER_CODE_FLUSH_CANDIDATES,
SCAVENGER_OBJECT_GROUPS,

View File

@ -2216,6 +2216,8 @@ void MarkCompactCollector::AfterMarking() {
void MarkCompactCollector::ClearNonLiveReferences() {
GCTracer::Scope gc_scope(heap()->tracer(),
GCTracer::Scope::MC_NONLIVEREFERENCES);
// Iterate over the map space, setting map transitions that go from
// a marked map to an unmarked map to null transitions. This action
// is carried out only on maps of JSObjects and related subtypes.
@ -2509,6 +2511,7 @@ void MarkCompactCollector::AbortWeakCollections() {
void MarkCompactCollector::ProcessAndClearWeakCells() {
GCTracer::Scope gc_scope(heap()->tracer(), GCTracer::Scope::MC_WEAKCELL);
Object* weak_cell_obj = heap()->encountered_weak_cells();
while (weak_cell_obj != Smi::FromInt(0)) {
WeakCell* weak_cell = reinterpret_cast<WeakCell*>(weak_cell_obj);