SlideShare a Scribd company logo
Two-level Just-in-Time Compilation with One
Interpreter and One Engine
Yusuke Izawa 1
Hidehiko Masuhara 1
Carl Friedrich Bolz-Tereick 2
1Tokyo Institute of Technology
2Heinrich-Heine-Universität Düsseldorf
PEPM 2022
January 18, 2022
Two-level JIT Compilation with .. PEPM 2022 1 / 15
Outline
1. Introduction: the folklore in a JIT community and our findings
2. Proposal: Adaptive RPython that performs multitier compilation with “one
interpreter” and “one engine”
3. Observation: to confirm that Adaptive RPython “actually” works
Two-level JIT Compilation with .. PEPM 2022 2 / 15
Folklore: A Meta-JIT Compiler Performs a Fixed Kind of
JIT Compilation
• Build an interpreter from scratch for realizing different kinds of JIT
compilers
Interptracing Interpmethod Interpthreaded
Meta-JIT
compiler
Meta-JIT
compiler
Meta-JIT
compiler
Tracing JIT Method JIT
Threaded Code
Gen.[ICOOOLPS 2021]
Two-level JIT Compilation with .. PEPM 2022 3 / 15
Folklore: A Meta-JIT Compiler Performs a Fixed Kind of
JIT Compilation
• Build an interpreter from scratch for realizing different kinds of JIT
compilers
Interptracing Interpmethod Interpthreaded
Meta-JIT
compiler
Meta-JIT
compiler
Meta-JIT
compiler
Tracing JIT Method JIT
Threaded Code
Gen.[ICOOOLPS 2021]
consisting CALL insts in bytecode:
removing indirect-branching
Two-level JIT Compilation with .. PEPM 2022 3 / 15
Folklore: A Meta-JIT Compiler Performs a Fixed Kind of
JIT Compilation
• Build an interpreter from scratch for realizing different kinds of JIT
compilers
Interptracing Interpmethod Interpthreaded
RPython Truffle/Graal
Meta-JIT
compiler
PyPy TruffleRuby Threaded Code
Gen.[ICOOOLPS 2021]
Two-level JIT Compilation with .. PEPM 2022 3 / 15
Our Findings Will Affect JIT Community’s Assumption
JIT community assumes that ..
• Meta-tracing JIT compiler can
only do tracing compilation
RPython[interp, source] = ptracing
Two-level JIT Compilation with .. PEPM 2022 4 / 15
Our Findings Will Affect JIT Community’s Assumption
JIT community assumes that ..
• Meta-tracing JIT compiler can
only do tracing compilation
But, with our findings ..
• Let meta-tracing JIT do several
compilations, like
− method compilation
− threaded code compilation
− etc.
RPython[interp, source] = ptracing RPython[interp, source] = pα
RPython[interp, source] = pβ
RPython[interp, source] = pγ
· · ·
Two-level JIT Compilation with .. PEPM 2022 4 / 15
Our Findings
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Our Findings
By providing different interp definitions to RPython, can derive different kinds
of outputs
E.g. when passes ..
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Our Findings
By providing different interp definitions to RPython, can derive different kinds
of outputs
E.g. when passes ..
• interptracing to RPython → tracing compilation
RPython[interptracing, source] = ptracing
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Our Findings
By providing different interp definitions to RPython, can derive different kinds
of outputs
E.g. when passes ..
• interptracing to RPython → tracing compilation
• interpmethod to RPython → method compilation
RPython[interptracing, source] = ptracing
RPython[interpmethod, source] = pmethod
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Our Findings
By providing different interp definitions to RPython, can derive different kinds
of outputs
E.g. when passes ..
• interptracing to RPython → tracing compilation
• interpmethod to RPython → method compilation
• interpthreaded to RPython → threaded compilation
RPython[interptracing, source] = ptracing
RPython[interpmethod, source] = pmethod
RPython[interpthreaded, source] = pthreaded
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Our Findings
By providing different interp definitions to RPython, can derive different kinds
of outputs
E.g. when passes ..
• interptracing to RPython → tracing compilation
• interpmethod to RPython → method compilation
• interpthreaded to RPython → threaded compilation
RPython[interptracing, source] = ptracing
RPython[interpmethod, source] = pmethod
RPython[interpthreaded, source] = pthreaded
 In other words ..
