Skip to main content

jdk 堆栈

· One min read

背景

想了解jdk的的实现和php有什么不一样。

堆栈

jdk 会将opcode 生成对应的汇编代码,生成汇编的代码如下:

(gdb) where
#0 AbstractAssembler::emit_int8 (this=0x7ffff00198a0, x=-64 '\300') at /home/ubuntu/jdk/src/hotspot/share/asm/assembler.hpp:286
#1 0x00007ffff62513e9 in Assembler::emit_arith (this=0x7ffff00198a0, op1=133, op2=192, dst=0x0, src=0x0) at /home/ubuntu/jdk/src/hotspot/cpu/x86/assembler_x86.cpp:300
#2 0x00007ffff6284cf3 in Assembler::testq (this=0x7ffff00198a0, dst=0x0, src=0x0) at /home/ubuntu/jdk/src/hotspot/cpu/x86/assembler_x86.cpp:9191
#3 0x00007ffff6bcd75b in MacroAssembler::testptr (this=0x7ffff00198a0, dst=0x0, src=0x0) at /home/ubuntu/jdk/src/hotspot/cpu/x86/macroAssembler_x86.cpp:4072
#4 0x00007ffff6f5b67f in StubGenerator::generate_forward_exception (this=0x7ffff5b68890) at /home/ubuntu/jdk/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp:537
#5 0x00007ffff6f7dd2a in StubGenerator::generate_initial (this=0x7ffff5b68890) at /home/ubuntu/jdk/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp:5752
#6 0x00007ffff6f7e9db in StubGenerator::StubGenerator (this=0x7ffff5b68890, code=0x7ffff5b68940, all=false)
at /home/ubuntu/jdk/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp:5994
#7 0x00007ffff6f589d3 in StubGenerator_generate (code=0x7ffff5b68940, all=false) at /home/ubuntu/jdk/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp:6000
#8 0x00007ffff6f7eae9 in StubRoutines::initialize1 () at /home/ubuntu/jdk/src/hotspot/share/runtime/stubRoutines.cpp:195
#9 0x00007ffff6f7fb77 in stubRoutines_init1 () at /home/ubuntu/jdk/src/hotspot/share/runtime/stubRoutines.cpp:374
#10 0x00007ffff686a610 in init_globals () at /home/ubuntu/jdk/src/hotspot/share/runtime/init.cpp:112
#11 0x00007ffff700e2fd in Threads::create_vm (args=0x7ffff5b68e20, canTryAgain=0x7ffff5b68d2b) at /home/ubuntu/jdk/src/hotspot/share/runtime/thread.cpp:3729
#12 0x00007ffff697a82d in JNI_CreateJavaVM_inner (vm=0x7ffff5b68e78, penv=0x7ffff5b68e80, args=0x7ffff5b68e20) at /home/ubuntu/jdk/src/hotspot/share/prims/jni.cpp:3935
#13 0x00007ffff697ab47 in JNI_CreateJavaVM (vm=0x7ffff5b68e78, penv=0x7ffff5b68e80, args=0x7ffff5b68e20) at /home/ubuntu/jdk/src/hotspot/share/prims/jni.cpp:4021
#14 0x00007ffff7fba8a2 in InitializeJVM (pvm=0x7ffff5b68e78, penv=0x7ffff5b68e80, ifn=0x7ffff5b68ed0) at /home/ubuntu/jdk/src/java.base/share/native/libjli/java.c:1529
#15 0x00007ffff7fb7453 in JavaMain (_args=0x7ffffffface0) at /home/ubuntu/jdk/src/java.base/share/native/libjli/java.c:414
#16 0x00007ffff7d79609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#17 0x00007ffff7ed5163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95