Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
Created July 13, 2011 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rednaxelafx/1080293 to your computer and use it in GitHub Desktop.
Save rednaxelafx/1080293 to your computer and use it in GitHub Desktop.
In response to Alex Turner's post on throwing exceptions (1) http://nerds-central.blogspot.com/2011/07/jvmdynamic-languages-very-fast-return.html
package nerdscentral;
public class LoopTest {
static long count = 0;
static class ReturnDispatch extends RuntimeException{
@Override
public Throwable fillInStackTrace(){
return this;
}
}
static class TestDispatch extends ReturnDispatch{}
static final TestDispatch ret = new TestDispatch();
public static void main(String[] args){
long time = 0;
for(int j=0;j<10000;++j){
if(j==10){
time=System.currentTimeMillis();
}
for(int i=0;i<1000000;++i){
try{
loop2();
}catch(Exception e){count++;}
}
}
System.out.println("Dispatch: " + (System.currentTimeMillis() - time));
for(int j=0;j<10000;++j){
if(j==10){
time=System.currentTimeMillis();
}
for(int i=0;i<1000000;++i){
loop1();
count++;
}
}
System.out.println("No Dispatch: " + (System.currentTimeMillis() - time));
System.out.println(""+count);
}
private static void loop1(){
count++;
}
private static void loop2(){
count++;
throw ret;
}
}
$ java -version
java version "1.7.0-fastdebug"
Java(TM) SE Runtime Environment (build 1.7.0-fastdebug-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17-fastdebug, mixed mode)
$ java -cp . nerdscentral.LoopTest
Dispatch: 814
No Dispatch: 1008
40000000000
$ java -cp . -XX:+PrintCompilation -XX:+PrintInlining nerdscentral.LoopTest
VM option '+PrintCompilation'
VM option '+PrintInlining'
517 1 nerdscentral.LoopTest::loop2 (12 bytes)
568 1 % ! nerdscentral.LoopTest::main @ 24 (197 bytes)
@ 31 nerdscentral.LoopTest::loop2 (12 bytes) inline (hot)
583 1 % ! nerdscentral.LoopTest::main @ -2 (197 bytes) made not entrant
587 2 % ! nerdscentral.LoopTest::main @ 24 (197 bytes)
@ 31 nerdscentral.LoopTest::loop2 (12 bytes) inline (hot)
@ 17 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
1400 2 % ! nerdscentral.LoopTest::main @ -2 (197 bytes) made not entrant
Dispatch: 817
1403 2 nerdscentral.LoopTest::loop1 (9 bytes)
1405 3 % ! nerdscentral.LoopTest::main @ 110 (197 bytes)
@ 117 nerdscentral.LoopTest::loop1 (9 bytes) inline (hot)
@ 103 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
@ 147 java.lang.StringBuilder::<init> (7 bytes) call site not reached
@ 152 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 155 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
@ 160 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 163 java.lang.StringBuilder::toString (17 bytes) executed < MinInliningThreshold times
!m @ 166 java.io.PrintStream::println (24 bytes) executed < MinInliningThreshold times
@ 176 java.lang.StringBuilder::<init> (7 bytes) call site not reached
@ 181 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 187 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 190 java.lang.StringBuilder::toString (17 bytes) executed < MinInliningThreshold times
!m @ 193 java.io.PrintStream::println (24 bytes) executed < MinInliningThreshold times
No Dispatch: 1008
40000000000
Java HotSpot(TM) 64-Bit Server VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output
VM option '+UnlockDiagnosticVMOptions'
VM option '+PrintAssembly'
Loaded disassembler from /home/sajia/jdk/7b147_x64_debug/fastdebug/jre/lib/amd64/server/libhsdis-amd64.so
Decoding compiled method 0x00002aaaab41f550:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'loop2' '()V' in 'nerdscentral/LoopTest'
# [sp+0x20] (sp of caller)
0x00002aaaab41f680: push %rbp
0x00002aaaab41f681: sub $0x10,%rsp
0x00002aaaab41f685: nop
0x00002aaaab41f686: mov $0xedc4c850,%r10 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab41f690: incq 0x78(%r10) ;*synchronization entry
; - nerdscentral.LoopTest::loop2@-1 (line 49)
0x00002aaaab41f694: mov 0x70(%r10),%r10d
0x00002aaaab41f698: mov %r10,%rsi ;*getstatic ret
; - nerdscentral.LoopTest::loop2@8 (line 50)
0x00002aaaab41f69b: add $0x10,%rsp
0x00002aaaab41f69f: pop %rbp
0x00002aaaab41f6a0: jmpq 0x00002aaaab41dba0 ; {runtime_call}
0x00002aaaab41f6a5: hlt
0x00002aaaab41f6a6: hlt
0x00002aaaab41f6a7: hlt
0x00002aaaab41f6a8: hlt
0x00002aaaab41f6a9: hlt
0x00002aaaab41f6aa: hlt
0x00002aaaab41f6ab: hlt
0x00002aaaab41f6ac: hlt
0x00002aaaab41f6ad: hlt
0x00002aaaab41f6ae: hlt
0x00002aaaab41f6af: hlt
0x00002aaaab41f6b0: hlt
0x00002aaaab41f6b1: hlt
0x00002aaaab41f6b2: hlt
0x00002aaaab41f6b3: hlt
0x00002aaaab41f6b4: hlt
0x00002aaaab41f6b5: hlt
0x00002aaaab41f6b6: hlt
0x00002aaaab41f6b7: hlt
0x00002aaaab41f6b8: hlt
0x00002aaaab41f6b9: hlt
0x00002aaaab41f6ba: hlt
0x00002aaaab41f6bb: hlt
0x00002aaaab41f6bc: hlt
0x00002aaaab41f6bd: hlt
0x00002aaaab41f6be: hlt
0x00002aaaab41f6bf: hlt
[Exception Handler]
[Stub Code]
0x00002aaaab41f6c0: jmpq 0x00002aaaab407360 ; {no_reloc}
[Deopt Handler Code]
0x00002aaaab41f6c5: callq 0x00002aaaab41f6ca
0x00002aaaab41f6ca: subq $0x5,(%rsp)
0x00002aaaab41f6cf: jmpq 0x00002aaaab3f9460 ; {runtime_call}
0x00002aaaab41f6d4: int3
0x00002aaaab41f6d5: int3
0x00002aaaab41f6d6: int3
0x00002aaaab41f6d7: int3
Loaded disassembler from /home/sajia/jdk/7b147_x64_debug/fastdebug/jre/lib/amd64/server/libhsdis-amd64.so
Decoding compiled method 0x00002aaaab41f050:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'main' '([Ljava/lang/String;)V' in 'nerdscentral/LoopTest'
0x00002aaaab41f1a0: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41f1aa: rex.WB callq *%r10
0x00002aaaab41f1ad: nop
0x00002aaaab41f1ae: nop
0x00002aaaab41f1af: nop
0x00002aaaab41f1b0: mov %eax,-0x8000(%rsp)
0x00002aaaab41f1b7: push %rbp
0x00002aaaab41f1b8: sub $0x10,%rsp
0x00002aaaab41f1bc: mov 0x18(%rsi),%rbp
0x00002aaaab41f1c0: mov 0x8(%rsi),%r13d
0x00002aaaab41f1c4: mov 0x10(%rsi),%ebx
0x00002aaaab41f1c7: mov %rsi,%rdi
0x00002aaaab41f1ca: mov $0x2b7942997d20,%r10
0x00002aaaab41f1d4: callq *%r10 ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41f1d7: mov $0xedc4c850,%r10 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab41f1e1: jmp 0x00002aaaab41f248
0x00002aaaab41f1e3: nop
0x00002aaaab41f1e4: nop
0x00002aaaab41f1e5: nop
0x00002aaaab41f1e6: nop
0x00002aaaab41f1e7: nop
0x00002aaaab41f1e8: nop
0x00002aaaab41f1e9: nop
0x00002aaaab41f1ea: nop
0x00002aaaab41f1eb: nop
0x00002aaaab41f1ec: nop
0x00002aaaab41f1ed: nop
0x00002aaaab41f1ee: nop
0x00002aaaab41f1ef: nop
0x00002aaaab41f1f0: mov %r11,0x78(%r10) ;*getstatic count
; - nerdscentral.LoopTest::loop2@0 (line 49)
; - nerdscentral.LoopTest::main@31 (line 26)
0x00002aaaab41f1f4: mov %r11,%r8
0x00002aaaab41f1f7: add $0x1e,%r8
0x00002aaaab41f1fb: mov %r8,0x78(%r10) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41f1ff: add $0x10,%r13d ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41f203: add $0x20,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41f207: cmp $0xf4232,%r13d
0x00002aaaab41f20e: jl 0x00002aaaab41f1f0 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41f210: cmp $0xf4241,%r13d
0x00002aaaab41f217: jge 0x00002aaaab41f236
0x00002aaaab41f219: mov %r11,0x78(%r10) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41f21d: nop
0x00002aaaab41f21e: nop
0x00002aaaab41f21f: nop ;*getstatic count
; - nerdscentral.LoopTest::loop2@0 (line 49)
; - nerdscentral.LoopTest::main@31 (line 26)
0x00002aaaab41f220: inc %r13d ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41f223: cmp $0xf4241,%r13d
0x00002aaaab41f22a: jge 0x00002aaaab41f236 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41f22c: add $0x2,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41f230: mov %r11,0x78(%r10) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41f234: jmp 0x00002aaaab41f220 ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41f236: inc %ebx ;*iinc
; - nerdscentral.LoopTest::main@53 (line 20)
0x00002aaaab41f238: cmp $0x2710,%ebx
0x00002aaaab41f23e: jge 0x00002aaaab41f276 ;*if_icmpge
; - nerdscentral.LoopTest::main@8 (line 20)
0x00002aaaab41f240: cmp $0xa,%ebx
0x00002aaaab41f243: je 0x00002aaaab41f28d ;*if_icmpne
; - nerdscentral.LoopTest::main@14 (line 21)
0x00002aaaab41f245: xor %r13d,%r13d ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41f248: mov 0x78(%r10),%r11
0x00002aaaab41f24c: mov %r13d,%r9d
0x00002aaaab41f24f: inc %r9d ;*getstatic count
; - nerdscentral.LoopTest::loop2@0 (line 49)
; - nerdscentral.LoopTest::main@31 (line 26)
0x00002aaaab41f252: add $0x2,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41f256: inc %r13d ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41f259: cmp %r9d,%r13d
0x00002aaaab41f25c: jge 0x00002aaaab41f264 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41f25e: mov %r11,0x78(%r10)
0x00002aaaab41f262: jmp 0x00002aaaab41f252
0x00002aaaab41f264: cmp $0xf4232,%r13d
0x00002aaaab41f26b: jge 0x00002aaaab41f210
0x00002aaaab41f26d: mov %r11,0x78(%r10) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41f271: jmpq 0x00002aaaab41f1f4 ;*if_icmpge
; - nerdscentral.LoopTest::main@8 (line 20)
0x00002aaaab41f276: mov $0x38,%esi
0x00002aaaab41f27b: callq 0x00002aaaab3f88e0 ; OopMap{off=224}
;*getstatic out
; - nerdscentral.LoopTest::main@59 (line 30)
; {runtime_call}
0x00002aaaab41f280: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41f28a: rex.WB callq *%r10 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41f28d: mov $0x38,%esi
0x00002aaaab41f292: nop
0x00002aaaab41f293: callq 0x00002aaaab3f88e0 ; OopMap{off=248}
;*invokestatic currentTimeMillis
; - nerdscentral.LoopTest::main@17 (line 22)
; {runtime_call}
0x00002aaaab41f298: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41f2a2: rex.WB callq *%r10 ;*invokestatic currentTimeMillis
; - nerdscentral.LoopTest::main@17 (line 22)
0x00002aaaab41f2a5: hlt
0x00002aaaab41f2a6: hlt
0x00002aaaab41f2a7: hlt
0x00002aaaab41f2a8: hlt
0x00002aaaab41f2a9: hlt
0x00002aaaab41f2aa: hlt
0x00002aaaab41f2ab: hlt
0x00002aaaab41f2ac: hlt
0x00002aaaab41f2ad: hlt
0x00002aaaab41f2ae: hlt
0x00002aaaab41f2af: hlt
0x00002aaaab41f2b0: hlt
0x00002aaaab41f2b1: hlt
0x00002aaaab41f2b2: hlt
0x00002aaaab41f2b3: hlt
0x00002aaaab41f2b4: hlt
0x00002aaaab41f2b5: hlt
0x00002aaaab41f2b6: hlt
0x00002aaaab41f2b7: hlt
0x00002aaaab41f2b8: hlt
0x00002aaaab41f2b9: hlt
0x00002aaaab41f2ba: hlt
0x00002aaaab41f2bb: hlt
0x00002aaaab41f2bc: hlt
0x00002aaaab41f2bd: hlt
0x00002aaaab41f2be: hlt
0x00002aaaab41f2bf: hlt
[Exception Handler]
[Stub Code]
0x00002aaaab41f2c0: jmpq 0x00002aaaab407360 ; {no_reloc}
[Deopt Handler Code]
0x00002aaaab41f2c5: callq 0x00002aaaab41f2ca
0x00002aaaab41f2ca: subq $0x5,(%rsp)
0x00002aaaab41f2cf: jmpq 0x00002aaaab3f9460 ; {runtime_call}
0x00002aaaab41f2d4: int3
0x00002aaaab41f2d5: int3
0x00002aaaab41f2d6: int3
0x00002aaaab41f2d7: int3
Decoding compiled method 0x00002aaaab41ead0:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'main' '([Ljava/lang/String;)V' in 'nerdscentral/LoopTest'
0x00002aaaab41ec20: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41ec2a: rex.WB callq *%r10
0x00002aaaab41ec2d: nop
0x00002aaaab41ec2e: nop
0x00002aaaab41ec2f: nop
0x00002aaaab41ec30: mov %eax,-0x8000(%rsp)
0x00002aaaab41ec37: push %rbp
0x00002aaaab41ec38: sub $0x20,%rsp
0x00002aaaab41ec3c: mov 0x18(%rsi),%rbx
0x00002aaaab41ec40: rex mov 0x8(%rsi),%ebp
0x00002aaaab41ec44: mov 0x10(%rsi),%r14d
0x00002aaaab41ec48: mov %rsi,%rdi
0x00002aaaab41ec4b: mov $0x2b7942997d20,%r10
0x00002aaaab41ec55: callq *%r10 ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41ec58: mov %ebp,%r10d
0x00002aaaab41ec5b: inc %r10d
0x00002aaaab41ec5e: mov $0xedc4c850,%r13 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab41ec68: jmpq 0x00002aaaab41ecd0
0x00002aaaab41ec6d: nop
0x00002aaaab41ec6e: nop
0x00002aaaab41ec6f: nop
0x00002aaaab41ec70: mov %r11,0x78(%r13) ;*getstatic count
; - nerdscentral.LoopTest::loop2@0 (line 49)
; - nerdscentral.LoopTest::main@31 (line 26)
0x00002aaaab41ec74: mov %r11,%r10
0x00002aaaab41ec77: add $0x1e,%r10
0x00002aaaab41ec7b: mov %r10,0x78(%r13) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41ec7f: add $0x10,%ebp ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41ec82: add $0x20,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41ec86: cmp $0xf4232,%ebp
0x00002aaaab41ec8c: jl 0x00002aaaab41ec70 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41ec8e: cmp $0xf4241,%ebp
0x00002aaaab41ec94: jge 0x00002aaaab41ecb0
0x00002aaaab41ec96: mov %r11,0x78(%r13) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41ec9a: nop
0x00002aaaab41ec9b: nop ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41ec9c: inc %ebp ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41ec9e: cmp $0xf4241,%ebp
0x00002aaaab41eca4: jge 0x00002aaaab41ecb0 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41eca6: add $0x2,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41ecaa: mov %r11,0x78(%r13) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41ecae: jmp 0x00002aaaab41ec9c ;*goto
; - nerdscentral.LoopTest::main@56 (line 20)
0x00002aaaab41ecb0: inc %r14d ; OopMap{r13=Oop off=147}
;*goto
; - nerdscentral.LoopTest::main@56 (line 20)
0x00002aaaab41ecb3: test %eax,-0x529cb9(%rip) # 0x00002aaaaaef5000
;*goto
; - nerdscentral.LoopTest::main@56 (line 20)
; {poll}
0x00002aaaab41ecb9: cmp $0x2710,%r14d
0x00002aaaab41ecc0: jge 0x00002aaaab41ecf6 ;*if_icmpge
; - nerdscentral.LoopTest::main@8 (line 20)
0x00002aaaab41ecc2: cmp $0xa,%r14d
0x00002aaaab41ecc6: je 0x00002aaaab41ed25 ;*iconst_0
; - nerdscentral.LoopTest::main@21 (line 24)
0x00002aaaab41ecc8: xor %ebp,%ebp
0x00002aaaab41ecca: mov $0x1,%r10d
0x00002aaaab41ecd0: mov 0x78(%r13),%r11 ;*iload
; - nerdscentral.LoopTest::main@24 (line 24)
0x00002aaaab41ecd4: add $0x2,%r11 ;*ladd
; - nerdscentral.LoopTest::main@43 (line 27)
0x00002aaaab41ecd8: inc %ebp ;*iinc
; - nerdscentral.LoopTest::main@47 (line 24)
0x00002aaaab41ecda: cmp %r10d,%ebp
0x00002aaaab41ecdd: jge 0x00002aaaab41ece5 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41ecdf: mov %r11,0x78(%r13)
0x00002aaaab41ece3: jmp 0x00002aaaab41ecd4
0x00002aaaab41ece5: cmp $0xf4232,%ebp
0x00002aaaab41eceb: jge 0x00002aaaab41ec8e
0x00002aaaab41eced: mov %r11,0x78(%r13) ;*putstatic count
; - nerdscentral.LoopTest::main@44 (line 27)
0x00002aaaab41ecf1: jmpq 0x00002aaaab41ec74
0x00002aaaab41ecf6: mov $0xedc00d08,%r10 ; {oop(a 'java/lang/Class' = 'java/lang/System')}
0x00002aaaab41ed00: mov 0x74(%r10),%ebp
0x00002aaaab41ed04: test %ebp,%ebp
0x00002aaaab41ed06: je 0x00002aaaab41ed3a ;*getstatic out
; - nerdscentral.LoopTest::main@59 (line 30)
0x00002aaaab41ed08: mov $0xffffffec,%esi
0x00002aaaab41ed0d: mov %rbx,(%rsp)
0x00002aaaab41ed11: nop
0x00002aaaab41ed12: nop
0x00002aaaab41ed13: callq 0x00002aaaab3f88e0 ; OopMap{rbp=NarrowOop off=248}
;*new ; - nerdscentral.LoopTest::main@62 (line 30)
; {runtime_call}
0x00002aaaab41ed18: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41ed22: rex.WB callq *%r10 ;*if_icmpge
; - nerdscentral.LoopTest::main@28 (line 24)
0x00002aaaab41ed25: mov $0x2b79428b5860,%r10
0x00002aaaab41ed2f: callq *%r10 ;*invokestatic currentTimeMillis
; - nerdscentral.LoopTest::main@17 (line 22)
0x00002aaaab41ed32: mov %rax,%rbx
0x00002aaaab41ed35: jmpq 0x00002aaaab41ecc8 ;*if_icmpge
; - nerdscentral.LoopTest::main@8 (line 20)
0x00002aaaab41ed3a: mov $0x8,%esi
0x00002aaaab41ed3f: mov %rbx,%rbp
0x00002aaaab41ed42: nop
0x00002aaaab41ed43: callq 0x00002aaaab3f88e0 ; OopMap{off=296}
;*new ; - nerdscentral.LoopTest::main@62 (line 30)
; {runtime_call}
0x00002aaaab41ed48: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab41ed52: rex.WB callq *%r10 ;*new ; - nerdscentral.LoopTest::main@62 (line 30)
0x00002aaaab41ed55: hlt
0x00002aaaab41ed56: hlt
0x00002aaaab41ed57: hlt
0x00002aaaab41ed58: hlt
0x00002aaaab41ed59: hlt
0x00002aaaab41ed5a: hlt
0x00002aaaab41ed5b: hlt
0x00002aaaab41ed5c: hlt
0x00002aaaab41ed5d: hlt
0x00002aaaab41ed5e: hlt
0x00002aaaab41ed5f: hlt
[Exception Handler]
[Stub Code]
0x00002aaaab41ed60: jmpq 0x00002aaaab407360 ; {no_reloc}
[Deopt Handler Code]
0x00002aaaab41ed65: callq 0x00002aaaab41ed6a
0x00002aaaab41ed6a: subq $0x5,(%rsp)
0x00002aaaab41ed6f: jmpq 0x00002aaaab3f9460 ; {runtime_call}
0x00002aaaab41ed74: int3
0x00002aaaab41ed75: int3
0x00002aaaab41ed76: int3
0x00002aaaab41ed77: int3
Dispatch: 820
Decoding compiled method 0x00002aaaab41e8d0:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'loop1' '()V' in 'nerdscentral/LoopTest'
# [sp+0x20] (sp of caller)
0x00002aaaab41ea00: push %rbp
0x00002aaaab41ea01: sub $0x10,%rsp
0x00002aaaab41ea05: nop ;*synchronization entry
; - nerdscentral.LoopTest::loop1@-1 (line 45)
0x00002aaaab41ea06: mov $0xedc4c850,%r10 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab41ea10: incq 0x78(%r10) ;*putstatic count
; - nerdscentral.LoopTest::loop1@5 (line 45)
0x00002aaaab41ea14: add $0x10,%rsp
0x00002aaaab41ea18: pop %rbp
0x00002aaaab41ea19: test %eax,-0x529a1f(%rip) # 0x00002aaaaaef5000
; {poll_return}
0x00002aaaab41ea1f: retq
[Exception Handler]
[Stub Code]
0x00002aaaab41ea20: jmpq 0x00002aaaab407360 ; {no_reloc}
[Deopt Handler Code]
0x00002aaaab41ea25: callq 0x00002aaaab41ea2a
0x00002aaaab41ea2a: subq $0x5,(%rsp)
0x00002aaaab41ea2f: jmpq 0x00002aaaab3f9460 ; {runtime_call}
0x00002aaaab41ea34: int3
0x00002aaaab41ea35: int3
0x00002aaaab41ea36: int3
0x00002aaaab41ea37: int3
Decoding compiled method 0x00002aaaab421b50:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'main' '([Ljava/lang/String;)V' in 'nerdscentral/LoopTest'
0x00002aaaab421d40: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab421d4a: rex.WB callq *%r10
0x00002aaaab421d4d: nop
0x00002aaaab421d4e: nop
0x00002aaaab421d4f: nop
0x00002aaaab421d50: mov %eax,-0x8000(%rsp)
0x00002aaaab421d57: push %rbp
0x00002aaaab421d58: sub $0x20,%rsp
0x00002aaaab421d5c: mov 0x18(%rsi),%rbx
0x00002aaaab421d60: rex mov 0x8(%rsi),%ebp
0x00002aaaab421d64: mov 0x10(%rsi),%r13d
0x00002aaaab421d68: mov %rsi,%rdi
0x00002aaaab421d6b: mov $0x2b7942997d20,%r10
0x00002aaaab421d75: callq *%r10 ;*iload
; - nerdscentral.LoopTest::main@110 (line 35)
0x00002aaaab421d78: mov %ebp,%r11d
0x00002aaaab421d7b: inc %r11d
0x00002aaaab421d7e: jmpq 0x00002aaaab421e1a
0x00002aaaab421d83: nop
0x00002aaaab421d84: nop
0x00002aaaab421d85: nop
0x00002aaaab421d86: nop
0x00002aaaab421d87: nop
0x00002aaaab421d88: nop
0x00002aaaab421d89: nop
0x00002aaaab421d8a: nop
0x00002aaaab421d8b: nop
0x00002aaaab421d8c: nop
0x00002aaaab421d8d: nop
0x00002aaaab421d8e: nop
0x00002aaaab421d8f: nop
0x00002aaaab421d90: mov $0xedc4c850,%r11 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421d9a: mov %r10,0x78(%r11) ;*getstatic count
; - nerdscentral.LoopTest::loop1@0 (line 45)
; - nerdscentral.LoopTest::main@117 (line 36)
0x00002aaaab421d9e: mov %r10,%r11
0x00002aaaab421da1: add $0x1e,%r11
0x00002aaaab421da5: mov $0xedc4c850,%r8 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421daf: mov %r11,0x78(%r8) ;*putstatic count
; - nerdscentral.LoopTest::main@125 (line 37)
0x00002aaaab421db3: add $0x10,%ebp ;*iinc
; - nerdscentral.LoopTest::main@128 (line 35)
0x00002aaaab421db6: add $0x20,%r10 ;*ladd
; - nerdscentral.LoopTest::main@124 (line 37)
0x00002aaaab421dba: cmp $0xf4232,%ebp
0x00002aaaab421dc0: jl 0x00002aaaab421d90 ;*if_icmpge
; - nerdscentral.LoopTest::main@114 (line 35)
0x00002aaaab421dc2: cmp $0xf4241,%ebp
0x00002aaaab421dc8: jge 0x00002aaaab421df6
0x00002aaaab421dca: mov $0xedc4c850,%r11 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421dd4: mov %r10,0x78(%r11) ;*iload
; - nerdscentral.LoopTest::main@110 (line 35)
0x00002aaaab421dd8: inc %ebp ;*iinc
; - nerdscentral.LoopTest::main@128 (line 35)
0x00002aaaab421dda: cmp $0xf4241,%ebp
0x00002aaaab421de0: jge 0x00002aaaab421df6 ;*if_icmpge
; - nerdscentral.LoopTest::main@114 (line 35)
0x00002aaaab421de2: add $0x2,%r10 ;*ladd
; - nerdscentral.LoopTest::main@124 (line 37)
0x00002aaaab421de6: mov $0xedc4c850,%r11 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421df0: mov %r10,0x78(%r11) ;*putstatic count
; - nerdscentral.LoopTest::main@125 (line 37)
0x00002aaaab421df4: jmp 0x00002aaaab421dd8 ;*goto
; - nerdscentral.LoopTest::main@137 (line 31)
0x00002aaaab421df6: inc %r13d ; OopMap{off=185}
;*goto
; - nerdscentral.LoopTest::main@137 (line 31)
0x00002aaaab421df9: test %eax,-0x52cdff(%rip) # 0x00002aaaaaef5000
;*goto
; - nerdscentral.LoopTest::main@137 (line 31)
; {poll}
0x00002aaaab421dff: cmp $0x2710,%r13d
0x00002aaaab421e06: jge 0x00002aaaab421e62 ;*if_icmpge
; - nerdscentral.LoopTest::main@94 (line 31)
0x00002aaaab421e08: cmp $0xa,%r13d
0x00002aaaab421e0c: je 0x00002aaaab422000 ;*iconst_0
; - nerdscentral.LoopTest::main@107 (line 35)
0x00002aaaab421e12: xor %ebp,%ebp
0x00002aaaab421e14: mov $0x1,%r11d
0x00002aaaab421e1a: mov $0xedc4c850,%r10 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421e24: mov 0x78(%r10),%r10 ;*iload
; - nerdscentral.LoopTest::main@110 (line 35)
0x00002aaaab421e28: add $0x2,%r10 ;*ladd
; - nerdscentral.LoopTest::main@124 (line 37)
0x00002aaaab421e2c: inc %ebp ;*iinc
; - nerdscentral.LoopTest::main@128 (line 35)
0x00002aaaab421e2e: cmp %r11d,%ebp
0x00002aaaab421e31: jge 0x00002aaaab421e43 ;*if_icmpge
; - nerdscentral.LoopTest::main@114 (line 35)
0x00002aaaab421e33: mov $0xedc4c850,%r8 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421e3d: mov %r10,0x78(%r8)
0x00002aaaab421e41: jmp 0x00002aaaab421e28
0x00002aaaab421e43: cmp $0xf4232,%ebp
0x00002aaaab421e49: jge 0x00002aaaab421dc2
0x00002aaaab421e4f: mov $0xedc4c850,%r11 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421e59: mov %r10,0x78(%r11) ;*putstatic count
; - nerdscentral.LoopTest::main@125 (line 37)
0x00002aaaab421e5d: jmpq 0x00002aaaab421d9e
0x00002aaaab421e62: mov $0xedc00d08,%r10 ; {oop(a 'java/lang/Class' = 'java/lang/System')}
0x00002aaaab421e6c: mov 0x74(%r10),%ebp ;*getstatic out
; - nerdscentral.LoopTest::main@140 (line 40)
0x00002aaaab421e70: mov 0x70(%r15),%rax
0x00002aaaab421e74: mov %rax,%r10
0x00002aaaab421e77: add $0x18,%r10
0x00002aaaab421e7b: cmp 0x80(%r15),%r10
0x00002aaaab421e82: jae 0x00002aaaab422015
0x00002aaaab421e88: mov %r10,0x70(%r15)
0x00002aaaab421e8c: prefetchnta 0x100(%r10)
0x00002aaaab421e94: mov $0xc4298420,%r11d ; {oop('java/lang/StringBuilder')}
0x00002aaaab421e9a: mov 0xb0(%r11),%r10
0x00002aaaab421ea1: mov %r10,(%rax)
0x00002aaaab421ea4: movl $0xc4298420,0x8(%rax) ; {oop('java/lang/StringBuilder')}
0x00002aaaab421eab: mov %r12d,0xc(%rax)
0x00002aaaab421eaf: mov %r12,0x10(%rax)
0x00002aaaab421eb3: mov %rbx,(%rsp)
0x00002aaaab421eb7: mov %rax,%r10
0x00002aaaab421eba: mov %r10,0x8(%rsp) ;*new ; - nerdscentral.LoopTest::main@143 (line 40)
0x00002aaaab421ebf: mov %r10,%rsi
0x00002aaaab421ec2: nop
0x00002aaaab421ec3: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop [8]=Oop off=392}
;*invokespecial <init>
; - nerdscentral.LoopTest::main@147 (line 40)
; {optimized virtual_call}
0x00002aaaab421ec8: mov $0xedc50a10,%rdx ; {oop("No Dispatch: ")}
0x00002aaaab421ed2: mov 0x8(%rsp),%rsi
0x00002aaaab421ed7: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=412}
;*invokevirtual append
; - nerdscentral.LoopTest::main@152 (line 40)
; {optimized virtual_call}
0x00002aaaab421edc: mov %rax,%rbx
0x00002aaaab421edf: mov $0x2b79428b5860,%r10
0x00002aaaab421ee9: callq *%r10 ;*invokestatic currentTimeMillis
; - nerdscentral.LoopTest::main@155 (line 40)
0x00002aaaab421eec: sub (%rsp),%rax ;*lsub
; - nerdscentral.LoopTest::main@159 (line 40)
0x00002aaaab421ef0: mov %rax,(%rsp)
0x00002aaaab421ef4: test %rbx,%rbx
0x00002aaaab421ef7: je 0x00002aaaab422041
0x00002aaaab421efd: mov %rbx,%rsi
0x00002aaaab421f00: mov %rax,%rdx
0x00002aaaab421f03: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=456}
;*invokevirtual append
; - nerdscentral.LoopTest::main@160 (line 40)
; {optimized virtual_call}
0x00002aaaab421f08: test %rax,%rax
0x00002aaaab421f0b: je 0x00002aaaab422059
0x00002aaaab421f11: mov %rax,%rsi
0x00002aaaab421f14: nop
0x00002aaaab421f15: nop
0x00002aaaab421f16: nop
0x00002aaaab421f17: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=476}
;*invokevirtual toString
; - nerdscentral.LoopTest::main@163 (line 40)
; {optimized virtual_call}
0x00002aaaab421f1c: mov %rax,(%rsp)
0x00002aaaab421f20: test %ebp,%ebp
0x00002aaaab421f22: je 0x00002aaaab422071 ;*invokevirtual println
; - nerdscentral.LoopTest::main@166 (line 40)
0x00002aaaab421f28: mov %rbp,%rsi ;*getstatic out
; - nerdscentral.LoopTest::main@140 (line 40)
0x00002aaaab421f2b: mov %rax,%rdx
0x00002aaaab421f2e: nop
0x00002aaaab421f2f: callq 0x00002aaaab3f7b20 ; OopMap{off=500}
;*invokevirtual println
; - nerdscentral.LoopTest::main@166 (line 40)
; {optimized virtual_call}
0x00002aaaab421f34: mov 0x70(%r15),%rax
0x00002aaaab421f38: mov $0xedc00d08,%r10 ; {oop(a 'java/lang/Class' = 'java/lang/System')}
0x00002aaaab421f42: mov 0x74(%r10),%ebp ;*getstatic out
; - nerdscentral.LoopTest::main@169 (line 41)
0x00002aaaab421f46: mov %rax,%r10
0x00002aaaab421f49: add $0x18,%r10
0x00002aaaab421f4d: cmp 0x80(%r15),%r10
0x00002aaaab421f54: jae 0x00002aaaab42202d
0x00002aaaab421f5a: mov %r10,0x70(%r15)
0x00002aaaab421f5e: prefetchnta 0x100(%r10)
0x00002aaaab421f66: mov $0xc4298420,%r10d ; {oop('java/lang/StringBuilder')}
0x00002aaaab421f6c: mov 0xb0(%r10),%r10
0x00002aaaab421f73: mov %r10,(%rax)
0x00002aaaab421f76: movl $0xc4298420,0x8(%rax) ; {oop('java/lang/StringBuilder')}
0x00002aaaab421f7d: mov %r12d,0xc(%rax)
0x00002aaaab421f81: mov %r12,0x10(%rax)
0x00002aaaab421f85: mov %rax,%r10
0x00002aaaab421f88: mov %r10,(%rsp) ;*new ; - nerdscentral.LoopTest::main@172 (line 41)
0x00002aaaab421f8c: mov %r10,%rsi
0x00002aaaab421f8f: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop [0]=Oop off=596}
;*invokespecial <init>
; - nerdscentral.LoopTest::main@176 (line 41)
; {optimized virtual_call}
0x00002aaaab421f94: mov $0xedc07028,%rdx ; {oop("")}
0x00002aaaab421f9e: mov (%rsp),%rsi
0x00002aaaab421fa2: nop
0x00002aaaab421fa3: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=616}
;*invokevirtual append
; - nerdscentral.LoopTest::main@181 (line 41)
; {optimized virtual_call}
0x00002aaaab421fa8: mov $0xedc4c850,%r10 ; {oop(a 'java/lang/Class' = 'nerdscentral/LoopTest')}
0x00002aaaab421fb2: mov 0x78(%r10),%rdx ;*getstatic count
; - nerdscentral.LoopTest::main@184 (line 41)
0x00002aaaab421fb6: test %rax,%rax
0x00002aaaab421fb9: je 0x00002aaaab422089
0x00002aaaab421fbf: mov %rax,%rsi
0x00002aaaab421fc2: nop
0x00002aaaab421fc3: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=648}
;*invokevirtual append
; - nerdscentral.LoopTest::main@187 (line 41)
; {optimized virtual_call}
0x00002aaaab421fc8: test %rax,%rax
0x00002aaaab421fcb: je 0x00002aaaab4220a5
0x00002aaaab421fd1: mov %rax,%rsi
0x00002aaaab421fd4: nop
0x00002aaaab421fd5: nop
0x00002aaaab421fd6: nop
0x00002aaaab421fd7: callq 0x00002aaaab3f7b20 ; OopMap{rbp=NarrowOop off=668}
;*invokevirtual toString
; - nerdscentral.LoopTest::main@190 (line 41)
; {optimized virtual_call}
0x00002aaaab421fdc: mov %rax,(%rsp)
0x00002aaaab421fe0: test %ebp,%ebp
0x00002aaaab421fe2: je 0x00002aaaab4220bd ;*invokevirtual println
; - nerdscentral.LoopTest::main@193 (line 41)
0x00002aaaab421fe8: mov %rbp,%rsi ;*getstatic out
; - nerdscentral.LoopTest::main@169 (line 41)
0x00002aaaab421feb: mov %rax,%rdx
0x00002aaaab421fee: nop
0x00002aaaab421fef: callq 0x00002aaaab3f7b20 ; OopMap{off=692}
;*invokevirtual println
; - nerdscentral.LoopTest::main@193 (line 41)
; {optimized virtual_call}
0x00002aaaab421ff4: add $0x20,%rsp
0x00002aaaab421ff8: pop %rbp
0x00002aaaab421ff9: test %eax,-0x52cfff(%rip) # 0x00002aaaaaef5000
; {poll_return}
0x00002aaaab421fff: retq ;*if_icmpge
; - nerdscentral.LoopTest::main@114 (line 35)
0x00002aaaab422000: mov $0x2b79428b5860,%r10
0x00002aaaab42200a: callq *%r10 ;*invokestatic currentTimeMillis
; - nerdscentral.LoopTest::main@103 (line 33)
0x00002aaaab42200d: mov %rax,%rbx
0x00002aaaab422010: jmpq 0x00002aaaab421e12
0x00002aaaab422015: mov %rbx,(%rsp) ;*if_icmpge
; - nerdscentral.LoopTest::main@94 (line 31)
0x00002aaaab422019: mov $0xc4298420,%rsi ; {oop('java/lang/StringBuilder')}
0x00002aaaab422023: callq 0x00002aaaab41e2e0 ; OopMap{rbp=NarrowOop off=744}
;*new ; - nerdscentral.LoopTest::main@143 (line 40)
; {runtime_call}
0x00002aaaab422028: jmpq 0x00002aaaab421eb7
0x00002aaaab42202d: mov $0xc4298420,%rsi ; {oop('java/lang/StringBuilder')}
0x00002aaaab422037: callq 0x00002aaaab41e2e0 ; OopMap{rbp=NarrowOop off=764}
;*new ; - nerdscentral.LoopTest::main@172 (line 41)
; {runtime_call}
0x00002aaaab42203c: jmpq 0x00002aaaab421f85
0x00002aaaab422041: mov $0xfffffff6,%esi
0x00002aaaab422046: nop
0x00002aaaab422047: callq 0x00002aaaab3f88e0 ; OopMap{rbp=NarrowOop off=780}
;*invokevirtual append
; - nerdscentral.LoopTest::main@160 (line 40)
; {runtime_call}
0x00002aaaab42204c: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab422056: rex.WB callq *%r10 ;*invokevirtual append
; - nerdscentral.LoopTest::main@160 (line 40)
0x00002aaaab422059: mov $0xfffffff6,%esi
0x00002aaaab42205e: nop
0x00002aaaab42205f: callq 0x00002aaaab3f88e0 ; OopMap{rbp=NarrowOop off=804}
;*invokevirtual toString
; - nerdscentral.LoopTest::main@163 (line 40)
; {runtime_call}
0x00002aaaab422064: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab42206e: rex.WB callq *%r10 ;*invokevirtual toString
; - nerdscentral.LoopTest::main@163 (line 40)
0x00002aaaab422071: mov $0xfffffff6,%esi
0x00002aaaab422076: nop
0x00002aaaab422077: callq 0x00002aaaab3f88e0 ; OopMap{[0]=Oop off=828}
;*invokevirtual println
; - nerdscentral.LoopTest::main@166 (line 40)
; {runtime_call}
0x00002aaaab42207c: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab422086: rex.WB callq *%r10 ;*invokevirtual println
; - nerdscentral.LoopTest::main@166 (line 40)
0x00002aaaab422089: mov $0xfffffff6,%esi
0x00002aaaab42208e: mov %rdx,(%rsp)
0x00002aaaab422092: nop
0x00002aaaab422093: callq 0x00002aaaab3f88e0 ; OopMap{rbp=NarrowOop off=856}
;*invokevirtual append
; - nerdscentral.LoopTest::main@187 (line 41)
; {runtime_call}
0x00002aaaab422098: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab4220a2: rex.WB callq *%r10 ;*invokevirtual append
; - nerdscentral.LoopTest::main@187 (line 41)
0x00002aaaab4220a5: mov $0xfffffff6,%esi
0x00002aaaab4220aa: nop
0x00002aaaab4220ab: callq 0x00002aaaab3f88e0 ; OopMap{rbp=NarrowOop off=880}
;*invokevirtual toString
; - nerdscentral.LoopTest::main@190 (line 41)
; {runtime_call}
0x00002aaaab4220b0: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab4220ba: rex.WB callq *%r10 ;*invokevirtual toString
; - nerdscentral.LoopTest::main@190 (line 41)
0x00002aaaab4220bd: mov $0xfffffff6,%esi
0x00002aaaab4220c2: nop
0x00002aaaab4220c3: callq 0x00002aaaab3f88e0 ; OopMap{[0]=Oop off=904}
;*invokevirtual println
; - nerdscentral.LoopTest::main@193 (line 41)
; {runtime_call}
0x00002aaaab4220c8: mov $0x2b79428b4cf0,%r10 ; {runtime_call}
0x00002aaaab4220d2: rex.WB callq *%r10 ;*new ; - nerdscentral.LoopTest::main@172 (line 41)
0x00002aaaab4220d5: mov %rax,%rsi
0x00002aaaab4220d8: jmp 0x00002aaaab42210f ;*iload
; - nerdscentral.LoopTest::main@110 (line 35)
0x00002aaaab4220da: mov %rax,%rsi
0x00002aaaab4220dd: jmp 0x00002aaaab42210f ;*invokevirtual println
; - nerdscentral.LoopTest::main@193 (line 41)
0x00002aaaab4220df: mov %rax,%rsi
0x00002aaaab4220e2: jmp 0x00002aaaab42210f ;*invokevirtual toString
; - nerdscentral.LoopTest::main@190 (line 41)
0x00002aaaab4220e4: mov %rax,%rsi
0x00002aaaab4220e7: jmp 0x00002aaaab42210f ;*invokevirtual append
; - nerdscentral.LoopTest::main@187 (line 41)
0x00002aaaab4220e9: mov %rax,%rsi
0x00002aaaab4220ec: jmp 0x00002aaaab42210f ;*invokevirtual append
; - nerdscentral.LoopTest::main@181 (line 41)
0x00002aaaab4220ee: mov %rax,%rsi
0x00002aaaab4220f1: jmp 0x00002aaaab42210f ;*invokespecial <init>
; - nerdscentral.LoopTest::main@176 (line 41)
0x00002aaaab4220f3: mov %rax,%rsi
0x00002aaaab4220f6: jmp 0x00002aaaab42210f ;*invokevirtual println
; - nerdscentral.LoopTest::main@166 (line 40)
0x00002aaaab4220f8: mov %rax,%rsi
0x00002aaaab4220fb: jmp 0x00002aaaab42210f ;*invokevirtual toString
; - nerdscentral.LoopTest::main@163 (line 40)
0x00002aaaab4220fd: mov %rax,%rsi
0x00002aaaab422100: jmp 0x00002aaaab42210f ;*invokevirtual append
; - nerdscentral.LoopTest::main@160 (line 40)
0x00002aaaab422102: mov %rax,%rsi
0x00002aaaab422105: jmp 0x00002aaaab42210f ;*invokevirtual append
; - nerdscentral.LoopTest::main@152 (line 40)
0x00002aaaab422107: mov %rax,%rsi
0x00002aaaab42210a: jmp 0x00002aaaab42210f
0x00002aaaab42210c: mov %rax,%rsi ;*invokespecial <init>
; - nerdscentral.LoopTest::main@147 (line 40)
0x00002aaaab42210f: add $0x20,%rsp
0x00002aaaab422113: pop %rbp
0x00002aaaab422114: jmpq 0x00002aaaab41dba0 ; {runtime_call}
0x00002aaaab422119: hlt
0x00002aaaab42211a: hlt
0x00002aaaab42211b: hlt
0x00002aaaab42211c: hlt
0x00002aaaab42211d: hlt
0x00002aaaab42211e: hlt
0x00002aaaab42211f: hlt
[Stub Code]
0x00002aaaab422120: mov $0x0,%rbx ; {no_reloc}
0x00002aaaab42212a: jmpq 0x00002aaaab42212a ; {runtime_call}
0x00002aaaab42212f: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422139: jmpq 0x00002aaaab422139 ; {runtime_call}
0x00002aaaab42213e: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422148: jmpq 0x00002aaaab422148 ; {runtime_call}
0x00002aaaab42214d: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422157: jmpq 0x00002aaaab422157 ; {runtime_call}
0x00002aaaab42215c: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422166: jmpq 0x00002aaaab422166 ; {runtime_call}
0x00002aaaab42216b: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422175: jmpq 0x00002aaaab422175 ; {runtime_call}
0x00002aaaab42217a: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422184: jmpq 0x00002aaaab422184 ; {runtime_call}
0x00002aaaab422189: mov $0x0,%rbx ; {static_stub}
0x00002aaaab422193: jmpq 0x00002aaaab422193 ; {runtime_call}
0x00002aaaab422198: mov $0x0,%rbx ; {static_stub}
0x00002aaaab4221a2: jmpq 0x00002aaaab4221a2 ; {runtime_call}
0x00002aaaab4221a7: mov $0x0,%rbx ; {static_stub}
0x00002aaaab4221b1: jmpq 0x00002aaaab4221b1 ; {runtime_call}
[Exception Handler]
0x00002aaaab4221b6: jmpq 0x00002aaaab407360 ; {runtime_call}
[Deopt Handler Code]
0x00002aaaab4221bb: callq 0x00002aaaab4221c0
0x00002aaaab4221c0: subq $0x5,(%rsp)
0x00002aaaab4221c5: jmpq 0x00002aaaab3f9460 ; {runtime_call}
0x00002aaaab4221ca: int3
0x00002aaaab4221cb: int3
0x00002aaaab4221cc: int3
0x00002aaaab4221cd: int3
0x00002aaaab4221ce: int3
0x00002aaaab4221cf: int3
No Dispatch: 1008
40000000000
{method}
VM option '+PrintOptoAssembly'
- klass: {other class}
- this oop: 0x00000000c4481d10
- method holder: 'nerdscentral/LoopTest'
- constants: 0x00000000c44814a8 constant pool [90] for 'nerdscentral/LoopTest' cache=0x00000000c4482c40
- access: 0x8100000a private static
- name: 'loop2'
- signature: '()V'
- max stack: 4
- max locals: 0
- size of params: 0
- method size: 17
- vtable index: -2
- i2i entry: 0x00002aaaab349ee0
- adapter: 0x0000000012eb0e78
- compiled entry 0x00002aaaab3f83a9
- code size: 12
- code start: 0x00000000c4481cf8
- code end (excl): 0x00000000c4481d04
- method data: 0x00000000c4483be8
- checked ex length: 0
- linenumber start: 0x00000000c4481d04
- localvar length: 0
#
# void ( )
#
# -- Old rsp -- Framesize: 32 --
#r089 rsp+28: pad2, in_preserve
#r088 rsp+24: pad2, in_preserve
#r087 rsp+20: pad2, in_preserve
#r086 rsp+16: pad2, in_preserve
#r085 rsp+12: pad2, in_preserve
#r084 rsp+ 8: return address
#r083 rsp+ 4: Fixed slot 1
#r082 rsp+ 0: Fixed slot 0
#
abababab N1: # B1 <- B1 Freq: 1
abababab
000 B1: # N1 <- BLOCK HEAD IS JUNK Freq: 1
000 pushq rbp
subq rsp, #16 # Create frame
nop # nop for patch_verified_entry
006 movq R10, java/lang/Class:exact * # ptr
010 incq [R10 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
014 movl R10, [R10 + #112 (8-bit)] # compressed ptr ! Field nerdscentral/LoopTest.ret
018 decode_heap_oop_not_null RSI,R10
01b addq rsp, 16 # Destroy frame
popq rbp
020 jmp rethrow_stub
020
{method}
- klass: {other class}
- this oop: 0x00000000c4481b48
- method holder: 'nerdscentral/LoopTest'
- constants: 0x00000000c44814a8 constant pool [90] for 'nerdscentral/LoopTest' cache=0x00000000c4482c40
- access: 0xc1000009 public static
- name: 'main'
- signature: '([Ljava/lang/String;)V'
- max stack: 6
- max locals: 6
- size of params: 1
- method size: 17
- vtable index: -2
- i2i entry: 0x00002aaaab349ee0
- adapter: 0x0000000012eb0e20
- compiled entry 0x00002aaaab3f876d
- code size: 197
- code start: 0x00000000c4481a08
- code end (excl): 0x00000000c4481acd
- method data: 0x00000000c4483730
- checked ex length: 0
- linenumber start: 0x00000000c4481acd
- localvar length: 7
- localvar start: 0x00000000c4481af2
#
# void ( rawptr:BotPTR )
#
#r018 rsi:rsi : parm 0: rawptr:BotPTR
# -- Old rsp -- Framesize: 32 --
#r089 rsp+28: pad2, in_preserve
#r088 rsp+24: pad2, in_preserve
#r087 rsp+20: pad2, in_preserve
#r086 rsp+16: pad2, in_preserve
#r085 rsp+12: pad2, in_preserve
#r084 rsp+ 8: return address
#r083 rsp+ 4: Fixed slot 1
#r082 rsp+ 0: Fixed slot 0
#
000 N148: # B1 <- BLOCK HEAD IS JUNK Freq: 1
000 INT3
nop # 3 bytes pad for loops and calls
010 B1: # B11 <- BLOCK HEAD IS JUNK Freq: 1
010 # stack bang
pushq rbp
subq rsp, #16 # Create frame
01c movq RBP, [RSI + #24 (8-bit)] # long
020 movl R13, [RSI + #8 (8-bit)] # int
024 movl RBX, [RSI + #16 (8-bit)] # int
027 movq RDI, RSI # spill
02a call_leaf,runtime OSR_migration_end
No JVM State Info
#
037 movq R10, java/lang/Class:exact * # ptr
041 jmp,s B11
nop # 13 bytes pad for loops and calls
050 B2: # B3 <- B3 top-of-loop Freq: 4.93447e+11
050 movq [R10 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
050
054 B3: # B2 B4 <- B15 B2 Loop: B3-B2 inner main of N55 Freq: 4.93447e+11
054 movq R8, R11 # spill
057 addq R8, #30 # long
05b movq [R10 + #120 (8-bit)], R8 # long ! Field nerdscentral/LoopTest.count
05f addl R13, #16 # int
063 addq R11, #32 # long
067 cmpl R13, #999986
06e jl,s B2 # loop end P=1.000000 C=11310.000000
06e
070 B4: # B8 B5 <- B14 B3 Freq: 493448
070 cmpl R13, #1000001
077 jge,s B8 P=0.500000 C=-1.000000
077
079 B5: # B6 <- B4 Freq: 246724
079 movq [R10 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
nop # 3 bytes pad for loops and calls
080 B6: # B8 B7 <- B5 B7 Loop: B6-B7 inner post of N206 Freq: 493448
080 incl R13 # int
083 cmpl R13, #1000001
08a jge,s B8 # loop end P=0.500000 C=11310.000000
08a
08c B7: # B6 <- B6 Freq: 246724
08c addq R11, #2 # long
090 movq [R10 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
094 jmp,s B6
094
096 B8: # B16 B9 <- B6 B4 Freq: 493448
096 incl RBX # int
098 cmpl RBX, #10000
09e jge,s B16 P=0.000001 C=-1.000000
09e
0a0 B9: # B17 B10 <- B8 Freq: 493447
0a0 cmpl RBX, #10
0a3 je,s B17 # loop end P=0.000001 C=-1.000000
0a3
0a5 B10: # B11 <- B9 Freq: 493447
0a5 xorl R13, R13 # int
0a8
0a8 B11: # B12 <- B1 B10 Loop: B11-B10 Freq: 493448
0a8 movq R11, [R10 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
0ac movl R9, R13 # spill
0af incl R9 # int
0b2
0b2 B12: # B14 B13 <- B11 B13 Loop: B12-B13 inner pre of N206 Freq: 986896
0b2 addq R11, #2 # long
0b6 incl R13 # int
0b9 cmpl R13, R9
0bc jge,s B14 # loop end P=0.500000 C=11310.000000
0bc
0be B13: # B12 <- B12 Freq: 493448
0be movq [R10 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
0c2 jmp,s B12
0c2
0c4 B14: # B4 B15 <- B12 Freq: 493448
0c4 cmpl R13, #999986
0cb jge,s B4 P=0.000001 C=-1.000000
0cb
0cd B15: # B3 <- B14 Freq: 493447
0cd movq [R10 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
0d1 jmp B3
0d1
0d6 B16: # N148 <- B8 Freq: 0.5
0d6 movl RSI, #56 # int
0db call,static wrapper for: uncommon_trap(reason='unloaded' action='reinterpret' index='56')
# nerdscentral.LoopTest::main @ bci:59 L[0]=_ L[1]=RBP L[2]=_ L[3]=_ L[4]=_ L[5]=_
# OopMap{off=224}
0e0 int3 # ShouldNotReachHere
0e0
0ed B17: # N148 <- B9 Freq: 0.5
0ed movl RSI, #56 # int
0f2 nop # 1 bytes pad for loops and calls
0f3 call,static wrapper for: uncommon_trap(reason='unloaded' action='reinterpret' index='56')
# nerdscentral.LoopTest::main @ bci:17 L[0]=_ L[1]=_ L[2]=_ L[3]=#10 L[4]=_ L[5]=_
# OopMap{off=248}
0f8 int3 # ShouldNotReachHere
0f8
{method}
- klass: {other class}
- this oop: 0x00000000c4481b48
- method holder: 'nerdscentral/LoopTest'
- constants: 0x00000000c44814a8 constant pool [90] for 'nerdscentral/LoopTest' cache=0x00000000c4482c40
- access: 0xc1000009 public static
- name: 'main'
- signature: '([Ljava/lang/String;)V'
- max stack: 6
- max locals: 6
- size of params: 1
- method size: 17
- vtable index: -2
- i2i entry: 0x00002aaaab349ee0
- adapter: 0x0000000012eb0e20
- compiled entry 0x00002aaaab3f876d
- code size: 197
- code start: 0x00000000c4481a08
- code end (excl): 0x00000000c4481acd
- method data: 0x00000000c4483730
- checked ex length: 0
- linenumber start: 0x00000000c4481acd
- localvar length: 7
- localvar start: 0x00000000c4481af2
#
# void ( rawptr:BotPTR )
#
#r018 rsi:rsi : parm 0: rawptr:BotPTR
# -- Old rsp -- Framesize: 48 --
#r089 rsp+44: pad2, in_preserve
#r088 rsp+40: pad2, in_preserve
#r087 rsp+36: pad2, in_preserve
#r086 rsp+32: pad2, in_preserve
#r085 rsp+28: pad2, in_preserve
#r084 rsp+24: return address
#r083 rsp+20: Fixed slot 1
#r082 rsp+16: Fixed slot 0
#r093 rsp+12: spill
#r092 rsp+ 8: spill
#r091 rsp+ 4: spill
#r090 rsp+ 0: spill
#
000 N176: # B1 <- BLOCK HEAD IS JUNK Freq: 1
000 INT3
nop # 3 bytes pad for loops and calls
010 B1: # B11 <- BLOCK HEAD IS JUNK Freq: 1
010 # stack bang
pushq rbp
subq rsp, #32 # Create frame
01c movq RBX, [RSI + #24 (8-bit)] # long
020 movl RBP, [RSI + #8 (8-bit)] # int
024 movl R14, [RSI + #16 (8-bit)] # int
028 movq RDI, RSI # spill
02b call_leaf,runtime OSR_migration_end
No JVM State Info
#
038 movl R10, RBP # spill
03b incl R10 # int
03e movq R13, java/lang/Class:exact * # ptr
048 jmp B11
nop # 3 bytes pad for loops and calls
050 B2: # B3 <- B3 top-of-loop Freq: 9.99998e+06
050 movq [R13 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
050
054 B3: # B2 B4 <- B15 B2 Loop: B3-B2 inner main of N70 Freq: 9.99999e+06
054 movq R10, R11 # spill
057 addq R10, #30 # long
05b movq [R13 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
05f addl RBP, #16 # int
062 addq R11, #32 # long
066 cmpl RBP, #999986
06c jl,s B2 # loop end P=1.000000 C=18470.000000
06c
06e B4: # B8 B5 <- B14 B3 Freq: 10
06e cmpl RBP, #1000001
074 jge,s B8 P=0.500000 C=-1.000000
074
076 B5: # B6 <- B4 Freq: 5
076 movq [R13 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
nop # 2 bytes pad for loops and calls
07c B6: # B8 B7 <- B5 B7 Loop: B6-B7 inner post of N236 Freq: 10
07c incl RBP # int
07e cmpl RBP, #1000001
084 jge,s B8 # loop end P=0.500000 C=18470.000000
084
086 B7: # B6 <- B6 Freq: 5
086 addq R11, #2 # long
08a movq [R13 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
08e jmp,s B6
08e
090 B8: # B16 B9 <- B6 B4 Freq: 10
090 incl R14 # int
093 testl rax, [rip + #offset_to_poll_page] # Safepoint: poll for GC # nerdscentral.LoopTest::main @ bci:56 L[0]=_ L[1]=RBX L[2]=_ L[3]=R14 L[4]=_ L[5]=_
# OopMap{r13=Oop off=147}
099 cmpl R14, #10000
0a0 jge,s B16 P=0.100000 C=-1.000000
0a0
0a2 B9: # B18 B10 <- B8 Freq: 9
0a2 cmpl R14, #10
0a6 je,s B18 P=0.100000 C=-1.000000
0a6
0a8 B10: # B11 <- B18 B9 Freq: 9
0a8 xorl RBP, RBP # int
0aa movl R10, #1 # int
0aa
0b0 B11: # B12 <- B1 B10 Loop: B11-B10 Freq: 10
0b0 movq R11, [R13 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
0b0
0b4 B12: # B14 B13 <- B11 B13 Loop: B12-B13 inner pre of N236 Freq: 20
0b4 addq R11, #2 # long
0b8 incl RBP # int
0ba cmpl RBP, R10
0bd jge,s B14 # loop end P=0.500000 C=18470.000000
0bd
0bf B13: # B12 <- B12 Freq: 10
0bf movq [R13 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
0c3 jmp,s B12
0c3
0c5 B14: # B4 B15 <- B12 Freq: 10
0c5 cmpl RBP, #999986
0cb jge,s B4 P=0.000001 C=-1.000000
0cb
0cd B15: # B3 <- B14 Freq: 9.99999
0cd movq [R13 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
0d1 jmp B3
0d1
0d6 B16: # B19 B17 <- B8 Freq: 1
0d6 movq R10, java/lang/Class:exact * # ptr
0e0 movl RBP, [R10 + #116 (8-bit)] # compressed ptr ! Field java/lang/System.out
0e4 testl RBP, RBP # compressed ptr
0e6 je,s B19 P=0.000001 C=-1.000000
0e6
0e8 B17: # N176 <- B16 Freq: 0.999999
0e8 movl RSI, #-20 # int
0ed movq [rsp + #0], RBX # spill
0f1 nop # 2 bytes pad for loops and calls
0f3 call,static wrapper for: uncommon_trap(reason='null_assert' action='make_not_entrant')
# nerdscentral.LoopTest::main @ bci:62 L[0]=_ L[1]=rsp + #0 L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=248}
0f8 int3 # ShouldNotReachHere
0f8
105 B18: # B10 <- B9 Freq: 0.9
105 call_leaf,runtime currentTimeMillis
No JVM State Info
#
112 movq RBX, RAX # spill
115 jmp B10
115
11a B19: # N176 <- B16 Freq: 1.01328e-06
11a movl RSI, #8 # int
11f movq RBP, RBX # spill
122 nop # 1 bytes pad for loops and calls
123 call,static wrapper for: uncommon_trap(reason='unloaded' action='reinterpret' index='8')
# nerdscentral.LoopTest::main @ bci:62 L[0]=_ L[1]=RBP L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=#NULL
# OopMap{off=296}
128 int3 # ShouldNotReachHere
128
Dispatch: 822
{method}
- klass: {other class}
- this oop: 0x00000000c4481c28
- method holder: 'nerdscentral/LoopTest'
- constants: 0x00000000c44814a8 constant pool [90] for 'nerdscentral/LoopTest' cache=0x00000000c4482c40
- access: 0x8100000a private static
- name: 'loop1'
- signature: '()V'
- max stack: 4
- max locals: 0
- size of params: 0
- method size: 17
- vtable index: -2
- i2i entry: 0x00002aaaab349ee0
- adapter: 0x0000000012eb0e78
- compiled entry 0x00002aaaab3f83a9
- code size: 9
- code start: 0x00000000c4481c18
- code end (excl): 0x00000000c4481c21
- method data: 0x00000000c4483c88
- checked ex length: 0
- linenumber start: 0x00000000c4481c21
- localvar length: 0
#
# void ( )
#
# -- Old rsp -- Framesize: 32 --
#r089 rsp+28: pad2, in_preserve
#r088 rsp+24: pad2, in_preserve
#r087 rsp+20: pad2, in_preserve
#r086 rsp+16: pad2, in_preserve
#r085 rsp+12: pad2, in_preserve
#r084 rsp+ 8: return address
#r083 rsp+ 4: Fixed slot 1
#r082 rsp+ 0: Fixed slot 0
#
abababab N1: # B1 <- B1 Freq: 1
abababab
000 B1: # N1 <- BLOCK HEAD IS JUNK Freq: 1
000 pushq rbp
subq rsp, #16 # Create frame
nop # nop for patch_verified_entry
006 movq R10, java/lang/Class:exact * # ptr
010 incq [R10 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
014 addq rsp, 16 # Destroy frame
popq rbp
testl rax, [rip + #offset_to_poll_page] # Safepoint: poll for GC
01f ret
01f
{method}
- klass: {other class}
- this oop: 0x00000000c4481b48
- method holder: 'nerdscentral/LoopTest'
- constants: 0x00000000c44814a8 constant pool [90] for 'nerdscentral/LoopTest' cache=0x00000000c4482c40
- access: 0xc1000009 public static
- name: 'main'
- signature: '([Ljava/lang/String;)V'
- max stack: 6
- max locals: 6
- size of params: 1
- method size: 17
- vtable index: -2
- i2i entry: 0x00002aaaab349ee0
- adapter: 0x0000000012eb0e20
- compiled entry 0x00002aaaab3f876d
- code size: 197
- code start: 0x00000000c4481a08
- code end (excl): 0x00000000c4481acd
- method data: 0x00000000c4483730
- checked ex length: 0
- linenumber start: 0x00000000c4481acd
- localvar length: 7
- localvar start: 0x00000000c4481af2
#
# void ( rawptr:BotPTR )
#
#r018 rsi:rsi : parm 0: rawptr:BotPTR
# -- Old rsp -- Framesize: 48 --
#r089 rsp+44: pad2, in_preserve
#r088 rsp+40: pad2, in_preserve
#r087 rsp+36: pad2, in_preserve
#r086 rsp+32: pad2, in_preserve
#r085 rsp+28: pad2, in_preserve
#r084 rsp+24: return address
#r083 rsp+20: Fixed slot 1
#r082 rsp+16: Fixed slot 0
#r093 rsp+12: spill
#r092 rsp+ 8: spill
#r091 rsp+ 4: spill
#r090 rsp+ 0: spill
#
000 N560: # B1 <- BLOCK HEAD IS JUNK Freq: 1
000 INT3
nop # 3 bytes pad for loops and calls
010 B1: # B11 <- BLOCK HEAD IS JUNK Freq: 1
010 # stack bang
pushq rbp
subq rsp, #32 # Create frame
01c movq RBX, [RSI + #24 (8-bit)] # long
020 movl RBP, [RSI + #8 (8-bit)] # int
024 movl R13, [RSI + #16 (8-bit)] # int
028 movq RDI, RSI # spill
02b call_leaf,runtime OSR_migration_end
No JVM State Info
#
038 movl R11, RBP # spill
03b incl R11 # int
03e jmp B11
nop # 13 bytes pad for loops and calls
050 B2: # B3 <- B3 top-of-loop Freq: 9.99998e+06
050 movq R11, java/lang/Class:exact * # ptr
05a movq [R11 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
05a
05e B3: # B2 B4 <- B15 B2 Loop: B3-B2 inner main of N80 Freq: 9.99999e+06
05e movq R11, R10 # spill
061 addq R11, #30 # long
065 movq R8, java/lang/Class:exact * # ptr
06f movq [R8 + #120 (8-bit)], R11 # long ! Field nerdscentral/LoopTest.count
073 addl RBP, #16 # int
076 addq R10, #32 # long
07a cmpl RBP, #999986
080 jl,s B2 # loop end P=1.000000 C=24188.000000
080
082 B4: # B8 B5 <- B14 B3 Freq: 10
082 cmpl RBP, #1000001
088 jge,s B8 P=0.500000 C=-1.000000
088
08a B5: # B6 <- B4 Freq: 5
08a movq R11, java/lang/Class:exact * # ptr
094 movq [R11 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
094
098 B6: # B8 B7 <- B5 B7 Loop: B6-B7 inner post of N521 Freq: 10
098 incl RBP # int
09a cmpl RBP, #1000001
0a0 jge,s B8 # loop end P=0.500000 C=24188.000000
0a0
0a2 B7: # B6 <- B6 Freq: 5
0a2 addq R10, #2 # long
0a6 movq R11, java/lang/Class:exact * # ptr
0b0 movq [R11 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
0b4 jmp,s B6
0b4
0b6 B8: # B16 B9 <- B6 B4 Freq: 10
0b6 incl R13 # int
0b9 testl rax, [rip + #offset_to_poll_page] # Safepoint: poll for GC # nerdscentral.LoopTest::main @ bci:137 L[0]=_ L[1]=RBX L[2]=_ L[3]=R13 L[4]=_ L[5]=_
# OopMap{off=185}
0bf cmpl R13, #10000
0c6 jge,s B16 P=0.100000 C=-1.000000
0c6
0c8 B9: # B37 B10 <- B8 Freq: 9
0c8 cmpl R13, #10
0cc je B37 P=0.100000 C=-1.000000
0cc
0d2 B10: # B11 <- B37 B9 Freq: 9
0d2 xorl RBP, RBP # int
0d4 movl R11, #1 # int
0d4
0da B11: # B12 <- B1 B10 Loop: B11-B10 Freq: 10
0da movq R10, java/lang/Class:exact * # ptr
0e4 movq R10, [R10 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
0e4
0e8 B12: # B14 B13 <- B11 B13 Loop: B12-B13 inner pre of N521 Freq: 20
0e8 addq R10, #2 # long
0ec incl RBP # int
0ee cmpl RBP, R11
0f1 jge,s B14 # loop end P=0.500000 C=24188.000000
0f1
0f3 B13: # B12 <- B12 Freq: 10
0f3 movq R8, java/lang/Class:exact * # ptr
0fd movq [R8 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
101 jmp,s B12
101
103 B14: # B4 B15 <- B12 Freq: 10
103 cmpl RBP, #999986
109 jge B4 P=0.000001 C=-1.000000
109
10f B15: # B3 <- B14 Freq: 9.99999
10f movq R11, java/lang/Class:exact * # ptr
119 movq [R11 + #120 (8-bit)], R10 # long ! Field nerdscentral/LoopTest.count
11d jmp B3
11d
122 B16: # B38 B17 <- B8 Freq: 1
122 movq R10, java/lang/Class:exact * # ptr
12c movl RBP, [R10 + #116 (8-bit)] # compressed ptr ! Field java/lang/System.out
130 # TLS is in R15
130 movq RAX, [R15 + #112 (8-bit)] # ptr
134 movq R10, RAX # spill
137 addq R10, #24 # ptr
13b # TLS is in R15
13b cmpq R10, [R15 + #128 (32-bit)] # raw ptr
142 jnb,u B38 P=0.000100 C=-1.000000
142
148 B17: # B18 <- B16 Freq: 0.9999
148 # TLS is in R15
148 movq [R15 + #112 (8-bit)], R10 # ptr
14c PREFETCHNTA [R10 + #256 (32-bit)] # Prefetch to non-temporal cache for write
154 movl R11, narrowoop: precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # compressed ptr
15a movq R10, [R11 + #176 (32-bit)] # ptr
161 movq [RAX], R10 # ptr
164 movl [RAX + #8 (8-bit)], narrowoop: precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # compressed ptr
16b movl [RAX + #12 (8-bit)], R12 # int (R12_heapbase==0)
16f movq [RAX + #16 (8-bit)], R12 # long (R12_heapbase==0)
173 movq [rsp + #0], RBX # spill
173
177 B18: # B59 B19 <- B39 B17 Freq: 1
177
177 movq R10, RAX # spill
17a # checkcastPP of R10
17a movq [rsp + #8], R10 # spill
17f movq RSI, R10 # spill
182 nop # 1 bytes pad for loops and calls
183 call,static java.lang.StringBuilder::<init>
# nerdscentral.LoopTest::main @ bci:147 L[0]=_ L[1]=rsp + #0 L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=rsp + #8
# OopMap{rbp=NarrowOop [8]=Oop off=392}
188
188 B19: # B58 B20 <- B18 Freq: 0.99998
# Block is sole successor of call
188 movq RDX, java/lang/String:exact * # ptr
192 movq RSI, [rsp + #8] # spill
197 call,static java.lang.StringBuilder::append
# nerdscentral.LoopTest::main @ bci:152 L[0]=_ L[1]=rsp + #0 L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=412}
19c
19c B20: # B42 B21 <- B19 Freq: 0.99996
# Block is sole successor of call
19c movq RBX, RAX # spill
19f call_leaf,runtime currentTimeMillis
No JVM State Info
#
1ac subq RAX, [RSP + #0 (32-bit)] # long
1b0 movq [rsp + #0], RAX # spill
1b4 testq RBX, RBX # ptr
1b7 je B42 P=0.000001 C=-1.000000
1b7
1bd B21: # B57 B22 <- B20 Freq: 0.999959
1bd movq RSI, RBX # spill
1c0 movq RDX, RAX # spill
1c3 call,static java.lang.StringBuilder::append
# nerdscentral.LoopTest::main @ bci:160 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=456}
1c8
1c8 B22: # B43 B23 <- B21 Freq: 0.999939
# Block is sole successor of call
1c8 testq RAX, RAX # ptr
1cb je B43 P=0.000001 C=-1.000000
1cb
1d1 B23: # B56 B24 <- B22 Freq: 0.999938
1d1 movq RSI, RAX # spill
1d4 nop # 3 bytes pad for loops and calls
1d7 call,static java.lang.StringBuilder::toString
# nerdscentral.LoopTest::main @ bci:163 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=476}
1dc
1dc B24: # B44 B25 <- B23 Freq: 0.999918
# Block is sole successor of call
1dc movq [rsp + #0], RAX # spill
1e0 testl RBP, RBP # compressed ptr
1e2 je B44 P=0.000001 C=-1.000000
1e2
1e8 B25: # B55 B26 <- B24 Freq: 0.999917
1e8 decode_heap_oop_not_null RSI,RBP
1eb movq RDX, RAX # spill
1ee nop # 1 bytes pad for loops and calls
1ef call,static java.io.PrintStream::println
# nerdscentral.LoopTest::main @ bci:166 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_
# OopMap{off=500}
1f4
1f4 B26: # B40 B27 <- B25 Freq: 0.999897
# Block is sole successor of call
1f4 # TLS is in R15
1f4 movq RAX, [R15 + #112 (8-bit)] # ptr
1f8 movq R10, java/lang/Class:exact * # ptr
202 movl RBP, [R10 + #116 (8-bit)] # compressed ptr ! Field java/lang/System.out
206 movq R10, RAX # spill
209 addq R10, #24 # ptr
20d # TLS is in R15
20d cmpq R10, [R15 + #128 (32-bit)] # raw ptr
214 jnb,u B40 P=0.000100 C=-1.000000
214
21a B27: # B28 <- B26 Freq: 0.999797
21a # TLS is in R15
21a movq [R15 + #112 (8-bit)], R10 # ptr
21e PREFETCHNTA [R10 + #256 (32-bit)] # Prefetch to non-temporal cache for write
226 movl R10, narrowoop: precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # compressed ptr
22c movq R10, [R10 + #176 (32-bit)] # ptr
233 movq [RAX], R10 # ptr
236 movl [RAX + #8 (8-bit)], narrowoop: precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # compressed ptr
23d movl [RAX + #12 (8-bit)], R12 # int (R12_heapbase==0)
241 movq [RAX + #16 (8-bit)], R12 # long (R12_heapbase==0)
241
245 B28: # B54 B29 <- B41 B27 Freq: 0.999897
245
245 movq R10, RAX # spill
248 # checkcastPP of R10
248 movq [rsp + #0], R10 # spill
24c movq RSI, R10 # spill
24f call,static java.lang.StringBuilder::<init>
# nerdscentral.LoopTest::main @ bci:176 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=rsp + #0
# OopMap{rbp=NarrowOop [0]=Oop off=596}
254
254 B29: # B53 B30 <- B28 Freq: 0.999877
# Block is sole successor of call
254 movq RDX, java/lang/String:exact * # ptr
25e movq RSI, [rsp + #0] # spill
262 nop # 1 bytes pad for loops and calls
263 call,static java.lang.StringBuilder::append
# nerdscentral.LoopTest::main @ bci:181 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=616}
268
268 B30: # B45 B31 <- B29 Freq: 0.999857
# Block is sole successor of call
268 movq R10, java/lang/Class:exact * # ptr
272 movq RDX, [R10 + #120 (8-bit)] # long ! Field nerdscentral/LoopTest.count
276 testq RAX, RAX # ptr
279 je B45 P=0.000001 C=-1.000000
279
27f B31: # B52 B32 <- B30 Freq: 0.999856
27f movq RSI, RAX # spill
282 nop # 1 bytes pad for loops and calls
283 call,static java.lang.StringBuilder::append
# nerdscentral.LoopTest::main @ bci:187 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=648}
288
288 B32: # B46 B33 <- B31 Freq: 0.999836
# Block is sole successor of call
288 testq RAX, RAX # ptr
28b je B46 P=0.000001 C=-1.000000
28b
291 B33: # B51 B34 <- B32 Freq: 0.999835
291 movq RSI, RAX # spill
294 nop # 3 bytes pad for loops and calls
297 call,static java.lang.StringBuilder::toString
# nerdscentral.LoopTest::main @ bci:190 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=668}
29c
29c B34: # B47 B35 <- B33 Freq: 0.999815
# Block is sole successor of call
29c movq [rsp + #0], RAX # spill
2a0 testl RBP, RBP # compressed ptr
2a2 je B47 P=0.000001 C=-1.000000
2a2
2a8 B35: # B50 B36 <- B34 Freq: 0.999814
2a8 decode_heap_oop_not_null RSI,RBP
2ab movq RDX, RAX # spill
2ae nop # 1 bytes pad for loops and calls
2af call,static java.io.PrintStream::println
# nerdscentral.LoopTest::main @ bci:193 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_
# OopMap{off=692}
2b4
2b4 B36: # N560 <- B35 Freq: 0.999794
# Block is sole successor of call
2b4 addq rsp, 32 # Destroy frame
popq rbp
testl rax, [rip + #offset_to_poll_page] # Safepoint: poll for GC
2bf ret
2bf
2c0 B37: # B10 <- B9 Freq: 0.9
2c0 call_leaf,runtime currentTimeMillis
No JVM State Info
#
2cd movq RBX, RAX # spill
2d0 jmp B10
2d0
2d5 B38: # B49 B39 <- B16 Freq: 0.000100017
2d5 movq [rsp + #0], RBX # spill
2d9 movq RSI, precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # ptr
2e3 call,static wrapper for: _new_instance_Java
# nerdscentral.LoopTest::main @ bci:143 L[0]=_ L[1]=rsp + #0 L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=744}
2e8
2e8 B39: # B18 <- B38 Freq: 0.000100015
# Block is sole successor of call
2e8 jmp B18
2e8
2ed B40: # B48 B41 <- B26 Freq: 0.000100006
2ed movq RSI, precise klass java/lang/StringBuilder: 0x0000000012e5cc98:Constant:exact * # ptr
2f7 call,static wrapper for: _new_instance_Java
# nerdscentral.LoopTest::main @ bci:172 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP
# OopMap{rbp=NarrowOop off=764}
2fc
2fc B41: # B28 <- B40 Freq: 0.000100004
# Block is sole successor of call
2fc jmp B28
2fc
301 B42: # N560 <- B20 Freq: 1.01324e-06
301 movl RSI, #-10 # int
306 nop # 1 bytes pad for loops and calls
307 call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:160 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=#NULL STK[2]=rsp + #0 STK[3]=_
# OopMap{rbp=NarrowOop off=780}
30c int3 # ShouldNotReachHere
30c
319 B43: # N560 <- B22 Freq: 1.01322e-06
319 movl RSI, #-10 # int
31e nop # 1 bytes pad for loops and calls
31f call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:163 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=#NULL
# OopMap{rbp=NarrowOop off=804}
324 int3 # ShouldNotReachHere
324
331 B44: # N560 <- B24 Freq: 1.0132e-06
331 movl RSI, #-10 # int
336 nop # 1 bytes pad for loops and calls
337 call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:166 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=#NULL STK[1]=rsp + #0
# OopMap{[0]=Oop off=828}
33c int3 # ShouldNotReachHere
33c
349 B45: # N560 <- B30 Freq: 1.01313e-06
349 movl RSI, #-10 # int
34e movq [rsp + #0], RDX # spill
352 nop # 1 bytes pad for loops and calls
353 call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:187 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=#NULL STK[2]=rsp + #0 STK[3]=_
# OopMap{rbp=NarrowOop off=856}
358 int3 # ShouldNotReachHere
358
365 B46: # N560 <- B32 Freq: 1.01311e-06
365 movl RSI, #-10 # int
36a nop # 1 bytes pad for loops and calls
36b call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:190 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=RBP STK[1]=#NULL
# OopMap{rbp=NarrowOop off=880}
370 int3 # ShouldNotReachHere
370
37d B47: # N560 <- B34 Freq: 1.01309e-06
37d movl RSI, #-10 # int
382 nop # 1 bytes pad for loops and calls
383 call,static wrapper for: uncommon_trap(reason='null_check' action='maybe_recompile')
# nerdscentral.LoopTest::main @ bci:193 L[0]=_ L[1]=_ L[2]=_ L[3]=_ L[4]=_ L[5]=_ STK[0]=#NULL STK[1]=rsp + #0
# OopMap{[0]=Oop off=904}
388 int3 # ShouldNotReachHere
388
395 B48: # B60 <- B40 Freq: 1.00006e-09
395 # exception oop is in rax; no code emitted
395 movq RSI, RAX # spill
398 jmp,s B60
398
39a B49: # B60 <- B38 Freq: 1.00017e-09
39a # exception oop is in rax; no code emitted
39a movq RSI, RAX # spill
39d jmp,s B60
39d
39f B50: # B60 <- B35 Freq: 9.99814e-06
39f # exception oop is in rax; no code emitted
39f movq RSI, RAX # spill
3a2 jmp,s B60
3a2
3a4 B51: # B60 <- B33 Freq: 9.99835e-06
3a4 # exception oop is in rax; no code emitted
3a4 movq RSI, RAX # spill
3a7 jmp,s B60
3a7
3a9 B52: # B60 <- B31 Freq: 9.99856e-06
3a9 # exception oop is in rax; no code emitted
3a9 movq RSI, RAX # spill
3ac jmp,s B60
3ac
3ae B53: # B60 <- B29 Freq: 9.99877e-06
3ae # exception oop is in rax; no code emitted
3ae movq RSI, RAX # spill
3b1 jmp,s B60
3b1
3b3 B54: # B60 <- B28 Freq: 9.99897e-06
3b3 # exception oop is in rax; no code emitted
3b3 movq RSI, RAX # spill
3b6 jmp,s B60
3b6
3b8 B55: # B60 <- B25 Freq: 9.99917e-06
3b8 # exception oop is in rax; no code emitted
3b8 movq RSI, RAX # spill
3bb jmp,s B60
3bb
3bd B56: # B60 <- B23 Freq: 9.99938e-06
3bd # exception oop is in rax; no code emitted
3bd movq RSI, RAX # spill
3c0 jmp,s B60
3c0
3c2 B57: # B60 <- B21 Freq: 9.99959e-06
3c2 # exception oop is in rax; no code emitted
3c2 movq RSI, RAX # spill
3c5 jmp,s B60
3c5
3c7 B58: # B60 <- B19 Freq: 9.9998e-06
3c7 # exception oop is in rax; no code emitted
3c7 movq RSI, RAX # spill
3ca jmp,s B60
3ca
3cc B59: # B60 <- B18 Freq: 1e-05
3cc # exception oop is in rax; no code emitted
3cc movq RSI, RAX # spill
3cc
3cf B60: # N560 <- B59 B58 B57 B56 B55 B54 B53 B52 B51 B50 B49 B48 Freq: 9.99927e-05
3cf addq rsp, 32 # Destroy frame
popq rbp
3d4 jmp rethrow_stub
3d4
No Dispatch: 1008
40000000000
$ java -cp . -XX:+PrintCompilation -XX:+PrintInlining -XX:+TraceDeoptimization nerdscentral.LoopTest
VM option '+PrintCompilation'
VM option '+PrintInlining'
VM option '+TraceDeoptimization'
508 1 nerdscentral.LoopTest::loop2 (12 bytes)
561 1 % ! nerdscentral.LoopTest::main @ 24 (197 bytes)
@ 31 nerdscentral.LoopTest::loop2 (12 bytes) inline (hot)
Uncommon trap occurred in nerdscentral.LoopTest::main (@0x00002aaaab41f498) thread=1101379904 reason=unloaded action=reinterpret unloaded_class_index=56 unresolved class: java/lang/System
580 1 % ! nerdscentral.LoopTest::main @ -2 (197 bytes) made not entrant
DEOPT PACKING thread 0x0000000014a4a800 Compiled frame (sp=0x0000000041a5aa30 unextended sp=0x0000000041a5aa30, fp=0x0000000000000000, pc=0x00002aaaab41f498)
nmethod 581 1 % ! nerdscentral.LoopTest::main @ -2 (197 bytes)
Virtual frames (innermost first):
0 - frame( sp=0x0000000041a5aa30, unextended_sp=0x0000000041a5aa30, fp=0x0000000000000000, pc=0x00002aaaab41f498)
nerdscentral.LoopTest.main(LoopTest.java:22) - invokestatic @ bci 17
Created vframeArray 0x0000000014cd79b8
DEOPT UNPACKING thread 0x0000000014a4a800 vframeArray 0x0000000014cd79b8 mode 2
{method} 'main' '([Ljava/lang/String;)V' in 'nerdscentral/LoopTest' - invokestatic @ bci 17 sp = 0x0000000041a5a9d0
589 2 % ! nerdscentral.LoopTest::main @ 24 (197 bytes)
@ 31 nerdscentral.LoopTest::loop2 (12 bytes) inline (hot)
@ 17 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
Uncommon trap occurred in nerdscentral.LoopTest::main (@0x00002aaaab41ed18) thread=1101379904 reason=null_assert action=make_not_entrant unloaded_class_index=-1
1400 2 % ! nerdscentral.LoopTest::main @ -2 (197 bytes) made not entrant
DEOPT PACKING thread 0x0000000014a4a800 Compiled frame (sp=0x0000000041a5aa20 unextended sp=0x0000000041a5aa20, fp=0x00000000edc19d88, pc=0x00002aaaab41ed18)
nmethod 1401 2 % ! nerdscentral.LoopTest::main @ -2 (197 bytes)
Virtual frames (innermost first):
0 - frame( sp=0x0000000041a5aa20, unextended_sp=0x0000000041a5aa20, fp=0x00000000edc19d88, pc=0x00002aaaab41ed18)
nerdscentral.LoopTest.main(LoopTest.java:30) - new @ bci 62
Created vframeArray 0x0000000014cd8588
DEOPT UNPACKING thread 0x0000000014a4a800 vframeArray 0x0000000014cd8588 mode 2
{method} 'main' '([Ljava/lang/String;)V' in 'nerdscentral/LoopTest' - new @ bci 62 sp = 0x0000000041a5a9c8
Dispatch: 820
1408 2 nerdscentral.LoopTest::loop1 (9 bytes)
1408 3 % ! nerdscentral.LoopTest::main @ 110 (197 bytes)
@ 117 nerdscentral.LoopTest::loop1 (9 bytes) inline (hot)
@ 103 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
@ 147 java.lang.StringBuilder::<init> (7 bytes) call site not reached
@ 152 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 155 java.lang.System::currentTimeMillis (0 bytes) (intrinsic)
@ 160 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 163 java.lang.StringBuilder::toString (17 bytes) executed < MinInliningThreshold times
!m @ 166 java.io.PrintStream::println (24 bytes) executed < MinInliningThreshold times
@ 176 java.lang.StringBuilder::<init> (7 bytes) call site not reached
@ 181 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 187 java.lang.StringBuilder::append (8 bytes) executed < MinInliningThreshold times
@ 190 java.lang.StringBuilder::toString (17 bytes) executed < MinInliningThreshold times
!m @ 193 java.io.PrintStream::println (24 bytes) executed < MinInliningThreshold times
No Dispatch: 1008
40000000000
@rednaxelafx
Copy link
Author

Tweaking the test code a little bit tells another story: https://gist.github.com/1080297

All I did was moving all code in main() into a new method test(), and call test() from main() for 5 times. Now both methods seem to take the same amount of time.

And the logs of the original test code: https://gist.github.com/1080293

There were 3 compilations done for main(), all of them were OSR compiles. The first two had their entry points at the end of the first inner loop, where as the third compilation had its entry point at the end of the second inner loop.

Hitting an uncommon trap will cause a deoptimization. Looking at the log from -XX:+TraceDeoptimization, it's clear that in the original main(), two deoptimizations happened during the top half of the method: (1) the first time invoking System.currentTimeMillis(), and (2) the first time accessing System.out. There were no deoptimizations in the bottom half of main(). The code running the loop is pretty similar in both versions.

It looks to me that, in the original test code, the top half of main() "performed better" than the bottom half because the top half compiled less code (due to the uncommon trap mechanism in the Server Compiler of HotSpot VM), so it had less register allocation pressure, which resulted in slightly better code.

The most significant difference between the second and third compilations of main() is how the static variable LoopTest.count was accessed. In the second compilation (which corresponded to the top half of main()), reading LoopTest.count was generated as:

movq    [R13 + #120 (8-bit)], R11   # long ! Field nerdscentral/LoopTest.count

The assignment to R13 was hoisted to the top of the method, so it was outside of any loop.

Where as in the third compilation (which corresponded to the bottom half of main()), the same logic was generated as:

movq    R11, java/lang/Class:exact *    # ptr
movq    [R11 + #120 (8-bit)], R10   # long ! Field nerdscentral/LoopTest.count

That means even though both the second and third compilation of main() had similar code shape, the latter had to do more work within the loop, so it ran slower.

Despite the top half of main() went through two OSR migrations and two deoptimizations, and that the first two calls to System.currentTimeMillis() were both done in the interpreter, the impact of register allocation was significant enough to make it still perform better than the bottom half of main().

But, as seen in the tweaked test code, if test() was given a chance to do a standard compilation, then the top and bottom halves would have turned into almost exactly the same code, so it's no surprise they perform the same.

John Rose wrote about the optimization of local throws a couple of years ago: Longjumps Considered Inexpensive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment