Request for reviews (M): 6747051: Improve code and implicit null check generation for compressed oops

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Thu Sep 11 11:34:41 PDT 2008


http://webrev.invokedynamic.info/kvn/6747051/index.html

Fixed 6747051: Improve code and implicit null check generation for compressed oops

Problem:
Currently C2 often generates redundant tests against null with compressed oops:

      decode_heap_oop R11,R10
      testl   R10, R10        # compressed ptr
      jeq     B75  P=0.000001 C=-1.000000
      movl    RDX, [R11 + #12] # range

decode_heap_oop also contains a test of R10 that's not exposed to the optimizer.

Solution:
Push DecodeN node below the test to the non-null path to use
decode_heap_oop_not_null mach node which does not have 0 test.
Keep CastPP node for such cases and replace CastPP(DecodeN) with DecodeN
clone node with NotNull type during final_graph_reshape phase.
This will also allow to generate more implicit null checks with compressed oops.

On x86_64 the resulting code will be:

      movl    RDX, [R12 + R10 << 3 + #12] (compressed oop addressing) # range
      NullCheck R10

And on sparc (requires to pin DecodeN to the non-null path):

      decode_heap_oop_not_null R_L7, R_O1
      LDUW   [R_O1 + #12],R_L2        ! range
      NullCheck R_O1


Also don't compare memory address types in Matcher when DecodeN is
consumed by an address expression since types will be different
at least by nullness.

Reviewed by:
Fix verified (y/n): y, generated code.

Other testing:
JPRT, refworkload, specjbb2005, specjvm2008



More information about the hotspot-compiler-dev mailing list