By changing an interpreter, we can get different kinds of compilers
Two-level JIT Compilation with .. PEPM 2022 5 / 15
Proposal: Multitier Compilation on Adaptive RPython
Adaptive RPython performs multitier compilation with “one interpreter” and
“one engine”
optimization level
threaded code baseline 2 · · ·
tracing
method
tracing + method
Two-level JIT Compilation with .. PEPM 2022 6 / 15
Proposal: Multitier Compilation on Adaptive RPython
Adaptive RPython performs multitier compilation with “one interpreter” and
“one engine”
optimization level
threaded code baseline 2 · · ·
tracing
method
tracing + method
With Adaptive RPython ..
one generic interp. → common interp + a bit different definitions
Two-level JIT Compilation with .. PEPM 2022 6 / 15
Proposal: Multitier Compilation on Adaptive RPython
Adaptive RPython performs multitier compilation with “one interpreter” and
“one engine”
optimization level
threaded code baseline 2 · · ·
tracing
method
tracing + method
With Adaptive RPython ..
one generic interp. → common interp + a bit different definitions
perform on one engine = RPython
Two-level JIT Compilation with .. PEPM 2022 6 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(1) A developer writes a generic
interp
Generic interp
Adaptive RPython
Pre-processor
Adaptive RPython
P.E. System
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(2) Pass information to the
pre-processor
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Adaptive RPython
P.E. System
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(3) Generate interps from generic
interp
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Icommon
Itracing Ithreaded Imethod
Adaptive RPython
P.E. System
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(4) Pass information to the offline
P.E.
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Icommon
Itracing Ithreaded Imethod
Adaptive RPython
P.E. System
Source program
and info about
static and dy-
namic inputs
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(5) Tracing compilation:
choose Icommon and Itracing
RPython[Icommon + Itracing,
P, V] = P′
tracing
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Icommon
Itracing Ithreaded Imethod
Adaptive RPython
P.E. System
Source program
and info about
static and dy-
namic inputs
Ptracing
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(6) Threaded code gen. [Izawa et al., 2021]
:
choose Icommon and Ithreaded
RPython[Icommon + Ithreaded,
P, V] = P′
threaded
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Icommon
Itracing Ithreaded Imethod
Adaptive RPython
P.E. System
Source program
and info about
static and dy-
namic inputs
Ptracing Pthreaded
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: Adaptive RPython Performs Multitier
Compilation
(7) Method compilation:
choose Icommon and Imethod
RPython[Icommon + Imethod,
P, V] = P′
method
Generic interp
Adaptive RPython
Pre-processor
Which instruc-
tions will be
transformed?
Icommon
Itracing Ithreaded Imethod
Adaptive RPython
P.E. System
Source program
and info about
static and dy-
namic inputs
Ptracing Pthreaded Pmethod
Two-level JIT Compilation with .. PEPM 2022 7 / 15
Overview: How to Drive the RPython Engine [ICOOOLPS 2021]
Meta-tracing JIT
• Trace the execution of an interp.
Threaded code generation
A
B
C
D
JUMP
E
F
RET
c
a
l
l
[p0]
i1 = load(..)
i1 = int_add(..)
i2 = int_lt(..)
guard_true(i2) [p0]
..
..
jump(p0)
Two-level JIT Compilation with .. PEPM 2022 8 / 15
Overview: How to Drive the RPython Engine [ICOOOLPS 2021]
Meta-tracing JIT
• Trace the execution of an interp
Threaded code generation
Two-level JIT Compilation with .. PEPM 2022 9 / 15
Overview: How to Drive the RPython Engine [ICOOOLPS 2021]
Meta-tracing JIT
• Trace the execution of an interp
Threaded code generation
• Traverse the entire method body
• Not trace inside the handlers
Two-level JIT Compilation with .. PEPM 2022 9 / 15
Overview: How to Drive the RPython Engine [ICOOOLPS 2021]
Meta-tracing JIT
• Trace the execution of an interp
Threaded code generation
• Traverse the entire method body
• Not trace inside the handlers
A
B
C
D
JUMP
E
F
RET
c
a
l
l
c
a
l
l
Traverse the en-
tire method body Not trace the
inside but
leave CALL to
the handler
Cut/stitch the
temporal trace
[p0]
i7 = call_i(ConstClass(DUP, ..))
i12 = call_i(ConstClass(CONST_I ..))
i16 = call_i(ConstClass(LT, ..))
guard_true(i16) [p0]
...
jump(p0)
[p0]
...
i28 = call_i(ConstClass(CALL, ..))
...
i32 = call_i(ConstClass(RET, ..2))
leave_portal_frame(0)
finish(i32)
bridge
Two-level JIT Compilation with .. PEPM 2022 9 / 15
Overview: How to Drive the RPython Engine [ICOOOLPS 2021]
Meta-tracing JIT
• Trace the execution of an interp
Threaded code generation
• Traverse the entire method body
• Not trace inside the handlers
tweaking an interp
A
B
C
D
JUMP
E
F
RET
c
a
l
l
c
a
l
l
Traverse the en-
tire method body Not trace the
inside but
leave CALL to
the handler
Cut/stitch the
temporal trace
[p0]
i7 = call_i(ConstClass(DUP, ..))
i12 = call_i(ConstClass(CONST_I ..))
i16 = call_i(ConstClass(LT, ..))
guard_true(i16) [p0]
...
jump(p0)
[p0]
...
i28 = call_i(ConstClass(CALL, ..))
...
i32 = call_i(ConstClass(RET, ..2))
leave_portal_frame(0)
finish(i32)
bridge
Two-level JIT Compilation with .. PEPM 2022 9 / 15
Method-traversal Interpreter: How to Drive the
RPython Engine [ICOOOLPS 2021]
 traverse depth-firstly the entire method body w/ traverse_stack
@dont_look_insdie
def ADD():
..
while True:
if opcde == JUMP_IF:
top = pop()
target = bytecode[pc++]
if top.is_true():
traverse_stack.push(pc++)
pc = target
else:
traverse_stack.push(target)
pc++
elif opcode == JUMP:
target = bytecode[pc++]
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
finish()
elif opcode == RET:
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
return pop()
Method-traversal Interpreter: How to Drive the
RPython Engine [ICOOOLPS 2021]
 traverse depth-firstly the entire method body w/ traverse_stack
@dont_look_insdie
def ADD():
..
while True:
if opcde == JUMP_IF:
top = pop()
target = bytecode[pc++]
if top.is_true():
traverse_stack.push(pc++)
pc = target
else:
traverse_stack.push(target)
pc++
elif opcode == JUMP:
target = bytecode[pc++]
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
finish()
elif opcode == RET:
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
return pop()
Suppress inlining
Method-traversal Interpreter: How to Drive the
RPython Engine [ICOOOLPS 2021]
 traverse depth-firstly the entire method body w/ traverse_stack
@dont_look_insdie
def ADD():
..
while True:
if opcde == JUMP_IF:
top = pop()
target = bytecode[pc++]
if top.is_true():
traverse_stack.push(pc++)
pc = target
else:
traverse_stack.push(target)
pc++
elif opcode == JUMP:
target = bytecode[pc++]
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
finish()
elif opcode == RET:
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
return pop()
Suppress inlining
Save another side
to traverse later
Method-traversal Interpreter: How to Drive the
RPython Engine [ICOOOLPS 2021]
 traverse depth-firstly the entire method body w/ traverse_stack
@dont_look_insdie
def ADD():
..
while True:
if opcde == JUMP_IF:
top = pop()
target = bytecode[pc++]
if top.is_true():
traverse_stack.push(pc++)
pc = target
else:
traverse_stack.push(target)
pc++
elif opcode == JUMP:
target = bytecode[pc++]
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
finish()
elif opcode == RET:
if not traverse_stack.is_empty():
pc = traverse_stack.pop()
else:
return pop()
Suppress inlining
Save another side
to traverse later
Jump to another side
Two-level JIT Compilation with .. PEPM 2022 10 / 15
The Design of Generic Interpreter
• From a generic interp, Adaptive RPython generates interps including MTI
 Embed tier-specific definitions in a meta-tracing-based interpreter
1. Declare JitTierDriver jittierdriver = JitTierDriver(pc='pc')
def interp(self);
..
if opcode == JUMP_IF:
target = bytecode[pc]
elif opcode == JUMP:
target = bytecode[pc]
elif opcode == RET:
w_x = self.pop()
elif ..
Two-level JIT Compilation with .. PEPM 2022 11 / 15
The Design of Generic Interpreter
• From a generic interp, Adaptive RPython generates interps including MTI
 Embed tier-specific definitions in a meta-tracing-based interpreter
