Assembler questions

Nils Eliasson nils.eliasson at oracle.com
Mon Apr 16 03:24:07 PDT 2012


mov 0x78(%r12,%r11,8),%rbp is a load from address [0x78 + r12 + r11 * 
0x8] -> rbp,
They are called displacement, base, index and scale in x86 language.

//Nils

Rémi Forax skrev 2012-04-16 11:59:
> Hi guys,
> I'm trying to read some assembler dump printed by hsdis.
>
> In the snippet below, I don't understand why there is a %r12 in the 
> middle of the mov.
> Is some intermediary result stored in %r12 ?
> Is it equivalent to
>   move 0x8(%r11), %r12
>   move 0x78(%r12), %rbp ?
>
> Another question more related to the layout of the class in hotspot.
> It seems there are two kinds of class pointer, the one with the type 
> java/lang/Class
> and another one used by checkcast (oop('A')).
> I suppose it's the same object at two different offsets perhaps the 
> Java one and the C++ one
> but  I don't understand why they both exist in the generated code.
>
> And the last question is why the checkcast is not removed because
> the test getClass() == A.class is just above.
> Is the VM also lost with the double representation of a class ?
>
> regards,
> Rémi
>
> 0x00007f67a46e326c: mov    0x8(%rsi),%r11d    ; implicit exception: 
> dispatches to 0x00007f67a46e32ea
>   ;; B2: #    B7 B3 <- B1  Freq: 0.999999
>
>   0x00007f67a46e3270: mov    0x78(%r12,%r11,8),%rbp  ;*invokevirtual 
> getClass
>                                                 ; - RT::classCheck at 1 
> (line 102)
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 3
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 3
>                                                 ; - IndyTest::test at 1
>   0x00007f67a46e3275: mov    $0x7d6bb4228,%r10  ;   {oop(a 
> 'java/lang/Class' = 'A')}
>   0x00007f67a46e327f: cmp    %r10,%rbp
>   0x00007f67a46e3282: jne    0x00007f67a46e32c9  ;*if_acmpne
>                                                 ; - RT::classCheck at 5 
> (line 102)
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 3
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 3
>                                                 ; - IndyTest::test at 1
>   ;; B3: #    B6 B4 <- B2  Freq: 0.999999
>
>   0x00007f67a46e3284: mov    0x40(%r12,%r11,8),%r10
>   0x00007f67a46e3289: mov    $0x77f280d58,%r11  ;   {oop('A')}
>   0x00007f67a46e3293: cmp    %r11,%r10
>   0x00007f67a46e3296: jne    0x00007f67a46e32b4  ;*checkcast
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 1
>                                                 ; - 
> java.lang.invoke.MethodHandle::invokeExact at 21
>                                                 ; - IndyTest::test at 1


-- 
Oracle <http://www.oracle.com>
Nils Eliasson | Senior Member of Technical Staff
Oracle Java Platform Group, JVM Engineering
ORACLE Sweden

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120416/e48d7b77/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120416/e48d7b77/oracle_sig_logo.gif 


More information about the hotspot-compiler-dev mailing list