Context Threading: A flexible and efficient dispatch technique for ...

0 downloads 160 Views 195KB Size Report
Context Threading. 21. Mispredicted Taken Branches. 0. 0.25. 0.50. 0.75. 1.00 compressdb jack javac jess mpeg mtrt ray s
Context Threading: A flexible and efficient dispatch technique for virtual machine interpreters Marc Berndl Benjamin Vitale Mathew Zaleski Angela Demke Brown

Research supported by IBM CAS, NSERC, CITO

1

Interpreter performance

• Why not just in time (JIT) compile?

• High performance JVMs still interpret • People use interpreted languages that don’t yet have JITs

• They still want performance!

• 30-40% of execution time is due to stalls caused by branch misprediction.

• Our technique eliminates 95% of branch mispredictions

Context Threading

2

Overview ✔Motivation

•Background: The Context Problem •Existing Solutions •Our Approach •Inlining •Results Context Threading

3

A Tale of Two Machines Virtual Machine Interpreter Execution Cycle

Real Machine CPU

Context Threading

Loaded Program

load

Execution Cycle

Bytecode Bodies Pipeline

Predictors

Virtual Program

4

Target Address (Indirect) Return Address Wayness (Conditional)

Interpreter

Loaded Program

fetch

execute

dispatch

Load Parms

Internal Representation

Bytecode bodies Execution Cycle

Context Threading

5

Running Java Example Java Bytecode

Java Source void foo(){ int i=1; do{ i+=i; } while(i

Suggest Documents