2020q3 專題: Java 虛擬機器
目標
- 理解 Java 虛擬機器運作原理
- 擴充給定的 Java 虛擬機器,得以執行 Dhrystone 一類的工具
- 研究其他開放原始碼 JVM 實作
背景知識
Dhrystone for Java
- 安裝 OpenJDK
- 取得 Dhrystone for Java 原始程式碼並編譯
- 執行 Dhrystone for Java,當看到
Please give the number of runs through the benchmark
字樣時,輸入 1000 (或更大的數值)
- 取得原始程式碼並編譯
- 測試
- 預期可見以下輸出
threaded interpreter
約可改善 20% 效能
TODO:
- 描述給定的 Java 虛擬機器 欠缺哪些功能/特徵/元素
- Constant Pool
- CONSTANT_Float_info
- CONSTANT_Long_info
- CONSTANT_Double_info
- CONSTANT_String_info
- CONSTANT_Methodref_info
- CONSTANT_InterfaceMethodref_info
- Bytecode
- object related instruction
- invoke (e.g.
invokevirtual
, invokeinterface
)
- field (e.g.
getstatic
, getfield
)
- create (
new
)
- array related instruction (e.g.
anewarray
, arraylength
)
- stack related instruction (
pop
, dup
, swap
)
- other data type (float, double, long) instruction (e.g.
fload
, dadd
)
- bitwise instruction (e.g.
ior
, iand
)
- convert instruction (e.g.
i2b
, i2d
)
- exception (
athrow
)
- Class Loader
- Bootstrap Class Loader
- Extension Class Loader
- System Class Loader
- Bytecode Verifier
- JIT Compiler
- Code Optimizations
- Garbage Collection
- Runtime Data Area
- Native Method Stack
- Heap
- Method Area
- Learn about JVM internals - what does the JVM do? 紀錄不理解的部分
關於欠缺的功能/特徵,需要描述更細緻,例如缺少的 Java bytecode, JNI, class field 解析等等。一旦完整列出,才能分別給予不同的優先權,隨後再著手改進。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
jserv
Dhrystone: https://en.wikipedia.org/wiki/Dhrystone