/** * @author 五月的仓颉http://www.cnblogs.com/xrq730/p/7048693.html
*/
public class LazySingleton {
private static volatile LazySingleton instance = null;
public static LazySingleton getInstance() {
if (instance == null) {
instance = new LazySingleton();
}
return instance;
}
public static void main(String[] args) {
LazySingleton.getInstance();
}
}
-server -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -XX:CompileCommand=compileonly,*LazySingleton.getInstance
Java HotSpot(TM) 64-Bit Server VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output
CompilerOracle: compileonly *LazySingleton.getInstance
Loaded disassembler from D:\JDK\jre\bin\server\hsdis-amd64.dll
Decoding compiled method 0x0000000002931150:
Code:
Argument 0 is unknown.RIP: 0x29312a0 Code size: 0x00000108
[Disassembling for mach='amd64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} 'getInstance' '()Lorg/xrq/test/design/singleton/LazySingleton;' in 'org/xrq/test/design/singleton/LazySingleton'
# [sp+0x20] (sp of caller)
0x00000000029312a0: mov dword ptr [rsp+0ffffffffffffa000h],eax
0x00000000029312a7: push rbp
0x00000000029312a8: sub rsp,10h ;*synchronization entry
; - org.xrq.test.design.singleton.LazySingleton::getInstance@-1 (line 13)
0x00000000029312ac: mov r10,7ada9e428h ; {oop(a 'java/lang/Class' = 'org/xrq/test/design/singleton/LazySingleton')}
0x00000000029312b6: mov r11d,dword ptr [r10+58h]
;*getstatic instance
; - org.xrq.test.design.singleton.LazySingleton::getInstance@0 (line 13)
0x00000000029312ba: test r11d,r11d
0x00000000029312bd: je 29312e0h
0x00000000029312bf: mov r10,7ada9e428h ; {oop(a 'java/lang/Class' = 'org/xrq/test/design/singleton/LazySingleton')}
0x00000000029312c9: mov r11d,dword ptr [r10+58h]
0x00000000029312cd: mov rax,r11
0x00000000029312d0: shl rax,3h ;*getstatic instance
; - org.xrq.test.design.singleton.LazySingleton::getInstance@16 (line 17)
0x00000000029312d4: add rsp,10h
0x00000000029312d8: pop rbp
0x00000000029312d9: test dword ptr [330000h],eax ; {poll_return}
0x00000000029312df: ret
0x00000000029312e0: mov rax,qword ptr [r15+60h]
0x00000000029312e4: mov r10,rax
0x00000000029312e7: add r10,10h
0x00000000029312eb: cmp r10,qword ptr [r15+70h]
0x00000000029312ef: jnb 293135bh
0x00000000029312f1: mov qword ptr [r15+60h],r10
0x00000000029312f5: prefetchnta byte ptr [r10+0c0h]
0x00000000029312fd: mov r11d,0e07d00b2h ; {oop('org/xrq/test/design/singleton/LazySingleton')}
0x0000000002931303: mov r10,qword ptr [r12+r11*8+0b0h]
0x000000000293130b: mov qword ptr [rax],r10
0x000000000293130e: mov dword ptr [rax+8h],0e07d00b2h
; {oop('org/xrq/test/design/singleton/LazySingleton')}
0x0000000002931315: mov dword ptr [rax+0ch],r12d
0x0000000002931319: mov rbp,rax ;*new ; - org.xrq.test.design.singleton.LazySingleton::getInstance@6 (line 14)
0x000000000293131c: mov rdx,rbp
0x000000000293131f: call 2907c60h ; OopMap{rbp=Oop off=132}
;*invokespecial <init>
; - org.xrq.test.design.singleton.LazySingleton::getInstance@10 (line 14)
; {optimized virtual_call}
0x0000000002931324: mov r10,rbp
0x0000000002931327: shr r10,3h
0x000000000293132b: mov r11,7ada9e428h ; {oop(a 'java/lang/Class' = 'org/xrq/test/design/singleton/LazySingleton')}
0x0000000002931335: mov dword ptr [r11+58h],r10d
0x0000000002931339: mov r10,7ada9e428h ; {oop(a 'java/lang/Class' = 'org/xrq/test/design/singleton/LazySingleton')}
0x0000000002931343: shr r10,9h
0x0000000002931347: mov r11d,20b2000h
0x000000000293134d: mov byte ptr [r11+r10],r12l
0x0000000002931351: lock add dword ptr [rsp],0h ;*putstatic instance
; - org.xrq.test.design.singleton.LazySingleton::getInstance@13 (line 14)
0x0000000002931356: jmp 29312bfh
0x000000000293135b: mov rdx,703e80590h ; {oop('org/xrq/test/design/singleton/LazySingleton')}
0x0000000002931365: nop
0x0000000002931367: call 292fbe0h ; OopMap{off=204}
;*new ; - org.xrq.test.design.singleton.LazySingleton::getInstance@6 (line 14)
; {runtime_call}
0x000000000293136c: jmp 2931319h
0x000000000293136e: mov rdx,rax
0x0000000002931371: jmp 2931376h
0x0000000002931373: mov rdx,rax ;*new ; - org.xrq.test.design.singleton.LazySingleton::getInstance@6 (line 14)
0x0000000002931376: add rsp,10h
0x000000000293137a: pop rbp
0x000000000293137b: jmp 2932b20h ; {runtime_call}
[Stub Code]
0x0000000002931380: mov rbx,0h ; {no_reloc}
0x000000000293138a: jmp 293138ah ; {runtime_call}
[Exception Handler]
0x000000000293138f: jmp 292fca0h ; {runtime_call}
[Deopt Handler Code]
0x0000000002931394: call 2931399h
0x0000000002931399: sub qword ptr [rsp],5h
0x000000000293139e: jmp 2909000h ; {runtime_call}
0x00000000029313a3: hlt
0x00000000029313a4: hlt
0x00000000029313a5: hlt
0x00000000029313a6: hlt
0x00000000029313a7: hlt
0x0000000002931351: lock add dword ptr [rsp],0h ;*putstatic instance
; - org.xrq.test.design.singleton.LazySingleton::getInstance@13 (line 14)
【1】位测试和修改指令(BTS、BTR、BTC) 【2】交换指令(XADD、CMPXCHG、CMPXCHG8B) 【3】自动假设有LOCK前缀的XCHG指令 【4】下列单操作数的算数和逻辑指令:INC、DEC、NOT、NEG 【5】下列双操作数的算数和逻辑指令:ADD、ADC、SUB、SBB、AND、OR、XOR 一个加锁的指令会保证对目标操作数所在的内存区域加锁,但是系统可能会将锁定区域解释得稍大一些。 软件应该使用相同的地址和操作数长度来访问信号量(用作处理器之间发送信号的共享内存)。例如,如果一个处理器使用一个字来访问信号量,其它处理器就不应该使用一个字节来访问这个信号量。 总线锁的完整性不收内存区域对齐的影响。加锁语义会一直持续,以满足更新整个操作数所需的总线周期个数。但是,建议加锁访问应该对齐在它们的自然边界上,以提升系统性能: 【1】任何8位访问的边界(加锁或不加锁) 【2】锁定的字访问的16位边界 【3】锁定的双字访问的32位边界 【4】锁定的四字访问的64位边界 对所有其它的内存操作和所有可见的外部事件来说,加锁的操作都是原子的。所有取指令和页表操作能够越过加锁的指令。加锁的指令可用于同步一个处理器写数据而另一个处理器读数据的操作。
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有