1. Declare JitTierDriver
2. Define can_enter_tier1_XX at
JUMP_IF, JUMP, RET for threaded
code gen. and method comp.
jittierdriver = JitTierDriver(pc='pc')
def interp(self);
..
if opcode == JUMP_IF:
target = bytecode[pc]
jittierdriver.can_enter_tier1_branch(
true_path=target,false_path=pc+1,
cond=self.is_true)
if we_are_in_tier2():
elif opcode == JUMP:
target = bytecode[pc]
jittierdriver.can_enter_tier1_jump(target=target)
elif opcode == RET:
w_x = self.pop()
jittierdriver.can_enter_tier1_ret(ret_value=w_x)
elif ..
Two-level JIT Compilation with .. PEPM 2022 11 / 15
The Design of Generic Interpreter
• From a generic interp, Adaptive RPython generates interps including MTI
 Embed tier-specific definitions in a meta-tracing-based interpreter
1. Declare JitTierDriver
2. Define can_enter_tier1_XX at
JUMP_IF, JUMP, RET for threaded
code gen. and method comp.
3. Define interp. for tracing JIT inside
we_are_in_tier2
jittierdriver = JitTierDriver(pc='pc')
def interp(self);
..
if opcode == JUMP_IF:
target = bytecode[pc]
jittierdriver.can_enter_tier1_branch(
true_path=target,false_path=pc+1,
cond=self.is_true)
if we_are_in_tier2():
do stuff for tracing JIT
elif opcode == JUMP:
target = bytecode[pc]
jittierdriver.can_enter_tier1_jump(target=target)
if we_are_in_tier2():
do stuff for tracing JIT
elif opcode == RET:
w_x = self.pop()
jittierdriver.can_enter_tier1_ret(ret_value=w_x)
if we_are_in_tier2():
do stuff for tracing JIT
elif ..
Two-level JIT Compilation with .. PEPM 2022 11 / 15
The Design of Generic Interpreter
• From a generic interp, Adaptive RPython generates interps including MTI
 Embed tier-specific definitions in a meta-tracing-based interpreter
1. Declare JitTierDriver
2. Define can_enter_tier1_XX at
JUMP_IF, JUMP, RET for threaded
code gen. and method comp.
3. Define interp. for tracing JIT inside
we_are_in_tier2
4. The pre-processor generates
method-traversal interp and tracing
interp from this
jittierdriver = JitTierDriver(pc='pc')
def interp(self);
..
if opcode == JUMP_IF:
target = bytecode[pc]
jittierdriver.can_enter_tier1_branch(
true_path=target,false_path=pc+1,
cond=self.is_true)
if we_are_in_tier2():
do stuff for tracing JIT
elif opcode == JUMP:
target = bytecode[pc]
jittierdriver.can_enter_tier1_jump(target=target)
if we_are_in_tier2():
do stuff for tracing JIT
elif opcode == RET:
w_x = self.pop()
jittierdriver.can_enter_tier1_ret(ret_value=w_x)
if we_are_in_tier2():
do stuff for tracing JIT
elif ..
Two-level JIT Compilation with .. PEPM 2022 11 / 15
Observation: Can Adaptive RPython “Actually” Work? (1)
Setup
• Write TLA lang. interpreter in Adaptive RPython
• Run TLA interpreter on small examples
− loopabit: nested loop
− callabit: two functions – one is suitable for tracing, the other is for
thraeded code gen. (method)
NOTE
• Current multitier is the combination of threaded code gen. and tracing
(two-level)
Two-level JIT Compilation with .. PEPM 2022 12 / 15
Observation: Can Adaptive RPython “Actually” Work? (2)
Situation in callabit: increasing an optimization level
program JIT applied to f JIT applied to g
callabit_baseline_interp threaded (interpreted)
function f
(for threaded
code gen.)
function g
(for trac-
ing comp.)
call
ret
threaded code
generation
interpreted
Two-level JIT Compilation with .. PEPM 2022 13 / 15
Observation: Can Adaptive RPython “Actually” Work? (2)
Situation in callabit: increasing an optimization level
program JIT applied to f JIT applied to g
callabit_baseline_interp threaded (interpreted)
callabit_baseline_only threaded threaded
function f
(for threaded
code gen.)
function g
(for trac-
ing comp.)
call
ret
threaded code
generation
threaded code
generation
Two-level JIT Compilation with .. PEPM 2022 13 / 15
Observation: Can Adaptive RPython “Actually” Work? (2)
Situation in callabit: increasing an optimization level
program JIT applied to f JIT applied to g
callabit_baseline_interp threaded (interpreted)
callabit_baseline_only threaded threaded
callabit_tracing_baseline tracing baseline
function f
(for threaded
code gen.)
function g
(for trac-
ing comp.)
call
ret
tracing compi-
lation
threaded code
generation
Two-level JIT Compilation with .. PEPM 2022 13 / 15
Observation: Can Adaptive RPython “Actually” Work? (2)
Situation in callabit: increasing an optimization level
program JIT applied to f JIT applied to g
callabit_baseline_interp threaded (interpreted)
callabit_baseline_only threaded threaded
callabit_tracing_baseline tracing baseline
callabit_baseline_tracing threaded tracing
function f
(for threaded
code gen.)
function g
(for trac-
ing comp.)
call
ret
threaded code
generation
tracing compi-
lation
Two-level JIT Compilation with .. PEPM 2022 13 / 15
Observation: Can Adaptive RPython “Actually” Work? (2)
Situation in callabit: increasing an optimization level
program JIT applied to f JIT applied to g
callabit_baseline_interp threaded (interpreted)
callabit_baseline_only threaded threaded
callabit_tracing_baseline tracing baseline
callabit_baseline_tracing threaded tracing
callabit_tracing_only tracing tracing
function f
(for threaded
code gen.)
function g
(for trac-
ing comp.)
call
ret
tracing compi-
lation
tracing compi-
lation
Two-level JIT Compilation with .. PEPM 2022 13 / 15
Observation: Running Speeds and Trace Sizes
• Actually worked: compilation speed is reaching to tracing compilation
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
i
n
t
e
r
p
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
o
n
l
y
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
t
r
a
c
i
n
g
c
a
l
l
a
b
i
t
_
t
r
a
c
i
n
g
_
b
a
s
e
l
i
n
e
c
a
l
l
a
b
i
t
_
t
r
a
c
i
n
g
_
o
n
l
y
0.0
0.5
1.0
1.5
2.0
2.5
3.0
The
speed
up
ratio
(interp
=
1)
TLA w/ Adaptive RPython (Stable speed)
# Traces
0
50
100
150
200
250
300
350
400
callabit_baseline_interp
callabit_baseline_only
callabit_baseline_tracing
callabit_tracing_baseline
callabit_tracing_only
Increasing
better
smaller
Two-level JIT Compilation with .. PEPM 2022 14 / 15
Observation: Running Speeds and Trace Sizes
• Actually worked: compilation speed is reaching to tracing compilation
• Promising signs: multitier is same speed but smaller code size compared
to single tier → might get good performance in the future
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
i
n
t
e
r
p
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
o
n
l
y
c
a
l
l
a
b
i
t
_
b
a
s
e
l
i
n
e
_
t
r
a
c
i
n
g
c
a
l
l
a
b
i
t
_
t
r
a
c
i
n
g
_
b
a
s
e
l
i
n
e
c
a
l
l
a
b
i
t
_
t
r
a
c
i
n
g
_
o
n
l
y
0.0
0.5
1.0
1.5
2.0
2.5
3.0
The
speed
up
ratio
(interp
=
1)
TLA w/ Adaptive RPython (Stable speed)
# Traces
0
50
100
150
200
250
300
350
400
callabit_baseline_interp
callabit_baseline_only
callabit_baseline_tracing
callabit_tracing_baseline
callabit_tracing_only
better
smaller
Two-level JIT Compilation with .. PEPM 2022 14 / 15
Conclusion and Future Work
Conclusion
• Adaptive RPython actually worked on a small
lang.
RPython [I, P, V] = P′
RPython [ Icommon + Itracing, P, V ] = P′
tracing
RPython [ Icommon + Ithreaded, P, V ] = P′
threaded
RPython [ Icommon + Imethod, P, V ] = P′
method
One
Engine
One Interpreter
Multitier
Outputs
Derive from
Generic Interp.
Common
Interp.
Tweaked
Defs.
Future Work
Two-level JIT Compilation with .. PEPM 2022 15 / 15
Conclusion and Future Work
Conclusion
• Adaptive RPython actually worked on a small
lang.
RPython [I, P, V] = P′
RPython [ Icommon + Itracing, P, V ] = P′
tracing
RPython [ Icommon + Ithreaded, P, V ] = P′
threaded
RPython [ Icommon + Imethod, P, V ] = P′
method
One
Engine
One Interpreter
Multitier
Outputs
Derive from
Generic Interp.
Common
Interp.
Tweaked
Defs.
Future Work
• Decide multitier compilation
strategy
− How to shift between
levels?
− How to decide an
appropriate level?
• Implement our ideas on PyPy
Two-level JIT Compilation with .. PEPM 2022 15 / 15
Conclusion and Future Work
Conclusion
• Adaptive RPython actually worked on a small
lang.
RPython [I, P, V] = P′
RPython [ Icommon + Itracing, P, V ] = P′
tracing
RPython [ Icommon + Ithreaded, P, V ] = P′
threaded
RPython [ Icommon + Imethod, P, V ] = P′
method
One
Engine
One Interpreter
Multitier
Outputs
Derive from
Generic Interp.
Common
Interp.
Tweaked
Defs.
Future Work
• Decide multitier compilation
strategy
− How to shift between
levels?
− How to decide an
appropriate level?
• Implement our ideas on PyPy
Two-level JIT Compilation with .. PEPM 2022 15 / 15
References I
Izawa, Y., Masuhara, H., Bolz-Tereick, C. F., and Cong, Y. (2021).
Threaded code generation with a meta-tracing JIT compiler.
The Journal of Object Technology Special Issue for ICOOOLPS 2021, pages 1–11.
Accepted.
Two-level JIT Compilation with .. PEPM 2022 1 / 1

More Related Content

What's hot

Challenges in GPU compilers
Challenges in GPU compilersChallenges in GPU compilers
Challenges in GPU compilers
AnastasiaStulova
 
Debugging Applications with GNU Debugger
Debugging Applications with GNU DebuggerDebugging Applications with GNU Debugger
Debugging Applications with GNU Debugger
Priyank Kapadia
 
Nug2004 yhe
Nug2004 yheNug2004 yhe
Nug2004 yhe
Yassine Rafrafi
 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous Computing
Ruymán Reyes
 
Al2ed chapter5
Al2ed chapter5Al2ed chapter5
Al2ed chapter5
Abdullelah Al-Fahad
 
Open cl programming using python syntax
Open cl programming using python syntaxOpen cl programming using python syntax
Open cl programming using python syntax
csandit
 
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
Shinya Takamaeda-Y
 
C under Linux
C under LinuxC under Linux
Everything You Need to Know About the Intel® MPI Library
Everything You Need to Know About the Intel® MPI LibraryEverything You Need to Know About the Intel® MPI Library
Everything You Need to Know About the Intel® MPI Library
Intel® Software
 
MPI Presentation
MPI PresentationMPI Presentation
MPI Presentation
Tayfun Sen
 
Rcpp
RcppRcpp
Rcpp
Ajay Ohri
 
Parsers -
Parsers -Parsers -
Parsers -
Wael Badawy
 
Compiler optimization techniques
Compiler optimization techniquesCompiler optimization techniques
Compiler optimization techniques
Hardik Devani
 
Compiler optimization
Compiler optimizationCompiler optimization
Compiler optimization
ZongYing Lyu
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
IJERD Editor
 
Run time
Run timeRun time
Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
Jeff Larkin
 
1 Vampir Overview
1 Vampir Overview1 Vampir Overview
1 Vampir Overview
PTIHPA
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
Jeff Larkin
 
2010 JNUG BoF
2010 JNUG BoF2010 JNUG BoF
2010 JNUG BoF
NOZAKI Takehiko
 

What's hot (20)

Challenges in GPU compilers
Challenges in GPU compilersChallenges in GPU compilers
Challenges in GPU compilers
 
Debugging Applications with GNU Debugger
Debugging Applications with GNU DebuggerDebugging Applications with GNU Debugger
Debugging Applications with GNU Debugger
 
Nug2004 yhe
Nug2004 yheNug2004 yhe
Nug2004 yhe
 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous Computing
 
Al2ed chapter5
Al2ed chapter5Al2ed chapter5
Al2ed chapter5
 
Open cl programming using python syntax
Open cl programming using python syntaxOpen cl programming using python syntax
Open cl programming using python syntax
 
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
 
C under Linux
C under LinuxC under Linux
C under Linux
 
Everything You Need to Know About the Intel® MPI Library
Everything You Need to Know About the Intel® MPI LibraryEverything You Need to Know About the Intel® MPI Library
Everything You Need to Know About the Intel® MPI Library
 
MPI Presentation
MPI PresentationMPI Presentation
MPI Presentation
 
Rcpp
RcppRcpp
Rcpp
 
Parsers -
Parsers -Parsers -
Parsers -
 
Compiler optimization techniques
Compiler optimization techniquesCompiler optimization techniques
Compiler optimization techniques
 
Compiler optimization
Compiler optimizationCompiler optimization
Compiler optimization
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Run time
Run timeRun time
Run time
 
