Interface JitCodeGenerator.PcGen
- Enclosing class:
JitCodeGenerator<THIS extends JitCompiledPassage>
public static interface JitCodeGenerator.PcGen
A mechanism to emit bytecode that loads a program counter
-
Method Summary
Modifier and TypeMethodDescription<N extends Emitter.Next>
Emitter<Emitter.Ent<N, Types.TLong>> Emit bytecode to load a program counterstatic <THIS extends JitCompiledPassage>
JitCodeGenerator.PcGenloadLocal(Local<Types.TLong> local) Create a generator that loads the program counter from a temporary localstatic JitCodeGenerator.PcGenloadOffset(Address address) Create a generator that loads a constant program counter valuestatic <THIS extends JitCompiledPassage>
JitCodeGenerator.PcGenloadTarget(Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVal target) Create a generator that loads a variable program counter
-
Method Details
-
loadOffset
Create a generator that loads a constant program counter value- Parameters:
address- the program counter- Returns:
- the generator
-
loadTarget
static <THIS extends JitCompiledPassage> JitCodeGenerator.PcGen loadTarget(Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVal target) Create a generator that loads a variable program counter- Type Parameters:
THIS- the type of the generated passage- Parameters:
localThis- a handle to the local holding thethisreferencegen- the code generatortarget- the value (probably a variable) to load to get the program counter- Returns:
- the generator
-
loadLocal
Create a generator that loads the program counter from a temporary localThis is used to verify a re-written indirect branch whose target constant became invalidated. In that case, the actual run-time target is loaded using
loadTarget(Local, JitCodeGenerator, JitVal)and then stored into a temporary local. That target is compared to the now-invalidated constant target. If it matches, the direct internal branch is taken. Otherwise, we exit. LATER: If it happens that the targetJitValis allocated in a local, anyway, the temporary local is a bit redundant. It might be nice to avoid that.- Type Parameters:
THIS- the type of the generated passage- Parameters:
local- the local holding the program counter- Returns:
- the generator
-
gen
Emit bytecode to load a program counter- Type Parameters:
N- the incoming stack- Parameters:
em- the emitter typed with the incoming stack- Returns:
- the emitter typed with the resulting stack, i.e., having pushed the counter value
-