Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Introduced In Build:
      b14
    • Introduced In Version:
    • CPU:
      aarch64

      Issue Links

        Activity

        Show
        andrew Andrew Hughes added a comment - http://hg.openjdk.java.net/aarch64-port/jdk8u/hotspot/rev/9ecb104350ef
        Hide
        zmajo Zoltan Majo added a comment -
        I see that the AARCH64 version of JDK-8160591 did not make it into JDK 9 yet [1].

        Please find a patch below (essentially the same patch as Andrew pushed into the jdk8u tree. Roland has built a VM with that patch and he has also verified that the compiler/c1/TestArrayCopyToFromObject.java [2] test passes with the patched VM.

        diff --git a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
        --- a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
        +++ b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
        @@ -2249,6 +2249,25 @@
             __ cbz(dst, *stub->entry());
           }
         
        + // If the compiler was not able to prove that exact type of the source or the destination
        + // of the arraycopy is an array type, check at runtime if the source or the destination is
        + // an instance type.
        + if (flags & LIR_OpArrayCopy::type_check) {
        + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) {
        + __ load_klass(tmp, dst);
        + __ ldrw(rscratch1, Address(tmp, in_bytes(Klass::layout_helper_offset())));
        + __ cmpw(rscratch1, Klass::_lh_neutral_value);
        + __ br(Assembler::GE, *stub->entry());
        + }
        +
        + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) {
        + __ load_klass(tmp, src);
        + __ ldrw(rscratch1, Address(tmp, in_bytes(Klass::layout_helper_offset())));
        + __ cmpw(rscratch1, Klass::_lh_neutral_value);
        + __ br(Assembler::GE, *stub->entry());
        + }
        + }
        +
           // check if negative
           if (flags & LIR_OpArrayCopy::src_pos_positive_check) {
             __ cmpw(src_pos, 0);

        [1] http://hg.openjdk.java.net/jdk9/hs/hotspot/file/031e87605d21/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
        [2] http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/7b0aac4c2aac#l3.2
        Show
        zmajo Zoltan Majo added a comment - I see that the AARCH64 version of JDK-8160591 did not make it into JDK 9 yet [1]. Please find a patch below (essentially the same patch as Andrew pushed into the jdk8u tree. Roland has built a VM with that patch and he has also verified that the compiler/c1/TestArrayCopyToFromObject.java [2] test passes with the patched VM. diff --git a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp --- a/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -2249,6 +2249,25 @@      __ cbz(dst, *stub->entry());    }   + // If the compiler was not able to prove that exact type of the source or the destination + // of the arraycopy is an array type, check at runtime if the source or the destination is + // an instance type. + if (flags & LIR_OpArrayCopy::type_check) { + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) { + __ load_klass(tmp, dst); + __ ldrw(rscratch1, Address(tmp, in_bytes(Klass::layout_helper_offset()))); + __ cmpw(rscratch1, Klass::_lh_neutral_value); + __ br(Assembler::GE, *stub->entry()); + } + + if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) { + __ load_klass(tmp, src); + __ ldrw(rscratch1, Address(tmp, in_bytes(Klass::layout_helper_offset()))); + __ cmpw(rscratch1, Klass::_lh_neutral_value); + __ br(Assembler::GE, *stub->entry()); + } + } +    // check if negative    if (flags & LIR_OpArrayCopy::src_pos_positive_check) {      __ cmpw(src_pos, 0); [1] http://hg.openjdk.java.net/jdk9/hs/hotspot/file/031e87605d21/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp [2] http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/7b0aac4c2aac#l3.2
        Hide
        andrew Andrew Hughes added a comment -
        Someone duplicated this issue rather than using this existing bug... :(
        Show
        andrew Andrew Hughes added a comment - Someone duplicated this issue rather than using this existing bug... :(

          People

          • Assignee:
            aph Andrew Haley
            Reporter:
            andrew Andrew Hughes
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: