Harmony
  1. Harmony
  2. HARMONY-6211

[drlvm][jit] write barrier broken by H5826

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      Windows, IA32

      Description

      When using -XX:gc.generate_barrier=true, even a simple HelloWorld couldn't run correctly. The bug is from an peephole optimization on ADD inst in H5826 which assumes no control flow branch in the middle of a basic block. In fact, some CALL insts break the assumption and make the optimization effective in wrong cases. Following is an example:

      I4: t5:ref:cls:java/lang/ref/ReferenceQueue =ADD t0:cls:java/lang/ref/Reference, t4(0):intptr
      I5: CALL t7(0):I_32 (AU:t0:cls:java/lang/ref/Reference, t5:ref:cls:java/lang/ref/ReferenceQueue, t2:cls:java/lang/ref/ReferenceQueue) [bcmap:6]
      I6: t9:ref:cls:java/lang/Object =ADD t0:cls:java/lang/ref/Reference,t8(0):intptr
      I7: CALL t10(0):I_32 (AU:t0:cls:java/lang/ref/Reference,t9:ref:cls:java/lang/Object,t1:cls:java/lang/Object) [bcmap:11]
      I8: RET t11(0):int16

      1. H6211-V1.patch
        0.7 kB
        Xiaoming Gu

        Issue Links

          Activity

          Xiao-Feng Li made changes -
          Assignee Xiao-Feng Li [ xiao-feng li ]
          Xiaoming Gu made changes -
          Description When using -XX:gc.generate_barrier=true, even a simple HelloWorld couldn't run correctly. The bug is from an peephole optimization in H5826 which assumes no control flow branch in the middle of a basic block. In fact, some CALL insts break the assumption and make the optimization effective in wrong cases. Following is an example:

          I4: t5:ref:cls:java/lang/ref/ReferenceQueue =ADD t0:cls:java/lang/ref/Reference, t4(0):intptr
          I5: CALL t7(0):I_32 (AU:t0:cls:java/lang/ref/Reference, t5:ref:cls:java/lang/ref/ReferenceQueue, t2:cls:java/lang/ref/ReferenceQueue) [bcmap:6]
          I6: t9:ref:cls:java/lang/Object =ADD t0:cls:java/lang/ref/Reference,t8(0):intptr
          I7: CALL t10(0):I_32 (AU:t0:cls:java/lang/ref/Reference,t9:ref:cls:java/lang/Object,t1:cls:java/lang/Object) [bcmap:11]
          I8: RET t11(0):int16
          When using -XX:gc.generate_barrier=true, even a simple HelloWorld couldn't run correctly. The bug is from an peephole optimization on ADD inst in H5826 which assumes no control flow branch in the middle of a basic block. In fact, some CALL insts break the assumption and make the optimization effective in wrong cases. Following is an example:

          I4: t5:ref:cls:java/lang/ref/ReferenceQueue =ADD t0:cls:java/lang/ref/Reference, t4(0):intptr
          I5: CALL t7(0):I_32 (AU:t0:cls:java/lang/ref/Reference, t5:ref:cls:java/lang/ref/ReferenceQueue, t2:cls:java/lang/ref/ReferenceQueue) [bcmap:6]
          I6: t9:ref:cls:java/lang/Object =ADD t0:cls:java/lang/ref/Reference,t8(0):intptr
          I7: CALL t10(0):I_32 (AU:t0:cls:java/lang/ref/Reference,t9:ref:cls:java/lang/Object,t1:cls:java/lang/Object) [bcmap:11]
          I8: RET t11(0):int16
          Xiaoming Gu made changes -
          Comment [ This bug comes from a peephole optimization about ADD in H5826 ]
          Xiaoming Gu made changes -
          Link This issue is related to HARMONY-5826 [ HARMONY-5826 ]
          Xiaoming Gu made changes -
          Attachment H6211-V1.patch [ 12408880 ]
          Hide
          Xiaoming Gu added a comment -

          This message is for V1 patch. Only add some checking about middle CALL insts for the peephole optimization.

          Show
          Xiaoming Gu added a comment - This message is for V1 patch. Only add some checking about middle CALL insts for the peephole optimization.
          Xiaoming Gu made changes -
          Field Original Value New Value
          Component/s DRLVM [ 12311272 ]
          Xiaoming Gu created issue -

            People

            • Assignee:
              Xiao-Feng Li
              Reporter:
              Xiaoming Gu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development