Weitere ähnliche Inhalte
Ähnlich wie Panamaを先取り!? JVMCIでJITと遊ぶ (20)
Mehr von Yasumasa Suenaga (8)
Panamaを先取り!? JVMCIでJITと遊ぶ
- 24. HotSpotProfilingInfo<exceptionSeen@0: FALSE; exceptionSeen@1: FALSE; exceptionSeen@2:
FALSE; exceptionSeen@3: FALSE; exceptionSeen@4: FALSE; exceptionSeen@5: FALSE;
executionCount@6: 501760; branchProbability@6: 0.000002; exceptionSeen@6: FALSE;
exceptionSeen@7: FALSE; exceptionSeen@8: FALSE; exceptionSeen@9: FALSE; exceptionSeen@10:
FALSE; exceptionSeen@11: FALSE; exceptionSeen@12: FALSE; exceptionSeen@13: FALSE;
exceptionSeen@14: FALSE; executionCount@15: 501759; branchProbability@15: 1.000000;
exceptionSeen@15: FALSE; exceptionSeen@16: FALSE; exceptionSeen@17: FALSE;
exceptionSeen@18: FALSE; exceptionSeen@19: FALSE>
Compile level = 3
isMature = true
BCI 6: execution count = 501760, branch = 1.992984693877551E-6
BCI 15: execution count = 501759, branch = 1.0
- 25. public static int runLoop(int);
descriptor: (I)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=3, args_size=1
0: iconst_0
1: istore_1
2: iconst_1
3: istore_2
4: iload_2
5: iload_0
6: if_icmpgt 18
9: iinc 1, 1
12: iinc 2, 1
15: goto 4
18: iload_1
19: ireturn
ほとんど分岐しない
(0.000002)
上にジャンプ
(1.0)
- 26. HotSpotProfilingInfo<exceptionSeen@0: FALSE; exceptionSeen@1: FALSE; exceptionSeen@2:
FALSE; exceptionSeen@3: FALSE; exceptionSeen@4: FALSE; exceptionSeen@5: FALSE;
executionCount@6: 501760; branchProbability@6: 0.000002; exceptionSeen@6: FALSE;
exceptionSeen@7: FALSE; exceptionSeen@8: FALSE; exceptionSeen@9: FALSE; exceptionSeen@10:
FALSE; exceptionSeen@11: FALSE; exceptionSeen@12: FALSE; exceptionSeen@13: FALSE;
exceptionSeen@14: FALSE; executionCount@15: 501759; branchProbability@15: 1.000000;
exceptionSeen@15: FALSE; exceptionSeen@16: FALSE; exceptionSeen@17: FALSE;
exceptionSeen@18: FALSE; exceptionSeen@19: FALSE>
Compile level = 3
isMature = true
BCI 6: execution count = 501760, branch = 1.992984693877551E-6
BCI 15: execution count = 501759, branch = 1.0
100万回動かしてるはずなんだけど…
- 34. 262 167 % 3 TestBase::runLoop @ 4 (20 bytes)
263 168 3 TestBase::runLoop (20 bytes)
263 169 % 4 TestBase::runLoop @ 4 (20 bytes)
264 167 % 3 TestBase::runLoop @ 4 (20 bytes) made not entrant
265 169 % 4 TestBase::runLoop @ 4 (20 bytes) made not entrant
:
runLoop() finished.
1136 168 3 TestBase::runLoop (20 bytes) made not entrant
reprofile.
3466 219 % 4 TestBase::runLoop @ 4 (20 bytes)
3468 220 4 TestBase::runLoop (20 bytes)
3468 219 % 4 TestBase::runLoop @ 4 (20 bytes) made not entrant
runLoop() finished.
リプロファイルで
破棄された
最初の生成
リプロファイル後の
生成コード
- 46. s1 s2 s3 s4 s5 s6 s7 s8src
dest d1 d2 d3 d4 d5 d6 d7 d8
+ + + + + + + +
s1+d1 s2+d2 s3+d3 s4+d4 s5+d5 s6+d6 s7+d7 s8+d8
=
=
=
=
=
=
=
=
- 62. 9 9 9 9 9 9 9 9
$ jcmd 11217 Compiler.codelist | grep padd
582 4 PAddTest$PAddInt.padd([I[I)V [0x00007f9f8970a090, 0x00007f9f8970a220 - 0x00007f9f8970a250]
コンソール出力
コードキャッシュ
- 63. (gdb) disas 0x00007f9f8970a220, 0x00007f9f8970a250
Dump of assembler code from 0x7f9f8970a220 to 0x7f9f8970a250:
0x00007f9f8970a220: nopl 0x0(%rax,%rax,1)
0x00007f9f8970a225: push %rbp
0x00007f9f8970a226: mov %rsp,%rbp
0x00007f9f8970a229: sub $0x10,%rsp
0x00007f9f8970a230: vmovdqu 0x10(%rdx),%ymm1
0x00007f9f8970a235: vpaddd 0x10(%rsi),%ymm1,%ymm0
0x00007f9f8970a23a: vmovdqu %ymm0,0x10(%rsi)
0x00007f9f8970a23f: mov %rbp,%rsp
0x00007f9f8970a242: pop %rbp
0x00007f9f8970a243: retq
src側配列をAVXレジスタにロード
足し算(SIMD)
計算結果をdest側配列にストア
- 76. Installed address: 0x7fda896fba10
1656
$ jcmd 1656 Compiler.codelist | grep 7fda896fba10
569 4 SyscallTest$GetPID.getPid()I [0x00007fda896fba10, 0x00007fda896fbba0 - 0x00007fda896fbbc8]
コンソール出力
コードキャッシュ
- 77. (gdb) disas 0x00007fda896fbba0, 0x00007fda896fbbc8
Dump of assembler code from 0x7fda896fbba0 to 0x7fda896fbbc8:
0x00007fda896fbba0: nopl 0x0(%rax,%rax,1)
0x00007fda896fbba5: push %rbp
0x00007fda896fbba6: mov %rsp,%rbp
0x00007fda896fbba9: sub $0x10,%rsp
0x00007fda896fbbb0: mov $0x27,%rax
0x00007fda896fbbb7: syscall
0x00007fda896fbbb9: mov %rbp,%rsp
0x00007fda896fbbbc: pop %rbp
0x00007fda896fbbbd: retq
システムコール番号の設定
システムコール実行