|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.joanju.cg.core.Layout
public class Layout
Provides static Bytecode layout information. We count on some instructions to be processed before other instructions (for example: "supers", before any calls), so changing the overall layout of the bytecode must be done carefully (or not at all).
ReservedCUID
Field Summary | |
---|---|
static int |
CU_ADDRESS
The address of the compileunit instruction. |
static int |
CUID_CALLNAME
ReservedCUID |
static int |
CUID_CHECKVALS
ReservedCUID |
static int |
CUID_GLOBALS
ReservedCUID |
static int |
CUID_INCLUDES
ReservedCUID |
static int |
CUID_LAST_RESERVED
ReservedCUID |
static int |
CUID_PUBSUB
ReservedCUID |
static int |
CUID_SESSIONSUPERS
ReservedCUID |
static int |
CUID_UNRES
ReservedCUID |
static int |
FIRST_CU_HEADER_SEQUENTIAL_INSTRUCTION
Sequential instructions for the compile unit header, such as string literals and other constants, begin here. |
static int |
FIRST_INTERNAL_PROC_ADDRESS
The address of the first internal procedure. |
static int |
LAYOUT_VERSION
This gives us the layout version of all the bytecode in general. |
static int |
MAIN_PROCEDURE_ADDRESS
The address of procedure segment for the main program block. |
static char |
METHODSIG_INPUT
Method sig entry for INPUT param. |
static char |
METHODSIG_INPUTOUTPUT
Method sig entry for INPUT-OUTPUT param. |
static char |
METHODSIG_OUTPUT
Method sig entry for OUTPUT param. |
static char |
METHODSIG_RETURN
Method sig entry for method/function return. |
static int |
SUPERS_ADDRESS
The address of the supers instruction. |
static int |
UNKNOWN_VALUE_ADDRESS
The address in every CU header for the unknown value. |
static int |
UNRESOLVED_SOURCE_ADDRESS
An address to be used as a local source, when the target is unresolved. |
static int |
UNRESOLVED_VALUE
This is used in {values} to indicate at least one unresolved value. |
Constructor Summary | |
---|---|
Layout()
|
Method Summary | |
---|---|
static boolean |
isInternalProcedureAddress(int addr)
Is the input address a valid address for an internal function/procedure? |
static int |
methodSigArgInstructionsCount(java.lang.String methodSig)
Given a method sig, get the number of instructions for the args. |
static java.util.ArrayList<java.lang.Integer> |
methodSigPopAddresses(java.lang.String methodSig,
int endpointAddress,
boolean forCall)
Get a list of pop instruction addresses for a call or procedure (endpoint). |
static int |
methodSigReturnPopOffset(java.lang.String methodSig)
Get the offset of the pop instruction for the return value from a function/method. |
static int |
procedureAddressForPosition(int zeroBasedPosition)
Generate the address for a procedure segment for a compile unit sub procedure. |
static int |
procedureInstrAddrFor(int address)
For an input instruction address, get the address for the procedure block it belongs to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char METHODSIG_INPUT
public static final char METHODSIG_OUTPUT
public static final char METHODSIG_INPUTOUTPUT
public static final char METHODSIG_RETURN
public static final int CUID_GLOBALS
public static final int CUID_INCLUDES
public static final int CUID_UNRES
public static final int CUID_SESSIONSUPERS
public static final int CUID_CALLNAME
public static final int CUID_CHECKVALS
public static final int CUID_PUBSUB
public static final int CUID_LAST_RESERVED
public static final int LAYOUT_VERSION
public static final int UNRESOLVED_VALUE
public static final int CU_ADDRESS
public static final int SUPERS_ADDRESS
public static final int UNRESOLVED_SOURCE_ADDRESS
public static final int UNKNOWN_VALUE_ADDRESS
public static final int FIRST_CU_HEADER_SEQUENTIAL_INSTRUCTION
public static final int MAIN_PROCEDURE_ADDRESS
public static final int FIRST_INTERNAL_PROC_ADDRESS
Constructor Detail |
---|
public Layout()
Method Detail |
---|
public static boolean isInternalProcedureAddress(int addr)
public static int methodSigArgInstructionsCount(java.lang.String methodSig)
public static java.util.ArrayList<java.lang.Integer> methodSigPopAddresses(java.lang.String methodSig, int endpointAddress, boolean forCall)
isCall
- True if calculating for a call, false if calculating for a procedure.public static int methodSigReturnPopOffset(java.lang.String methodSig)
public static int procedureAddressForPosition(int zeroBasedPosition)
zeroBasedPosition
- Internal procedure positions are persistent from
build to build. The positions are counted from zero.for the main program block's procedure segment.
public static int procedureInstrAddrFor(int address)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |