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

aarch64: missing LoadStore barrier in TemplateTable::putfield_or_static

XMLWordPrintable

    • b07
    • aarch64
    • generic

        Reported by lunliu93@gmail.com :

        I noticed in the template interpreter only a StoreStore barrier is used
        before a volatile write. According to JMM cookbook I think a LoadStore
        barrier is also needed to prevent reordering between a normal read and a
        volatile write. In the template interpreter it seems like LoadLoad |
        LoadStore barriers are inserted after both normal read and volatile read so
        it should be fine but I think this might cause a problem if the compiler
        generates a normal read using dmb barriers and the interpreter is executing
        the volatile write. Could this be a potential bug?

        I am browsing aarch64-port/jdk8u code with the following changeset as the
        lastest change
        changeset: 9947:1d411780111d
        tag: tip
        user: fyang
        date: Mon Dec 24 13:42:31 2018 +0800
        summary: 8209414: AArch64: method handle invocation does not respect
        JVMTI interp_only mode

        This could be fixed by a simple patch below
        diff -r 1d411780111d src/cpu/aarch64/vm/templateTable_aarch64.cpp
        --- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp Mon Dec 24 13:42:31
        2018 +0800
        +++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp Wed Jan 30 21:34:47
        2019 +0100
        @@ -2633,7 +2633,7 @@
           {
             Label notVolatile;
             __ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
        - __ membar(MacroAssembler::StoreStore);
        + __ membar(MacroAssembler::StoreStore | LoadStore);
             __ bind(notVolatile);
           }

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

                Created:
                Updated:
                Resolved: