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

os::current_frame has a misleading name



    • Enhancement
    • Status: Closed
    • P4
    • Resolution: Won't Fix
    • 9
    • 10
    • hotspot
    • None


      os::current_frame does not return the "current" frame (not for the caller and not for the callee). It turns the frame of the caller's caller. Thus the name is misleading. We may want to make it return the caller's frame, and leave it up to the caller to apply the logic to go up one frame further. Either that or come up with a better name, but any name we pick is bound to be somewhat awkward.

      Even with the change to return the caller's frame, the name is still a bit confusing, because you could argue that the "current" frame is the one that is current while in os::current_frame(), although it probably makes more sense to think of "current" as being from the POV of the caller.

      As part of this cleanup, it might also make sense to manually inline _get_previous_fp() on the platforms that use it. This way we no longer need extra logic to decide if _get_previous_fp() was not inlined and needs to be skipped.

      Also related to all this is the following RFE:

      JDK-8163899 NMT frame skipping code is fragile

      If it is addressed, then the need for os::current_frame() might go away.


        Issue Links



              Unassigned Unassigned
              cjplummer Chris Plummer
              0 Vote for this issue
              4 Start watching this issue