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

Emit padding instructions after non-returning calls

    Details

      Description

      C2 (and most likely C1 as well) can generate calls that never return. (One example of a call that never returns is a runtime call to _rethrow_Java, which is responsible for throwing an exception. The call is never expected to return as exceptions are handled by the interpreter.)

      If the call is the last in the code section, the program counter (PC) saved for the call points outside of the code section, which can be confusing (e.g., for deoptimization, as illustrated by JDK-8172844) and can also make implementing consistency checks difficult, as the unsuspecting HotSpot programmer must decide a-priori when it is acceptable for a PC value to be outside of the code region and when not.

      The goal of this enhancement is to insert additional padding instructions after non-returning calls in the form of 'hlt' instruction on Intel (and the equivalent of them on other platforms). That way it is guaranteed that the PC never point outside of the code region and error checking will be easier to implement.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dlong Dean Long
                Reporter:
                zmajo Zoltan Majo (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: