|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.joanju.cg.compileunit.InstructionSet
public class InstructionSet
Target for Compiler Bytecode instructions. Provides services for add/move/remove of Bytecode instructions for a single compile unit. It maintains internal Maps of the bytecode instructions for fast lookup and sorted iteration by address.
Field Summary | |
---|---|
Checkvals |
checkvalCache
|
static int |
LAZY_LOAD_FROM_DB
|
PProcedureCache |
ppcache
We keep a persistent procedure cache around for as long as we're working on this one instruction set. |
Constructor Summary | |
---|---|
InstructionSet(int cuid)
|
|
InstructionSet(int cuid,
int flags)
Valid bit field flags are: LAZY_LOAD_FROM_DB. |
Method Summary | |
---|---|
void |
addRecalc(java.util.Collection<java.lang.Integer> addresses)
Add a set of instruction addresses to schedule for localRecalc. |
void |
addRecalc(int addr)
Add a single instruction address to schedule for localRecalc. |
void |
addRecalcCalls()
Add recalcs for all Call instructions. |
void |
addRecalcCallSupers()
Add recalcs for all Callsuper instructions. |
void |
calcLocalValues()
Calculate the local values for all instructions in this set. |
int |
fillFromDB()
Construct the instruction set from the database. |
int |
fillFromDBWithData()
Construct the instruction set from the database with data. |
void |
finalizeAndStoreCheckedRecords()
This is called from Checkvals. |
void |
finalizeAndStoreNewBuild(int[] fileIDIndex)
|
Bytecode |
get(int address)
|
java.util.TreeMap<java.lang.Integer,Bytecode> |
getCopy()
|
ProcedureInstr |
getProcedureInstrFor(int address)
For an input instruction address, get the ProcedureInstr for the procedure it belongs to. |
java.util.ArrayList<Bytecode> |
getSortedList()
|
Bytecode |
getThisProcedureExprInstr()
For THIS-PROCEDURE as an r-value, just need an instruction which returns this CUID. |
boolean |
isProcNameExpression()
Used by BuiltinfuncInstr. |
int |
lookupLocalProcedureAddress(int nameID)
|
java.util.HashSet<int[]> |
lookupSupersLocally(int procnameID)
Lookup a set of local supers {cuid, procaddress} for a procedure name. |
void |
move(Bytecode bc,
int newAddress)
|
int |
nextSequentialHeaderInstructionAddress()
|
void |
put(Bytecode bc)
|
void |
rebuildSuperProceduresLookupTable()
|
void |
recalc()
|
Bytecode |
remove(int address)
|
ScriptValsInstr |
scriptValsInstr(java.util.Collection<java.lang.String> strings)
Add a ScriptValsInstr to the header, returns the new instruction record. |
void |
setProcNameExpression(boolean on)
Set by the code generator. |
Bytecode |
stringLiteralInstruction(java.lang.String s)
Get or create a LiteralstrInstr for the input string. |
void |
writeFixedHeaderInstructions()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LAZY_LOAD_FROM_DB
public Checkvals checkvalCache
public PProcedureCache ppcache
Constructor Detail |
---|
public InstructionSet(int cuid)
public InstructionSet(int cuid, int flags)
LAZY_LOAD_FROM_DB
Method Detail |
---|
public void addRecalc(int addr)
public void addRecalc(java.util.Collection<java.lang.Integer> addresses)
public void addRecalcCalls() throws java.sql.SQLException
java.sql.SQLException
public void addRecalcCallSupers() throws java.sql.SQLException
java.sql.SQLException
public void calcLocalValues() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public int fillFromDB() throws java.sql.SQLException
java.sql.SQLException
public int fillFromDBWithData() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void finalizeAndStoreCheckedRecords() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void finalizeAndStoreNewBuild(int[] fileIDIndex) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public Bytecode get(int address) throws java.sql.SQLException
java.sql.SQLException
public ProcedureInstr getProcedureInstrFor(int address) throws java.sql.SQLException
java.sql.SQLException
public Bytecode getThisProcedureExprInstr()
public boolean isProcNameExpression()
public java.util.TreeMap<java.lang.Integer,Bytecode> getCopy()
public java.util.ArrayList<Bytecode> getSortedList()
public java.util.HashSet<int[]> lookupSupersLocally(int procnameID) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public int lookupLocalProcedureAddress(int nameID) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
CompileunitInstr.lookupActiveProcedureAddress(int)
public void move(Bytecode bc, int newAddress) throws java.sql.SQLException
java.sql.SQLException
public void put(Bytecode bc)
public int nextSequentialHeaderInstructionAddress()
public void rebuildSuperProceduresLookupTable() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void recalc() throws java.io.IOException, java.sql.SQLException
java.io.IOException
java.sql.SQLException
public Bytecode remove(int address) throws java.sql.SQLException
java.sql.SQLException
public void setProcNameExpression(boolean on)
public ScriptValsInstr scriptValsInstr(java.util.Collection<java.lang.String> strings) throws java.sql.SQLException
java.sql.SQLException
ScriptValsInstr.ScriptValsInstr(int, int, Collection)
public Bytecode stringLiteralInstruction(java.lang.String s) throws java.sql.SQLException
java.sql.SQLException
public void writeFixedHeaderInstructions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |