JIT'ing requires Profiling for more efficient optimization Because you don't want JIT everything Aggressively optimize based on profile information Tiered compilation Runtime Overhead?
JIT'ing requires Profiling for more efficient optimization Because you don't want JIT everything Aggressively optimize based on profile information Tiered compilation Runtime Overhead?
Java 8 Client Startup Server Performance Best of Both Worlds - C1 + C2 Tiered : https://github.com/dmlloyd/openjdk/blob/jdk8u/jdk8u/hotspot/src/share/vm/runtime/advancedThresholdPolicy.hpp#L35-L158
tiered compilation on-stack replacement delayed reoptimization program dependence graph representation static single assignment representation Speculative (profile-based) Speculative (profile-based) optimistic nullness assertions optimistic type assertions optimistic type strengthening optimistic array length strengthening untaken branch pruning optimistic N-morphic inlining branch frequency prediction call frequency prediction Proof-based techniques Proof-based techniques exact type inference memory value inference memory value tracking constant folding reassociation operator strength reduction null check elimination type test strength reduction type test elimination algebraic simplification common subexpression elimination integer range typing Flow-sensitive rewrites Flow-sensitive rewrites conditional constant propagation dominating test detection flow-carried type narrowing dead code elimination Text and much more..
SIGSEGV SIGSEGV as control flow as control flow Into the rabbit hole Handle Signals: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals001.html#CIHBBDED Speculative Optimization Speculative Optimization Faster Faster IF IF not null are encountered (Uncommon Trap) not null are encountered (Uncommon Trap)
SIGSEGV SIGSEGV as control flow as control flow Into the rabbit hole Handle Signals: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/signals001.html#CIHBBDED Speculative Optimization Speculative Optimization Faster Faster IF IF not null are encountered (Uncommon Trap) not null are encountered (Uncommon Trap) Implicit Null Check? Field and Array access is null checked
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining?
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining?
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Monomorphic
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Monomorphic Bimorphic
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Monomorphic Bimorphic Megamorphic
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Black Magic: https://shipilev.net/blog/2015/black-magic-method-dispatch/ Monomorphic Bimorphic Megamorphic
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Black Magic: https://shipilev.net/blog/2015/black-magic-method-dispatch/ Monomorphic Bimorphic Megamorphic Class Hierarchy Analysis
Combine caller and callee into one unit Expands the scope for other optimizations Bytecode size < 35 bytes Bytecode size < 325 bytes for inlining hot methods What about virtual call inlining? Black Magic: https://shipilev.net/blog/2015/black-magic-method-dispatch/ Monomorphic Bimorphic Megamorphic Class Hierarchy Analysis Devirtualization
method No allocate a Sum object at all, just keep track of the individual fields of the object Escape Analysis for Java: http://www.research.ibm.com/people/j/jdchoi/escape.ps
compiled code Effect in performance when code is deoptimized Deoptimize when previous optimizations are no longer valid There are two cases of deoptimization not entrant -> don't let new calls enter zombi -> on this way to deadness