Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel: use more accurate marking #2408

Merged
merged 8 commits into from
Apr 28, 2018

Commits on Apr 26, 2018

  1. kernel: add code to debug subbag marking in GASMAN

    If DEBUG_GASMAN_MARKING is #defined, then we increment a counter
    whenever `MarkBag` is called on something that isn't either zero,
    or a valid bag ref, or an immediate integer or FFE.
    
    By setting a break point on the line incrementing BadMarksCounter,
    one can quickly find out which bags are affected.
    fingolfin committed Apr 26, 2018
    Configuration menu
    Copy the full SHA
    3b2fffa View commit details
    Browse the repository at this point in the history
  2. kernel: use custom GC marking for T_FUNCTION

    Not all slots of a T_FUNCTION bag are filled with bag refs, yet when
    marking the slots of such a bag during garbage collection, we still used
    MarkAllSubBags. This is usually no problem with GASMAN, as it detects if
    a pointer isn't a master pointer, and can then simply ignore it. But
    other garbage collections can't as easily verify master pointers. So
    let's try to be accurate about what we mark as a bag and what not: skip
    the first eight slots of every T_FUNCTION bag for marking (they contain
    pointers to C functions), and also ensure that the rest of any
    T_FUNCTION bag only contains bag refs.
    
    Also fix a bug in saving/restoring operations, where the 'enabled' field
    was stored as an UInt, even though it now is an Obj (though we currently
    only store immediate ints in it, hence there was no functional problem).
    fingolfin committed Apr 26, 2018
    Configuration menu
    Copy the full SHA
    7fe50d0 View commit details
    Browse the repository at this point in the history
  3. kernel: unify implementation of MarkNNNSubBags

    They now all call MarkArrayOfBags, but thanks to inlining, this produces
    identical machine code.
    fingolfin committed Apr 26, 2018
    Configuration menu
    Copy the full SHA
    9888677 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be15779 View commit details
    Browse the repository at this point in the history
  5. kernel: use T_DATOBJ for StackStat and StackExpr

    ... instead of a T_BODY, as we don't really create a T_BODY here.
    (and this can lead to confusion in GC marking)
    fingolfin committed Apr 26, 2018
    Configuration menu
    Copy the full SHA
    b3a2362 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f6993c2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e87de2c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cf2c8c1 View commit details
    Browse the repository at this point in the history