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

Track pending marked members #1768

Merged
merged 12 commits into from
Jan 22, 2021
Merged

Track pending marked members #1768

merged 12 commits into from
Jan 22, 2021

Commits on Jan 20, 2021

  1. Track pending marked members

    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    90359dd View commit details
    Browse the repository at this point in the history
  2. Track pending preserved types and methods

    - Call Annotations.Mark for preserved methods up-front, if the key was already preserved.
      This way we only track preserved methods for things that aren't marked already.
    - Track pending preserve info that needs to be applied
    - Clean up logic for pending marked members
    
    The Mark* methods in MarkStep "fully" mark members (base types, parameters, etc.), whereas the methods in Annotations only perform a "shallow" mark (they track the fact that this member is to be kept, but they don't process implications of this fact - for example, they may mark methods without marking the containing type).
    
    MarkStep fulfills "shallow" marks by keeping pieces of IL that are required. Each Mark* method in MarkStep now serves two purposes:
    - Recursive marking of required IL (for example base types)
      It calls Mark* on everything  that is required, with a "reason" so that this gets traced. The base cases call Annotations.Mark to trace the reason and keep the required IL. After this is done, the original member passed to Mark* is considered "processed". We set the processed bit early enough to ensure that the recursive logic is only performed once.
    - Fulfilling "shallow" marks
      Similar to the above, but in this case, it does not need to trace the dependency again (Annotations.Mark has already been called). We need to ensure that it transitions the mark state from "pending" -> "processed" so that anything else which does a shallow mark of the member doesn't introduce new "pending" state.
    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    813c595 View commit details
    Browse the repository at this point in the history
  3. Cleanup after rebase

    Call MarkMethod instead of EnqueueMethod so that early-marked
    methods get an action assigned. This used to happen in ResolveFromAssemblyStep.
    
    Also fix up typepreserve to correctly track accessibility bits, and
    add a testcase for copyused marking behavior.
    
    Fix formatting
    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    0a3be76 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    deb8fd8 View commit details
    Browse the repository at this point in the history
  5. Keep assembly initialization based on action

    And remove currently failing testcase.
    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    da97554 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c19599d View commit details
    Browse the repository at this point in the history
  7. Remove Skip case and asserts

    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    cca717c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bd85953 View commit details
    Browse the repository at this point in the history
  9. PR feedback

    - Return arrays instead of IEnumerable for pending Annotations
    - Rename methods to Get*
    - Add comment for marked_pending
    - Don't make state changes inside a Debug assert
    - Change sourceLocationMember to null when marking pending types
    - Add exception messages
    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    9f37533 View commit details
    Browse the repository at this point in the history
  10. Add test for marked method in unmarked type

    We used to ignore such methods in Initialize, but the new logic for pending marked items will keep the method (and its type) as long as it was marked before MarkStep.
    sbomer committed Jan 20, 2021
    Configuration menu
    Copy the full SHA
    2b1fdbf View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    d39f4d3 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2021

  1. Add MarkProcessed helper

    To directly mark an item without adding it to the pending set first.
    sbomer committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    709163b View commit details
    Browse the repository at this point in the history