org.jikesrvm.osr
Class SpecialCompiler

java.lang.Object
  extended by org.jikesrvm.osr.SpecialCompiler

public class SpecialCompiler
extends Object

SpecialCompiler is a wrapper for compiling specialized byte code. It accepts an instance of ExecutionState, generates the specialized byte code, and compiles it to machine code instructions.


Constructor Summary
SpecialCompiler()
           
 
Method Summary
static CompiledMethod baselineCompile(ExecutionState state)
          Compiles the method with the baseline compiler.
static CompiledMethod optCompile(ExecutionState state)
           generate prologue PSEUDO_bytecode from the state.
static CompiledMethod recompileState(ExecutionState state, boolean invalidate)
          recompile an execution state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecialCompiler

public SpecialCompiler()
Method Detail

recompileState

public static CompiledMethod recompileState(ExecutionState state,
                                            boolean invalidate)
recompile an execution state

Parameters:
state - a list of execution states
invalidate - Is this an invalidation?
Returns:
the compiled method for the root state

baselineCompile

public static CompiledMethod baselineCompile(ExecutionState state)
Compiles the method with the baseline compiler.
  1. generate prologue (PSEUDO_bytecode) from the state.
  2. make up new byte code with prologue.
  3. set method's bytecode to the specilizaed byte code.
  4. call BaselineCompilerImpl.compile, the 'compile' method is customized to process pseudo instructions, and it will reset the byte code to the original one, and adjust the map from bytecode to the generated machine code. then the reference map can be generated corrected relying on the original bytecode.

NOTE: this is different from optCompile which resets the bytecode after compilation. I believe this minimizes the work to change both compilers.

Parameters:
state -
Returns:
a BaselineCompiledMethod

optCompile

public static CompiledMethod optCompile(ExecutionState state)
  1. generate prologue PSEUDO_bytecode from the state.
  2. make new bytecodes with prologue.
  3. set method's bytecode to specialized one.
  4. adjust exception map, line number map.
  5. compile the method.
  6. restore bytecode, exception, linenumber map to the original one.