Cray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best PracticesCray XT Porting, Scaling, and Optimization Best Practices
Cray XT Porting, Scaling, and Optimization Best Practices
 
1 Vampir Overview
1 Vampir Overview1 Vampir Overview
1 Vampir Overview
 
May2010 hex-core-opt
May2010 hex-core-optMay2010 hex-core-opt
May2010 hex-core-opt
 
2010 JNUG BoF
2010 JNUG BoF2010 JNUG BoF
2010 JNUG BoF
 

Similar to Two-level Just-in-Time Compilation with One Interpreter and One Engine

社内勉強会資料_Two Papers Contribute to Faster Python.pdf
社内勉強会資料_Two Papers Contribute to Faster Python.pdf社内勉強会資料_Two Papers Contribute to Faster Python.pdf
社内勉強会資料_Two Papers Contribute to Faster Python.pdf
NABLAS株式会社
 
Pyjion - a JIT extension system for CPython
Pyjion - a JIT extension system for CPythonPyjion - a JIT extension system for CPython
Pyjion - a JIT extension system for CPython
Anthony Shaw
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
Learnbay Datascience
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
Michael Hudson-Doyle
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
Henry Schreiner
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
PyCon Italia
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
Mark Stoodley
 
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular CompilationKnowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Md.Zahidur Rahman
 
Elasticwulf Pycon Talk
Elasticwulf Pycon TalkElasticwulf Pycon Talk
Elasticwulf Pycon Talk
Peter Skomoroch
 
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
Tsundere Chen
 
python presentation
python presentationpython presentation
python presentation
VaibhavMawal
 
Python introduction
Python introductionPython introduction
Python introduction
Learnbay Datascience
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
Ajit Nayak
 
ECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.comECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.com
sholingarjosh102
 
ECET 330 Massive Success--snaptutorial.com
ECET 330 Massive Success--snaptutorial.comECET 330 Massive Success--snaptutorial.com
ECET 330 Massive Success--snaptutorial.com
santricksapiens71
 
Ecet 330 Success Begins / snaptutorial.com
Ecet 330 Success Begins / snaptutorial.comEcet 330 Success Begins / snaptutorial.com
Ecet 330 Success Begins / snaptutorial.com
WilliamsTaylorzm
 
Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.com
Stephenson033
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPython
delimitry
 
Brief Introduction to Cython
Brief Introduction to CythonBrief Introduction to Cython
Brief Introduction to Cython
Aleksandar Jelenak
 
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
Aljoscha Krettek
 

Similar to Two-level Just-in-Time Compilation with One Interpreter and One Engine (20)

社内勉強会資料_Two Papers Contribute to Faster Python.pdf
社内勉強会資料_Two Papers Contribute to Faster Python.pdf社内勉強会資料_Two Papers Contribute to Faster Python.pdf
社内勉強会資料_Two Papers Contribute to Faster Python.pdf
 
Pyjion - a JIT extension system for CPython
Pyjion - a JIT extension system for CPythonPyjion - a JIT extension system for CPython
Pyjion - a JIT extension system for CPython
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
 
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular CompilationKnowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
 
Elasticwulf Pycon Talk
Elasticwulf Pycon TalkElasticwulf Pycon Talk
Elasticwulf Pycon Talk
 
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
PyCon TW 2017 - PyPy's approach to construct domain-specific language runtime...
 
python presentation
python presentationpython presentation
python presentation
 
Python introduction
Python introductionPython introduction
Python introduction
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
ECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.comECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.com
 
ECET 330 Massive Success--snaptutorial.com
ECET 330 Massive Success--snaptutorial.comECET 330 Massive Success--snaptutorial.com
ECET 330 Massive Success--snaptutorial.com
 
Ecet 330 Success Begins / snaptutorial.com
Ecet 330 Success Begins / snaptutorial.comEcet 330 Success Begins / snaptutorial.com
Ecet 330 Success Begins / snaptutorial.com
 
Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.com
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPython
 
Brief Introduction to Cython
Brief Introduction to CythonBrief Introduction to Cython
Brief Introduction to Cython
 
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
Talk Python To Me: Stream Processing in your favourite Language with Beam on ...
 

Recently uploaded

Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 

Recently uploaded (20)

Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 

