Open Bug 1695607 Opened 4 years ago Updated 2 months ago

Clean up marking terminology

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

People

(Reporter: jonco, Unassigned)

References

(Blocks 1 open bug)

Details

Steve pointed out that the terminology we use in GCMarker is really confusing: https://phabricator.services.mozilla.com/D106150#inline-593912

I'm not sure exactly what the best choice is but we should make this clearer and more consistent.

I'll put the comment here directly, since phabricator is a bit of a black hole for commentary.

Let me see if I have all the terminology right. We have 5 verbs:

  • mark
  • trace
  • scan
  • traverse
  • push

and a few combinations thereof. Objects of the verbs can be:

  • nothing or 'thing' (both mean a GC cell itself)
  • children
  • implicitChildren (only for ephemerons/WeakMaps currently)
  • edge

'mark' can have 'eagerly' or 'lazily' adverb modifiers.

The verbs mostly mean:

  • mark: set a mark bit (and possibly read it as well, to return whether it was set)
  • trace: mark and recurse to all children, explicit and implicit
  • scan: eagerly mark, plus some checking
  • traverse:
    • applied to a cell: choose one of 'mark & trace', 'mark & push', or 'eagerly mark'
    • applied to an edge: trace the target after some checks
    • applied to children: trace each child
  • push: push onto the mark stack

'lazily mark' a cell does not involve marking the cell. It means 'trace children' or really 'trace outgoing edges'. 'eagerly mark' a cell also does not involve marking the cell. It means 'trace children'/'trace outgoing edges' as well, but using iteration instead of recursion for tracing associated children of the same type. Or something.

And if 'traverse' chooses markAndTraceChildren, then that's the same meaning as the verb 'trace', I think?

You need to log in before you can comment on or make changes to this bug.