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

aarch64: Make use of CBZ and CBNZ when comparing narrow pointer with zero

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • hotspot
    • None
    • b110
    • aarch64
    • linux

        For several times I noticed the following pattern in JIT code (the java heap size is set to 200MB):

           2042 0x0000007f6c9419c4: ldr w14, [x11,#32] ;*getfield buffer
           2043 ; - org.apache.hadoop.io.DataInputBuffer::reset@1 (line 83)
           2044 ; - org.apache.hadoop.mapreduce.task.ReduceContextImpl::nextKeyValue@88 (line 141)
           2045 ; - org.apache.hadoop.mapreduce.task.ReduceContextImpl$ValueIterator::next@209 (li ne 239)
           2046 ; - org.apache.hadoop.examples.WordCount$IntSumReducer::reduce@23 (line 60)
           2047
           2048 0x0000007f6c9419c8: cmp w14, wzr
           2049 0x0000007f6c9419cc: b.eq 0x0000007f6c9425e4 ;*invokevirtual reset
           2050 ; - org.apache.hadoop.io.DataInputBuffer::reset@7 (line 83)
           2051 ; - org.apache.hadoop.mapreduce.task.ReduceContextImpl::nextKeyValue@88 (line 141)
           2052 ; - org.apache.hadoop.mapreduce.task.ReduceContextImpl$ValueIterator::next@209 (li ne 239)

        The two cmp and b.eq instructions can be combined into one "cbz" instruction.

        Currently, the aarch64 port only makes use of CBZ and CBNZ when comparing operands with Integer/Long/Pointer type with zero. The issue can be fixed by add one similar combine template in the ad file for Narrow pointer types, just like the sparc port does.

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

                Created:
                Updated:
                Resolved: