public class ILOCInterpreter extends Object implements ILOCProcessor
--------------- 2^16-1 | Stack | | | | | v | | | | | \/\/\/\/\/\/\/\ | | | ^ | | | | | Heap | --------------- | Data | --------------- 0 --------------- | Code | ---------------The IP register does not contain a valid memory address, but rather it points to the index of the next
ILOCInstruction
in the
currently-executing ILOCFunction
.
The heap region is currently unused.Constructor and Description |
---|
ILOCInterpreter() |
ILOCInterpreter(boolean trace) |
Modifier and Type | Method and Description |
---|---|
void |
assertAllRegOperands(ILOCInstruction insn,
int regs) |
void |
assertIsValid(ILOCInstruction insn) |
void |
assertNumOperands(ILOCInstruction insn,
int ops) |
void |
assertOperandIsRegister(ILOCInstruction insn,
ILOCOperand op) |
void |
assertOperandType(ILOCInstruction insn,
ILOCOperand op,
ILOCOperand.Type type) |
void |
checkStack() |
void |
dumpSystemState() |
int |
findJumpTarget(ILOCOperand targ) |
boolean |
getBool(ILOCOperand src) |
int |
getInt(ILOCOperand src) |
int |
getReturnValue() |
boolean |
handle(ILOCInstruction insn) |
int |
loadInt(int address) |
int |
pop() |
void |
process(ILOCProgram program)
Perform analysis and/or modification on the given ILOC program
|
void |
push(int value) |
void |
setBool(ILOCOperand dst,
boolean value) |
void |
setBool(ILOCOperand dst,
int value) |
void |
setInt(ILOCOperand dst,
int value) |
void |
storeInt(int address,
int value) |
public ILOCInterpreter()
public ILOCInterpreter(boolean trace)
public void process(ILOCProgram program)
ILOCProcessor
process
in interface ILOCProcessor
program
- ILOCProgram
to processpublic void assertNumOperands(ILOCInstruction insn, int ops) throws InvalidInstructionException
InvalidInstructionException
public void assertOperandIsRegister(ILOCInstruction insn, ILOCOperand op) throws InvalidInstructionException
InvalidInstructionException
public void assertAllRegOperands(ILOCInstruction insn, int regs) throws InvalidInstructionException
InvalidInstructionException
public void assertOperandType(ILOCInstruction insn, ILOCOperand op, ILOCOperand.Type type) throws InvalidInstructionException
InvalidInstructionException
public void assertIsValid(ILOCInstruction insn) throws InvalidInstructionException
InvalidInstructionException
public boolean handle(ILOCInstruction insn) throws InvalidInstructionException
InvalidInstructionException
public int getInt(ILOCOperand src)
public void setInt(ILOCOperand dst, int value)
public boolean getBool(ILOCOperand src)
public void setBool(ILOCOperand dst, int value)
public void setBool(ILOCOperand dst, boolean value)
public int findJumpTarget(ILOCOperand targ)
public void storeInt(int address, int value)
public int loadInt(int address)
public void push(int value)
public int pop()
public int getReturnValue()
public void checkStack()
public void dumpSystemState()
Copyright © 2019. All rights reserved.