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

Use MAP_JIT when allocating pages for code cache on macOS

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b02
    • OS:
      os_x

      Backports

        Description

        According to Apple documentation (e.g. https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit ) the MAP_JIT flag should be used when mmap:ing memory for JIT compilers. We should investigate if that flag can and should be used for the code cache.

        On macOS MAP_JIT cannot be used in conjunction with MAP_FIXED when mapping
        a page for codecache. Therefore our traditional technique of doing commit
        and uncommit - replacing a mapping with another one at the same address
        range but swapped MAP_NORESERVE - does not work.
        The "exec" flag basically means "its code cache" and it should be used
        consistently for the same mapping (reserve-commit-uncommit etc)
        This affects pd_reserve_memory, pd_commit_memory, pd_uncommit_memory functions

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                akozlov Anton Kozlov
                Reporter:
                mikael Mikael Vidstedt
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: