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

Start tracking debug info for inlined statements #61220

Merged
merged 7 commits into from
Nov 9, 2021

Commits on Nov 4, 2021

  1. Refactor IL_OFFSETX into DebugInfo

    Remove IL_OFFSETX in favor of a DebugInfo structure. Previously we were
    packing extra information into the upper bits of IL_OFFSETX, which are
    now separate bit fields on a new ILLocation structure. DebugInfo
    contains an ILLocation and also an inline context, which will be used in
    the future when tracking debug info inside of inlinees.
    
    Another problem with IL_OFFSETX was that there were several sentinel
    values used to describe prologs, epilogs and no mappings. However these
    were only used in code-gen, so refactor codegen to track this separately
    instead of having to muddle it into IL_OFFSETX. This makes it clearer
    what we can expect from IL offsets during JIT.
    
    This change is no-diff and PIN also shows that TP is not negatively
    affected; in fact, there seems to be a small TP gain, maybe because we
    don't have to handle sentinel values anymore.
    jakobbotsch committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    75c5b6e View commit details
    Browse the repository at this point in the history
  2. Track debug information in statements from inlinees

    Add support for tracking debug information in statements coming from
    inlinees. Changes:
    
    * Turn on compDbgInfo in inlinees. We use the implicit boundaries from
      the inline root, but we do not use any explicit boundaries. That is,
      we do not query the EE for explicit boundaries for the inlinee.
    
    * Create InlineContexts eagerly and use them during import. All
      DebugInfo created in the JIT is in a "consistent" state, meaning that
      we never see an IL location set without a corresponding inline
      context. This was difficult before as InlineContexts would be created
      quite late, after the importer for the inlinee had run. We now create
      it eagerly and attach it to debug info during importation. Later, when
      we figure out whether an inline succeeded or not, we mark it as
      succeeded or failed.
    
    * Stop carrying InlineContext around unconditionally in Statement. The
      inline context is now only part of the debug info, which may not be
      set. Inlining needs the inline context to create new inline contexts
      and to check for recursive inlines. Previously it retrieved it from
      the inline statement, but due to the above change we now have to get
      it from somewhere else. To do this we now keep it unconditionally
      together with InlineCandidateInfo so that we can retrieve it later.
    
    * Validate all created debug information when associated with a
      statement. This is done by creating a bitvector containing IL
      locations that mark the beginning of IL instructions, and validating
      that all IL offsets point to these when Statement::SetDebugInfo is
      called.
    
    * While we track debug info in statements from inlinees, the runtime
      side is still not hooked up. Currently we track the information until
      we get to rationalize, where we normalize all debug info back to the
      root inserted as GT_IL_OFFSET nodes. The change is free of any diffs
      due to this normalization. We also track IL offsets as part of basic
      blocks: these are also normalized to be in the root.
    jakobbotsch committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    8626579 View commit details
    Browse the repository at this point in the history
  3. Run jit-format

    jakobbotsch committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    de5e24b View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2021

  1. Address feedback

    jakobbotsch committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    fe1088e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    316c451 View commit details
    Browse the repository at this point in the history
  3. Fix bad merge

    jakobbotsch committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    19c1174 View commit details
    Browse the repository at this point in the history
  4. Run jit-format

    jakobbotsch committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    652b8a1 View commit details
    Browse the repository at this point in the history