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

RISC-V: Misaligned access in array fill stub

XMLWordPrintable

    • b26
    • riscv
    • linux

      We fill it by a single 8-byte store when the remaining count is less than 8 bytes after `fill_words`. This may
      overwrite some elements and create misaligned access. While it's not an issue for mordern CPUs with fast misaligned
      access, this does affect performance on CPUs where misaligned accesses are emulated by a trap handler and thus is
      very slow. async-profiler tells 2.8% cpu of `jshort_fill` in flame graph when sampling Specjbb2005 on these platforms.

      In this particular case, the copy address `to` is 8-byte aligned after `fill_words`. So if `AvoidUnalignedAccesses`
      is true, one choice would be directing controlto `L_fill_elements` which avoids alignment issue while filling the
      remaining elements.

            fyang Fei Yang
            fyang Fei Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: