Odd Loop x86 CodeGen Behavior

Edward Lee edilee at gmail.com
Tue Dec 9 22:29:58 PST 2008


On Tue, Dec 9, 2008 at 5:40 PM, Vladimir Kozlov <Vladimir.Kozlov at sun.com> wrote:
> First, we need to know where stores in B10 are coming from.
> Look what the ideal graph is generated before matcher.
There are only two uses of this input parameter -- neither should be
causing the writes in B10.

#r051 esp+68: parm 2: long
#r050 esp+64: parm 2: long

 12 Parm  ===  3  [[ 876  1080 ]] Parm2: long !orig=[840] !jvms: ... @ bci:-1
 3  Start ===  3  0  [[...
 876  XorL  === _  875  12  [[ 877 ]]  !jvms: customEquals::hashCode @
bci:12 HashMap::get ...
 875  ConvI2L === _  871  [[ 876 ]] ... result of other hash function xor
 1080 CmpL  === _  12  1077  [[ 1081 ]]  !jvms: customEquals::equals @
bci:21 HashMap::get ...
 1077 LoadL ===  996  7  1076  [[ 1080 ]]  customEquals:exact+8 *,
name=longField, idx=20; #long ...

And those get code generated to..

B1: ...
047     XOR    ECX.lo,[ESP + #64]
        XOR    ECX.hi,[ESP + #64]+4

B3: ...
090     MOV    EAX,[ESP + #64]
 MOV    EDX,[ESP + #68]
098     CMP    EAX.lo,EBP.lo  ! Long compare; set flags for low bits
 JNE,s  skip
 CMP    EAX.hi,EBP.hi
 skip:
09e     Jne,s  B9  P=0.029548 C=6701.000000

I've attached the original output, so customEquals.longField would
actually be org/apache/derby/iapi/store/raw/PageKey.pageNumber. Note
there's some "magic" going on to end up with the attached ideal graph,
but it shouldn't affect the code gen. Also, the basic blocks are
slightly different in the attached file (sometimes codegen decides to
use a Je,s and othertimes Je).

Ed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: funky.loads
Type: application/octet-stream
Size: 28723 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20081210/c97f17df/attachment.obj 


More information about the hotspot-dev mailing list