"

2013 FRC Java API

"

com.sun.squawk.compiler
Interface InterpCompiler

All Superinterfaces:
BaseCompiler, Types
All Known Subinterfaces:
Compiler

public interface InterpCompiler
extends BaseCompiler

Language-independent interpreter-compiler interface to support the construction of interpreters.


Field Summary
 
Fields inherited from interface com.sun.squawk.compiler.BaseCompiler
C_DYNAMIC, C_JVM, C_JVM_DYNAMIC, C_NORMAL, E_ADDRESS, E_NONE, E_NULL, E_REGISTER, P_HIGH, P_LOW, P_MEDIUM
 
Fields inherited from interface com.sun.squawk.compiler.Types
BYTE, DOUBLE, FLOAT, INT, IP, LONG, LP, MP, OOP, REF, RELOC_ABSOLUTE_INT, RELOC_RELATIVE_INT, SHORT, SS, UBYTE, UINT, ULONG, USHORT, UWORD, VOID, WORD
 
Method Summary
 Compiler alloca()
          Add a stack allocation node to the IR.
 Compiler framePointer()
          Push the frame pointer.
 int getFramePointerByteOffset(int fp_value)
          Map the FP.xxx offset codes into real ABI offsets.
 int getIPOffset()
          Get the offset from the frame pointer to slot used for the IP variable.
 int getJumpByte(int bytecodes, int interp, int offset)
          Get a single byte of a jump instruction sequence.
 int getJumpSize()
          Get the length of a jump instruction.
 int getLPOffset()
          Get the offset from the frame pointer to slot used for the LP variable.
 int getMPOffset()
          Get the offset from the frame pointer to slot used for the MP variable.
 Local local(Type type)
          Define a local variable type.
 Local local(Type type, int hint)
          Define a local variable type.
 Local parm(Type type)
          Define a parameter variable.
 Local parm(Type type, int hint)
          Define a parameter variable.
 Compiler peekReceiver()
          Peek the receiver in the runtime stack.
 Compiler stackCheck()
          Ensure that there is enough stack (the values are in bytes).
 Compiler store(Local local)
          Set a local variable or parameter to a value popped from the stack.
 Compiler write(Type type)
          Store a value at a reference.
 
Methods inherited from interface com.sun.squawk.compiler.BaseCompiler
add, and, begin, bf, bf, bind, br, br, bt, bt, call, call, call, call, cmpg, cmpl, com, comment, compile, convert, data, deadCode, decode, div, drop, dumpAll, dup, dupReceiver, end, enter, enter, enter, enter, eq, force, ge, getCode, getCodeSize, getFixupInfo, getLocalCount, getRelocationInfo, gt, isBigEndian, jump, label, le, leave, leave, literal, literal, literal, literal, literal, literal, literal, load, loadParm, loadsMustBeAligned, lt, mul, ne, neg, or, pop, popAll, push, read, rem, result, ret, ret, shl, shr, storeParm, sub, swap, swapAll, swapForABI, symbol, tableSwitchEndPadding, tableSwitchPadding, tosType, ushr, xor
 

Method Detail

getMPOffset

int getMPOffset()
Get the offset from the frame pointer to slot used for the MP variable.

Returns:
the offset in bytes

getIPOffset

int getIPOffset()
Get the offset from the frame pointer to slot used for the IP variable.

Returns:
the offset in bytes

getLPOffset

int getLPOffset()
Get the offset from the frame pointer to slot used for the LP variable.

Returns:
the offset in bytes

getJumpSize

int getJumpSize()
Get the length of a jump instruction.

Returns:
the length in bytes

getJumpByte

int getJumpByte(int bytecodes,
                int interp,
                int offset)
Get a single byte of a jump instruction sequence.

Parameters:
bytecodes - the address of the bytecode array
interp - the address of the interpreter
offset - the offset to the byte to return
Returns:
the byte

alloca

Compiler alloca()
Add a stack allocation node to the IR.

Stack: ..., SIZE -> ...

Returns:
the compiler object

stackCheck

Compiler stackCheck()
Ensure that there is enough stack (the values are in bytes).

Stack: EXTRA_LOCALS, EXTRA_STACK -> _

Returns:
the compiler object

peekReceiver

Compiler peekReceiver()
Peek the receiver in the runtime stack.

Stack: ... -> ..., OOP

Returns:
the compiler object

framePointer

Compiler framePointer()
Push the frame pointer.

Stack: ... -> ..., REF

Returns:
the compiler object

getFramePointerByteOffset

int getFramePointerByteOffset(int fp_value)
Map the FP.xxx offset codes into real ABI offsets.

Parameters:
fp_value - the FP.xxx code
Returns:
the offset in bytes

parm

Local parm(Type type,
           int hint)
Define a parameter variable.

Stack: _ -> _

Specified by:
parm in interface BaseCompiler
Parameters:
type - the type of the local variable (Must be primary, or MP, or IP)
hint - the P_XXXX priority hint.
Returns:
the compiler object

parm

Local parm(Type type)
Define a parameter variable.

Stack: _ -> _

Specified by:
parm in interface BaseCompiler
Parameters:
type - the type of the local variable (Must be primary, or MP, or IP)
Returns:
the compiler object

local

Local local(Type type,
            int hint)
Define a local variable type.

Stack: ... -> ...

Specified by:
local in interface BaseCompiler
Parameters:
type - the type of the local variable (Must be primary, or MP, or IP)
hint - the P_XXXX priority hint.
Returns:
the compiler object

local

Local local(Type type)
Define a local variable type.

Stack: ... -> ...

Specified by:
local in interface BaseCompiler
Parameters:
type - the type of the local variable (Must be primary, or MP, or IP)
Returns:
the compiler object

store

Compiler store(Local local)
Set a local variable or parameter to a value popped from the stack.

Stack: ..., VALUE -> ...

Checks: 1- The local and the value from the stack need to be a primary type or one of MP/IP/LP/SS (i.e., a pointer).

Specified by:
store in interface BaseCompiler
Parameters:
local - the local variable to store into
Returns:
the compiler object

write

Compiler write(Type type)
Store a value at a reference. The value and reference are popped from the stack and the value is written to the referenced address according to the specified type. The type parameter is used to check primary types and to narrow secondary types.

Stack: ..., VALUE, REF -> ...

Checks: 1- The address on the top of the stack should be of type reference (REF). 2- The other value on the stack has to have the same primitive type as the type of the write. All types can be used with this method (primary, secondary, and pseudo types MP/IP/LP/SS), except for VOID.

Specified by:
write in interface BaseCompiler
Parameters:
type - the type of the data to load
Returns:
the compiler object

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"