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

C1: PatchingStub for field access copies too much

    Details

    • Subcomponent:
    • Resolved In Build:
      b22

      Backports

        Description

        C1's PatchingStub copies bytes from the method's regular code area to a dedicated patching template which gets copied back when the patching work is completed.
        Currently, C1's PatchingStub with PatchID "access_field_id" copies all bytes between the PatchingStub's instanciation and the patching_epilog call.
        This is not only more than necessary, it can cause _bytes_to_copy to exceed its one byte limitation: emit_int8(_bytes_to_copy).
        On some platforms, code for VerifyOops is part of the code which gets copied forth and back. This is unnecessary and should be avoided.
        Note that the template for PatchID "access_field_id" never gets executed, so there's no reason for copying more than the code to be patched.

        So there are basically 2 issues:
        - Possible size overflow (depending on platform and activated features)
        - Wasted code cache space

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mdoerr Martin Doerr
                  Reporter:
                  mdoerr Martin Doerr
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: