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

[lworld] Non-optimal code generation for array properties check

    Details

      Description

      Load reference from Object[], check is generated via "and" operation if compressed oops is turned off:
        0.02% │ 0x00007fbf007c985d: mov 0x8(%r10),%r11
        4.79% │ 0x00007fbf007c9861: movabs $0x4000000000000000,%r8
        0.14% │ 0x00007fbf007c986b: and %r8,%r11
        0.16% │ 0x00007fbf007c986e: test %r11,%r11
                    │ 0x00007fbf007c9871: jne 0x00007fbf007c98be
                    │ 0x00007fbf007c9873: mov 0x18(%r10),%rsi

      it is possible simply do "test" in this case. if compressedOops is turned on - the code do just "test":
        0.16% │ 0x00007f51ac7c8f13: mov 0x8(%r12,%r10,8),%r8d
        5.04% │ 0x00007f51ac7c8f18: mov %r8d,%r11d
                    │ 0x00007f51ac7c8f1b: test $0x40000000,%r11d
                    │ 0x00007f51ac7c8f22: jne 0x00007f51ac7c8f7a
                    │ 0x00007f51ac7c8f24: mov 0x10(%r12,%r10,8),%r10d

      PS. there is a very minor deficiency on compressed oops case too - moving value to r11 that is not necessary and spoil 1 register.

      Code: http://cr.openjdk.java.net/~skuksenko/valhalla/legacy/benchmarks/
      Benchmark:
      reflect.MethodInvoke.invokeWithOneObjectParam

        Attachments

          Activity

            People

            • Assignee:
              thartmann Tobias Hartmann
              Reporter:
              skuksenko Sergey Kuksenko
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: