Mar 6, 2011 - Famous examples: Java, C# (.Net), Python, etc. .... JIT vs. DLA. Static Call Graph. JIT compilation. Simone Campanoni and Luca Rocchini.
Bytecode systems Static memory References
Static Memory Management within Bytecode Languages on Multicore Systems Simone Campanoni and Luca Rocchini
March 6th 2011
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Summary
1
Bytecode systems
2
Execution models
3
Static memories
4
References
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Acknowledgments Harvard University Prof. David Brooks
Microsoft Research Dr. Aaron Smith
Prof. Gu-Yeon Wei Glenn Holloway Vijay Janapa Reddi Politecnico di Milano Prof. Stefano Crespi Reghizzi Michele Tartara
HiPEAC Prof. Albert Cohen Dr. Erven Rohou Ing. David Yuste
Ettore Speziale Prof. Marco Santambrogio Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Classic compilation approach
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Classic compilation approach
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode schemas
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode schemas
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode schemas
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode schemas
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . .
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Execution relies on a VM (usually)
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Execution relies on a VM (usually) Compilation performed at runtime or at installation-time
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Execution relies on a VM (usually) Compilation performed at runtime or at installation-time
Translation unit: method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Execution relies on a VM (usually) Compilation performed at runtime or at installation-time
Translation unit: method Static memories initialized by VM through special methods
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Bytecode systems: main characteristics
Famous examples: Java, C# (.Net), Python, etc. . . Compact representation per single programs Language Stack-based Platform independent One byte to encode instruction type
Execution relies on a VM (usually) Compilation performed at runtime or at installation-time
Translation unit: method Static memories initialized by VM through special methods
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Just-In-Time compiler Compile the Bytecode just before executing it
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Just-In-Time compiler Compile the Bytecode just before executing it Approach Consider application code in Translation Units, i.e., TUs
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Just-In-Time compiler Compile the Bytecode just before executing it Approach Consider application code in Translation Units, i.e., TUs e.g. method, region
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Just-In-Time compiler Compile the Bytecode just before executing it Approach Consider application code in Translation Units, i.e., TUs e.g. method, region
Compile and execute the first TU
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Just-In-Time compiler Compile the Bytecode just before executing it Approach Consider application code in Translation Units, i.e., TUs e.g. method, region
Compile and execute the first TU If the execution goes outside compiled TUs, redirect to the JIT compiler to compile and execute the requested one
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems Startup time
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems Startup time Generated code is not optimal
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems Startup time Generated code is not optimal Dynamic Look-Ahead compilation
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems Startup time Generated code is not optimal Dynamic Look-Ahead compilation Recently introduced
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Virtual machine: State of the art Problems Startup time Generated code is not optimal Dynamic Look-Ahead compilation Recently introduced Target: multicores
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA JIT compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA DLA compilation
Static Call Graph
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA
Static Call Graph
Simone Campanoni and Luca Rocchini
Easy program ⇒ easy parallelization
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA
Static Call Graph
Easy program ⇒ easy parallelization What about this SCG?
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
JIT vs. DLA
Static Call Graph
Easy program ⇒ easy parallelization and this SCG?
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Dynamic Look-Ahead approach Target Avoid execution stalls due to compilation
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Dynamic Look-Ahead approach Target Avoid execution stalls due to compilation Produce optimized code before its execution
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Dynamic Look-Ahead approach Target Avoid execution stalls due to compilation Produce optimized code before its execution Approach Compile methods in parallel to minimize the probability of stalling the execution The DLA compiler looks ahead within the call graph (dynamically computed) to compile ahead of time methods No knowledge a priori of the program
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Exploit available resources
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Exploit available resources
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Exploit available resources
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Runtime behavior
Following the executing method
Simone Campanoni and Luca Rocchini
Exploit available resources
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model Static memory initialization ∈ compilation
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model Static memory initialization ∈ compilation For every method m there is M such that ∀m0 ∈ M, m0 m ∧ m0 executed once
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model Static memory initialization ∈ compilation For every method m there is M such that ∀m0 ∈ M, m0 m ∧ m0 executed once The compiler/VM is in charge to satisfy it
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model Static memory initialization ∈ compilation For every method m there is M such that ∀m0 ∈ M, m0 m ∧ m0 executed once The compiler/VM is in charge to satisfy it No explicit call ∈ code
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Virtual Machine: State of the art Dynamic Look-Ahead compilation Pipeline
Execution Model
Pipeline model Static memory initialization ∈ compilation For every method m there is M such that ∀m0 ∈ M, m0 m ∧ m0 executed once The compiler/VM is in charge to satisfy it No explicit call ∈ code
Dependences cycle: the execution is guaranteed to be correct no matter which one is initialized first
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1
Simone Campanoni and Luca Rocchini
t2 is going to execute m2
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
Simone Campanoni and Luca Rocchini
t2 is going to execute m2 m2 uses s2
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1 Initializers: M1
Simone Campanoni and Luca Rocchini
t2 is going to execute m2 m2 uses s2 Initializers: M2
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
t1 waits t2
t2 waits t1
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
t1 waits t2
t2 waits t1
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
t1 waits t2
t2 waits t1
High level solution
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
t1 waits t2
t2 waits t1
High level solution Detection Deadlock detection := detect dependence cycles
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Deadlock Example t1 is going to execute m1 m1 uses s1
t2 is going to execute m2 m2 uses s2
Initializers: M1
Initializers: M2
M1 uses s2 ⇒ M2 M1
M2 uses s1 ⇒ M1 M2
t1 waits t2
t2 waits t1
High level solution Detection Deadlock detection := detect dependence cycles if (exist dependence cycle()) break the cycle() Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers Deadlock detection
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers Deadlock detection Thread t asks for a method ⇒ t will compile it
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers Deadlock detection Thread t asks for a method ⇒ t will compile it t needs si , which is initializing by t 0
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers Deadlock detection Thread t asks for a method ⇒ t will compile it t needs si , which is initializing by t 0 Deadlock := adding (t, t 0 ) to the waiting graph makes a cycle
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Single-threaded compilers Deadlock detection Thread t asks for a method ⇒ t will compile it t needs si , which is initializing by t 0 Deadlock := adding (t, t 0 ) to the waiting graph makes a cycle Deadlock avoidance
∈ ECMA-335 Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Pipeline model: additional issues
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Pipeline model: additional issues
Thread t asks for a method m ; t will compile it
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Pipeline model: additional issues
Thread t asks for a method m ; t will compile it t 0 that will compile m is not known
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Pipeline model: additional issues
Thread t asks for a method m ; t will compile it t 0 that will compile m is not known |Static threads| has to be unbound
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W (t, m) = t is waiting for m
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W (t, m) = t is waiting for m (m, t) = m is compiling by t
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W (t, m) = t is waiting for m (m, t) = m is compiling by t
Deadlock detection
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W (t, m) = t is waiting for m (m, t) = m is compiling by t
Deadlock detection Cycle within W
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Multi-threaded compilers
Threads asking for compilation Code executor threads Static threads
New waiting graph W (t, m) = t is waiting for m (m, t) = m is compiling by t
Deadlock detection Cycle within W
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime |Static threads|↑
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime |Static threads|↑ Overhead ↑
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime |Static threads|↑ Overhead ↑ Debugging cost ↑
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime |Static threads|↑ Overhead ↑ Debugging cost ↑ |static threads|↓
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads |Static threads| has to be unbound |Static threads| ≥ Length(static memory dependences) + 1 |Static threads| is adapted at runtime |Static threads|↑ Overhead ↑ Debugging cost ↑ |static threads|↓ Overhead ↑ in case of increasing |Static threads|
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources Compilation pipeline is empty
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources Compilation pipeline is empty ⇒|static threads|= min
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources Compilation pipeline is empty ⇒|static threads|= min Acquire resources
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources Compilation pipeline is empty ⇒|static threads|= min Acquire resources |free static threads|= 0
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Static threads (2)
Release resources Compilation pipeline is empty ⇒|static threads|= min Acquire resources |free static threads|= 0 ⇒|static threads| ∗ = 2
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process:
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL ⇒ IR
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL ⇒ IR ⇒ Machine code
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL ⇒ IR ⇒ Machine code
Features: Easy extensible
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL ⇒ IR ⇒ Machine code
Features: Easy extensible Target: multi-core systems
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Framework used: ILDJIT A compilation framework designed from scratch for parallel systems
Design choices Translation unit: method Intermediate Representation: IR Translation process: CIL ⇒ IR ⇒ Machine code
Features: Easy extensible Target: multi-core systems Includes JIT, DLA, AOT compilers Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Evaluation
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Evaluation: static threads
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Evaluation: static threads
Fast adapting
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Evaluation: static threads
Fast adapting Extra threads
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Deadlock Static threads Evaluation
Evaluation: static threads
Fast adapting Extra threads Resources releasing
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Publications Websites
Publications ILDJIT 1
S. Campanoni, G. Agosta, S. Crespi Reghizzi, A. Di Biagio. “A highly flexible, parallel virtual machine: design and experience of ILDJIT”. Software: Practice and Experience. 2010
DLA 1
S. Campanoni, M. Sykora, G. Agosta, S. Crespi Reghizzi. “Dynamic Look Ahead Compilation: a technique to hide JIT compilation latencies in multicore environment”. CC, 2009.
ILDJIT + ALARM 1
V. Janapa Reddi, S. Campanoni, M. Gupta, M. Smith, G. Wei, D. Brooks. “Software-Assisted Hardware Reliability: Abstracting Circuit-level Challenges to the Software Stack”. DAC, 2009.
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Publications Websites
Websites
ILDJIT http://ildjit.sourceforge.net
ECMA-335 www.ecma-international.org/publications/standards/Ecma335.htm
ALARM http://www.eecs.harvard.edu/alarms/wiki
Simone Campanoni and Luca Rocchini
Static Memory Management
Bytecode systems Static memory References
Publications Websites
Thanks for your attention
Simone Campanoni and Luca Rocchini
Static Memory Management