Two-level Just-in-Time Compilation with One Interpreter and One Engine

  • 1. Two-level Just-in-Time Compilation with One Interpreter and One Engine Yusuke Izawa 1 Hidehiko Masuhara 1 Carl Friedrich Bolz-Tereick 2 1Tokyo Institute of Technology 2Heinrich-Heine-Universität Düsseldorf PEPM 2022 January 18, 2022 Two-level JIT Compilation with .. PEPM 2022 1 / 15
  • 2. Outline 1. Introduction: the folklore in a JIT community and our findings 2. Proposal: Adaptive RPython that performs multitier compilation with “one interpreter” and “one engine” 3. Observation: to confirm that Adaptive RPython “actually” works Two-level JIT Compilation with .. PEPM 2022 2 / 15
  • 3. Folklore: A Meta-JIT Compiler Performs a Fixed Kind of JIT Compilation • Build an interpreter from scratch for realizing different kinds of JIT compilers Interptracing Interpmethod Interpthreaded Meta-JIT compiler Meta-JIT compiler Meta-JIT compiler Tracing JIT Method JIT Threaded Code Gen.[ICOOOLPS 2021] Two-level JIT Compilation with .. PEPM 2022 3 / 15
  • 4. Folklore: A Meta-JIT Compiler Performs a Fixed Kind of JIT Compilation • Build an interpreter from scratch for realizing different kinds of JIT compilers Interptracing Interpmethod Interpthreaded Meta-JIT compiler Meta-JIT compiler Meta-JIT compiler Tracing JIT Method JIT Threaded Code Gen.[ICOOOLPS 2021] consisting CALL insts in bytecode: removing indirect-branching Two-level JIT Compilation with .. PEPM 2022 3 / 15
  • 5. Folklore: A Meta-JIT Compiler Performs a Fixed Kind of JIT Compilation • Build an interpreter from scratch for realizing different kinds of JIT compilers Interptracing Interpmethod Interpthreaded RPython Truffle/Graal Meta-JIT compiler PyPy TruffleRuby Threaded Code Gen.[ICOOOLPS 2021] Two-level JIT Compilation with .. PEPM 2022 3 / 15
  • 6. Our Findings Will Affect JIT Community’s Assumption JIT community assumes that .. • Meta-tracing JIT compiler can only do tracing compilation RPython[interp, source] = ptracing Two-level JIT Compilation with .. PEPM 2022 4 / 15
  • 7. Our Findings Will Affect JIT Community’s Assumption JIT community assumes that .. • Meta-tracing JIT compiler can only do tracing compilation But, with our findings .. • Let meta-tracing JIT do several compilations, like − method compilation − threaded code compilation − etc. RPython[interp, source] = ptracing RPython[interp, source] = pα RPython[interp, source] = pβ RPython[interp, source] = pγ · · · Two-level JIT Compilation with .. PEPM 2022 4 / 15
  • 8. Our Findings Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 9. Our Findings By providing different interp definitions to RPython, can derive different kinds of outputs E.g. when passes .. Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 10. Our Findings By providing different interp definitions to RPython, can derive different kinds of outputs E.g. when passes .. • interptracing to RPython → tracing compilation RPython[interptracing, source] = ptracing Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 11. Our Findings By providing different interp definitions to RPython, can derive different kinds of outputs E.g. when passes .. • interptracing to RPython → tracing compilation • interpmethod to RPython → method compilation RPython[interptracing, source] = ptracing RPython[interpmethod, source] = pmethod Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 12. Our Findings By providing different interp definitions to RPython, can derive different kinds of outputs E.g. when passes .. • interptracing to RPython → tracing compilation • interpmethod to RPython → method compilation • interpthreaded to RPython → threaded compilation RPython[interptracing, source] = ptracing RPython[interpmethod, source] = pmethod RPython[interpthreaded, source] = pthreaded Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 13. Our Findings By providing different interp definitions to RPython, can derive different kinds of outputs E.g. when passes .. • interptracing to RPython → tracing compilation • interpmethod to RPython → method compilation • interpthreaded to RPython → threaded compilation RPython[interptracing, source] = ptracing RPython[interpmethod, source] = pmethod RPython[interpthreaded, source] = pthreaded  In other words .. By changing an interpreter, we can get different kinds of compilers Two-level JIT Compilation with .. PEPM 2022 5 / 15
  • 14. Proposal: Multitier Compilation on Adaptive RPython Adaptive RPython performs multitier compilation with “one interpreter” and “one engine” optimization level threaded code baseline 2 · · · tracing method tracing + method Two-level JIT Compilation with .. PEPM 2022 6 / 15
  • 15. Proposal: Multitier Compilation on Adaptive RPython Adaptive RPython performs multitier compilation with “one interpreter” and “one engine” optimization level threaded code baseline 2 · · · tracing method tracing + method With Adaptive RPython .. one generic interp. → common interp + a bit different definitions Two-level JIT Compilation with .. PEPM 2022 6 / 15
  • 16. Proposal: Multitier Compilation on Adaptive RPython Adaptive RPython performs multitier compilation with “one interpreter” and “one engine” optimization level threaded code baseline 2 · · · tracing method tracing + method With Adaptive RPython .. one generic interp. → common interp + a bit different definitions perform on one engine = RPython Two-level JIT Compilation with .. PEPM 2022 6 / 15
  • 17. Overview: Adaptive RPython Performs Multitier Compilation (1) A developer writes a generic interp Generic interp Adaptive RPython Pre-processor Adaptive RPython P.E. System Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 18. Overview: Adaptive RPython Performs Multitier Compilation (2) Pass information to the pre-processor Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Adaptive RPython P.E. System Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 19. Overview: Adaptive RPython Performs Multitier Compilation (3) Generate interps from generic interp Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Icommon Itracing Ithreaded Imethod Adaptive RPython P.E. System Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 20. Overview: Adaptive RPython Performs Multitier Compilation (4) Pass information to the offline P.E. Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Icommon Itracing Ithreaded Imethod Adaptive RPython P.E. System Source program and info about static and dy- namic inputs Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 21. Overview: Adaptive RPython Performs Multitier Compilation (5) Tracing compilation: choose Icommon and Itracing RPython[Icommon + Itracing, P, V] = P′ tracing Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Icommon Itracing Ithreaded Imethod Adaptive RPython P.E. System Source program and info about static and dy- namic inputs Ptracing Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 22. Overview: Adaptive RPython Performs Multitier Compilation (6) Threaded code gen. [Izawa et al., 2021] : choose Icommon and Ithreaded RPython[Icommon + Ithreaded, P, V] = P′ threaded Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Icommon Itracing Ithreaded Imethod Adaptive RPython P.E. System Source program and info about static and dy- namic inputs Ptracing Pthreaded Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 23. Overview: Adaptive RPython Performs Multitier Compilation (7) Method compilation: choose Icommon and Imethod RPython[Icommon + Imethod, P, V] = P′ method Generic interp Adaptive RPython Pre-processor Which instruc- tions will be transformed? Icommon Itracing Ithreaded Imethod Adaptive RPython P.E. System Source program and info about static and dy- namic inputs Ptracing Pthreaded Pmethod Two-level JIT Compilation with .. PEPM 2022 7 / 15
  • 24. Overview: How to Drive the RPython Engine [ICOOOLPS 2021] Meta-tracing JIT • Trace the execution of an interp. Threaded code generation A B C D JUMP E F RET c a l l [p0] i1 = load(..) i1 = int_add(..) i2 = int_lt(..) guard_true(i2) [p0] .. .. jump(p0) Two-level JIT Compilation with .. PEPM 2022 8 / 15
  • 25. Overview: How to Drive the RPython Engine [ICOOOLPS 2021] Meta-tracing JIT • Trace the execution of an interp Threaded code generation Two-level JIT Compilation with .. PEPM 2022 9 / 15
  • 26. Overview: How to Drive the RPython Engine [ICOOOLPS 2021] Meta-tracing JIT • Trace the execution of an interp Threaded code generation • Traverse the entire method body • Not trace inside the handlers Two-level JIT Compilation with .. PEPM 2022 9 / 15
  • 27. Overview: How to Drive the RPython Engine [ICOOOLPS 2021] Meta-tracing JIT • Trace the execution of an interp Threaded code generation • Traverse the entire method body • Not trace inside the handlers A B C D JUMP E F RET c a l l c a l l Traverse the en- tire method body Not trace the inside but leave CALL to the handler Cut/stitch the temporal trace [p0] i7 = call_i(ConstClass(DUP, ..)) i12 = call_i(ConstClass(CONST_I ..)) i16 = call_i(ConstClass(LT, ..)) guard_true(i16) [p0] ... jump(p0) [p0] ... i28 = call_i(ConstClass(CALL, ..)) ... i32 = call_i(ConstClass(RET, ..2)) leave_portal_frame(0) finish(i32) bridge Two-level JIT Compilation with .. PEPM 2022 9 / 15
  • 28. Overview: How to Drive the RPython Engine [ICOOOLPS 2021] Meta-tracing JIT • Trace the execution of an interp Threaded code generation • Traverse the entire method body • Not trace inside the handlers tweaking an interp A B C D JUMP E F RET c a l l c a l l Traverse the en- tire method body Not trace the inside but leave CALL to the handler Cut/stitch the temporal trace [p0] i7 = call_i(ConstClass(DUP, ..)) i12 = call_i(ConstClass(CONST_I ..)) i16 = call_i(ConstClass(LT, ..)) guard_true(i16) [p0] ... jump(p0) [p0] ... i28 = call_i(ConstClass(CALL, ..)) ... i32 = call_i(ConstClass(RET, ..2)) leave_portal_frame(0) finish(i32) bridge Two-level JIT Compilation with .. PEPM 2022 9 / 15
  • 29. Method-traversal Interpreter: How to Drive the RPython Engine [ICOOOLPS 2021]  traverse depth-firstly the entire method body w/ traverse_stack @dont_look_insdie def ADD(): .. while True: if opcde == JUMP_IF: top = pop() target = bytecode[pc++] if top.is_true(): traverse_stack.push(pc++) pc = target else: traverse_stack.push(target) pc++ elif opcode == JUMP: target = bytecode[pc++] if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: finish() elif opcode == RET: if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: return pop()
  • 30. Method-traversal Interpreter: How to Drive the RPython Engine [ICOOOLPS 2021]  traverse depth-firstly the entire method body w/ traverse_stack @dont_look_insdie def ADD(): .. while True: if opcde == JUMP_IF: top = pop() target = bytecode[pc++] if top.is_true(): traverse_stack.push(pc++) pc = target else: traverse_stack.push(target) pc++ elif opcode == JUMP: target = bytecode[pc++] if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: finish() elif opcode == RET: if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: return pop() Suppress inlining
  • 31. Method-traversal Interpreter: How to Drive the RPython Engine [ICOOOLPS 2021]  traverse depth-firstly the entire method body w/ traverse_stack @dont_look_insdie def ADD(): .. while True: if opcde == JUMP_IF: top = pop() target = bytecode[pc++] if top.is_true(): traverse_stack.push(pc++) pc = target else: traverse_stack.push(target) pc++ elif opcode == JUMP: target = bytecode[pc++] if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: finish() elif opcode == RET: if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: return pop() Suppress inlining Save another side to traverse later
  • 32. Method-traversal Interpreter: How to Drive the RPython Engine [ICOOOLPS 2021]  traverse depth-firstly the entire method body w/ traverse_stack @dont_look_insdie def ADD(): .. while True: if opcde == JUMP_IF: top = pop() target = bytecode[pc++] if top.is_true(): traverse_stack.push(pc++) pc = target else: traverse_stack.push(target) pc++ elif opcode == JUMP: target = bytecode[pc++] if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: finish() elif opcode == RET: if not traverse_stack.is_empty(): pc = traverse_stack.pop() else: return pop() Suppress inlining Save another side to traverse later Jump to another side Two-level JIT Compilation with .. PEPM 2022 10 / 15
  • 33. The Design of Generic Interpreter • From a generic interp, Adaptive RPython generates interps including MTI  Embed tier-specific definitions in a meta-tracing-based interpreter 1. Declare JitTierDriver jittierdriver = JitTierDriver(pc='pc') def interp(self); .. if opcode == JUMP_IF: target = bytecode[pc] elif opcode == JUMP: target = bytecode[pc] elif opcode == RET: w_x = self.pop() elif .. Two-level JIT Compilation with .. PEPM 2022 11 / 15
  • 34. The Design of Generic Interpreter • From a generic interp, Adaptive RPython generates interps including MTI  Embed tier-specific definitions in a meta-tracing-based interpreter 1. Declare JitTierDriver 2. Define can_enter_tier1_XX at JUMP_IF, JUMP, RET for threaded code gen. and method comp. jittierdriver = JitTierDriver(pc='pc') def interp(self); .. if opcode == JUMP_IF: target = bytecode[pc] jittierdriver.can_enter_tier1_branch( true_path=target,false_path=pc+1, cond=self.is_true) if we_are_in_tier2(): elif opcode == JUMP: target = bytecode[pc] jittierdriver.can_enter_tier1_jump(target=target) elif opcode == RET: w_x = self.pop() jittierdriver.can_enter_tier1_ret(ret_value=w_x) elif .. Two-level JIT Compilation with .. PEPM 2022 11 / 15
  • 35. The Design of Generic Interpreter • From a generic interp, Adaptive RPython generates interps including MTI  Embed tier-specific definitions in a meta-tracing-based interpreter 1. Declare JitTierDriver 2. Define can_enter_tier1_XX at JUMP_IF, JUMP, RET for threaded code gen. and method comp. 3. Define interp. for tracing JIT inside we_are_in_tier2 jittierdriver = JitTierDriver(pc='pc') def interp(self); .. if opcode == JUMP_IF: target = bytecode[pc] jittierdriver.can_enter_tier1_branch( true_path=target,false_path=pc+1, cond=self.is_true) if we_are_in_tier2(): do stuff for tracing JIT elif opcode == JUMP: target = bytecode[pc] jittierdriver.can_enter_tier1_jump(target=target) if we_are_in_tier2(): do stuff for tracing JIT elif opcode == RET: w_x = self.pop() jittierdriver.can_enter_tier1_ret(ret_value=w_x) if we_are_in_tier2(): do stuff for tracing JIT elif .. Two-level JIT Compilation with .. PEPM 2022 11 / 15
  • 36. The Design of Generic Interpreter • From a generic interp, Adaptive RPython generates interps including MTI  Embed tier-specific definitions in a meta-tracing-based interpreter 1. Declare JitTierDriver 2. Define can_enter_tier1_XX at JUMP_IF, JUMP, RET for threaded code gen. and method comp. 3. Define interp. for tracing JIT inside we_are_in_tier2 4. The pre-processor generates method-traversal interp and tracing interp from this jittierdriver = JitTierDriver(pc='pc') def interp(self); .. if opcode == JUMP_IF: target = bytecode[pc] jittierdriver.can_enter_tier1_branch( true_path=target,false_path=pc+1, cond=self.is_true) if we_are_in_tier2(): do stuff for tracing JIT elif opcode == JUMP: target = bytecode[pc] jittierdriver.can_enter_tier1_jump(target=target) if we_are_in_tier2(): do stuff for tracing JIT elif opcode == RET: w_x = self.pop() jittierdriver.can_enter_tier1_ret(ret_value=w_x) if we_are_in_tier2(): do stuff for tracing JIT elif .. Two-level JIT Compilation with .. PEPM 2022 11 / 15
  • 37. Observation: Can Adaptive RPython “Actually” Work? (1) Setup • Write TLA lang. interpreter in Adaptive RPython • Run TLA interpreter on small examples − loopabit: nested loop − callabit: two functions – one is suitable for tracing, the other is for thraeded code gen. (method) NOTE • Current multitier is the combination of threaded code gen. and tracing (two-level) Two-level JIT Compilation with .. PEPM 2022 12 / 15
  • 38. Observation: Can Adaptive RPython “Actually” Work? (2) Situation in callabit: increasing an optimization level program JIT applied to f JIT applied to g callabit_baseline_interp threaded (interpreted) function f (for threaded code gen.) function g (for trac- ing comp.) call ret threaded code generation interpreted Two-level JIT Compilation with .. PEPM 2022 13 / 15
  • 39. Observation: Can Adaptive RPython “Actually” Work? (2) Situation in callabit: increasing an optimization level program JIT applied to f JIT applied to g callabit_baseline_interp threaded (interpreted) callabit_baseline_only threaded threaded function f (for threaded code gen.) function g (for trac- ing comp.) call ret threaded code generation threaded code generation Two-level JIT Compilation with .. PEPM 2022 13 / 15
  • 40. Observation: Can Adaptive RPython “Actually” Work? (2) Situation in callabit: increasing an optimization level program JIT applied to f JIT applied to g callabit_baseline_interp threaded (interpreted) callabit_baseline_only threaded threaded callabit_tracing_baseline tracing baseline function f (for threaded code gen.) function g (for trac- ing comp.) call ret tracing compi- lation threaded code generation Two-level JIT Compilation with .. PEPM 2022 13 / 15
  • 41. Observation: Can Adaptive RPython “Actually” Work? (2) Situation in callabit: increasing an optimization level program JIT applied to f JIT applied to g callabit_baseline_interp threaded (interpreted) callabit_baseline_only threaded threaded callabit_tracing_baseline tracing baseline callabit_baseline_tracing threaded tracing function f (for threaded code gen.) function g (for trac- ing comp.) call ret threaded code generation tracing compi- lation Two-level JIT Compilation with .. PEPM 2022 13 / 15
  • 42. Observation: Can Adaptive RPython “Actually” Work? (2) Situation in callabit: increasing an optimization level program JIT applied to f JIT applied to g callabit_baseline_interp threaded (interpreted) callabit_baseline_only threaded threaded callabit_tracing_baseline tracing baseline callabit_baseline_tracing threaded tracing callabit_tracing_only tracing tracing function f (for threaded code gen.) function g (for trac- ing comp.) call ret tracing compi- lation tracing compi- lation Two-level JIT Compilation with .. PEPM 2022 13 / 15
  • 43. Observation: Running Speeds and Trace Sizes • Actually worked: compilation speed is reaching to tracing compilation c a l l a b i t _ b a s e l i n e _ i n t e r p c a l l a b i t _ b a s e l i n e _ o n l y c a l l a b i t _ b a s e l i n e _ t r a c i n g c a l l a b i t _ t r a c i n g _ b a s e l i n e c a l l a b i t _ t r a c i n g _ o n l y 0.0 0.5 1.0 1.5 2.0 2.5 3.0 The speed up ratio (interp = 1) TLA w/ Adaptive RPython (Stable speed) # Traces 0 50 100 150 200 250 300 350 400 callabit_baseline_interp callabit_baseline_only callabit_baseline_tracing callabit_tracing_baseline callabit_tracing_only Increasing better smaller Two-level JIT Compilation with .. PEPM 2022 14 / 15
  • 44. Observation: Running Speeds and Trace Sizes • Actually worked: compilation speed is reaching to tracing compilation • Promising signs: multitier is same speed but smaller code size compared to single tier → might get good performance in the future c a l l a b i t _ b a s e l i n e _ i n t e r p c a l l a b i t _ b a s e l i n e _ o n l y c a l l a b i t _ b a s e l i n e _ t r a c i n g c a l l a b i t _ t r a c i n g _ b a s e l i n e c a l l a b i t _ t r a c i n g _ o n l y 0.0 0.5 1.0 1.5 2.0 2.5 3.0 The speed up ratio (interp = 1) TLA w/ Adaptive RPython (Stable speed) # Traces 0 50 100 150 200 250 300 350 400 callabit_baseline_interp callabit_baseline_only callabit_baseline_tracing callabit_tracing_baseline callabit_tracing_only better smaller Two-level JIT Compilation with .. PEPM 2022 14 / 15
  • 45. Conclusion and Future Work Conclusion • Adaptive RPython actually worked on a small lang. RPython [I, P, V] = P′ RPython [ Icommon + Itracing, P, V ] = P′ tracing RPython [ Icommon + Ithreaded, P, V ] = P′ threaded RPython [ Icommon + Imethod, P, V ] = P′ method One Engine One Interpreter Multitier Outputs Derive from Generic Interp. Common Interp. Tweaked Defs. Future Work Two-level JIT Compilation with .. PEPM 2022 15 / 15
  • 46. Conclusion and Future Work Conclusion • Adaptive RPython actually worked on a small lang. RPython [I, P, V] = P′ RPython [ Icommon + Itracing, P, V ] = P′ tracing RPython [ Icommon + Ithreaded, P, V ] = P′ threaded RPython [ Icommon + Imethod, P, V ] = P′ method One Engine One Interpreter Multitier Outputs Derive from Generic Interp. Common Interp. Tweaked Defs. Future Work • Decide multitier compilation strategy − How to shift between levels? − How to decide an appropriate level? • Implement our ideas on PyPy Two-level JIT Compilation with .. PEPM 2022 15 / 15
  • 47. Conclusion and Future Work Conclusion • Adaptive RPython actually worked on a small lang. RPython [I, P, V] = P′ RPython [ Icommon + Itracing, P, V ] = P′ tracing RPython [ Icommon + Ithreaded, P, V ] = P′ threaded RPython [ Icommon + Imethod, P, V ] = P′ method One Engine One Interpreter Multitier Outputs Derive from Generic Interp. Common Interp. Tweaked Defs. Future Work • Decide multitier compilation strategy − How to shift between levels? − How to decide an appropriate level? • Implement our ideas on PyPy Two-level JIT Compilation with .. PEPM 2022 15 / 15
  • 48. References I Izawa, Y., Masuhara, H., Bolz-Tereick, C. F., and Cong, Y. (2021). Threaded code generation with a meta-tracing JIT compiler. The Journal of Object Technology Special Issue for ICOOOLPS 2021, pages 1–11. Accepted. Two-level JIT Compilation with .. PEPM 2022 1 / 1