Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8168445

make pd_get_top_frame_for_profiling more robust

XMLWordPrintable

      Implementations of pd_get_top_frame_for_profiling use frame::safe_for_sender to see if the top frame is in a safe state for stack walking. Safe_for_sender has lots of checks and heuristics, but some of them are not fool-proof, particularly for compiled frames.

      C1/C2 compiled frames have a "frame complete" offset for frame setup that safe_for_sender can use, but no corresponding "frame incomplete" offset for frame tear-down.

      Deoptimization stubs have even more problems. They have no "frame complete" offset, and they have multiple entry points.

      To allow safe_for_sender to work correctly on compiled frames, we would need to map each offset to the frame/stack delta at the location. This would obsolete "frame complete", but would require more meta data about the codeblob. A possible solution would be a new reloc type.

      Alternatively, we could make safe_for_sender more conservative, at the cost of fined-grained profiling, so that it only returns true when the frame is really safe. So instead of blinding declaring deopt stubs safe, it would need to return false if it lacks enough information

            dlong Dean Long
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: