Вы находитесь на странице: 1из 9

Mohamed. M.

Saad
Java Virtual Machine Prototype based on
Jikes RVM
Targets
Code profiling/visualization using execution flow
Utilize large number of cores through possible
parallel portions of code

Adaptive Online
System




Compiler
Baseline Complier
JIT Compiler

Insert TM_start & TM_end
at every independent
possible path
Lazy commit (write-buffer)
Contention Resolution
based on
Program Order
Execution Frequency


Modifying the Baseline Compiler
TemplateCompilerFramework class
Converting Java Bytecode into Machine language (Assembly)
genCode(){
..
switch(opcode){
case <instruction bytecode>:
emmit_<instruction>:
}
}
Plugin some code to profile block start event

Profiling execution using GraphViz script

int counter = 0;
for(int i=0; i<2; i++)
if(Math.random()>0.3)
counter++;
else
counter--;
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: goto 29
7: invokestatic #13;
10: ldc2_w #19;
13: dcmpl
14: ifle 23
17: iinc 1, 1
20: goto 26
23: iinc 1, -1
26: iinc 2, 1
29: iload_2
30: bipush 12
32: if_icmplt 7
35: return
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: goto 29
7: invokestatic #13;
10: ldc2_w #19;
13: dcmpl
14: ifle 23
17: iinc 1, 1
20: goto 26
23: iinc 1, -1
26: iinc 2, 1
29: iload_2
30: bipush 12
32: if_icmplt 7
35: return
public class Test{
public static void foo(){
int counter = 0;
for(int i=0; i<12; i++)
if(Math.random()>0.3)
counter++;
else
counter--;
}

public static void zoo(){
System.out.println("hi");
}

public static void main(String[] args){
int i=6;
if(i<10)
foo();
else
zoo();
}
}

Building execution flow tracking system
Split the code to basic blocks
Collect execution patterns
Visualizing execution
Parallelizing the execution of the code using different
threads
Dependency analysis
Branch prediction
Packaging & grouping blocks (superblock)
Preserving program order and data consistency using
STM
Checkpointing
Closed nesting in loop parallelization

Вам также может понравиться