java.lang.Object
com.dylibso.chicory.runtime.InterpreterMachine
- All Implemented Interfaces:
Machine
- Direct Known Subclasses:
CompilerInterpreterMachine
This is responsible for holding and interpreting the Wasm code.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong[]call(int funcId, long[] args) protected long[]call(MStack stack, Instance instance, Deque<StackFrame> callStack, int funcId, long[] args, com.dylibso.chicory.wasm.types.FunctionType callType, boolean popResults) protected voidCALL(InterpreterMachine.Operands operands) protected voideval(MStack stack, Instance instance, Deque<StackFrame> callStack) protected voidevalDefault(MStack stack, Instance instance, Deque<StackFrame> callStack, com.dylibso.chicory.wasm.types.Instruction instruction, InterpreterMachine.Operands operands) protected static long[]extractArgsForParams(MStack stack, List<com.dylibso.chicory.wasm.types.ValType> params) protected Instanceinstance()protected static intreadMemPtr(MStack stack, InterpreterMachine.Operands operands) protected MStackstack()protected static StackFrameTHROW_REF(Instance instance, int exceptionIdx, MStack stack, StackFrame frame, Deque<StackFrame> callStack) protected booleanuseCurrentInstanceInterpreter(Instance instance, Instance refInstance, int funcId) protected static voidverifyIndirectCall(com.dylibso.chicory.wasm.types.FunctionType actual, com.dylibso.chicory.wasm.types.FunctionType expected)
-
Field Details
-
callStack
-
-
Constructor Details
-
InterpreterMachine
-
-
Method Details
-
evalDefault
protected void evalDefault(MStack stack, Instance instance, Deque<StackFrame> callStack, com.dylibso.chicory.wasm.types.Instruction instruction, InterpreterMachine.Operands operands) throws com.dylibso.chicory.wasm.ChicoryException - Throws:
com.dylibso.chicory.wasm.ChicoryException
-
call
public long[] call(int funcId, long[] args) throws com.dylibso.chicory.wasm.ChicoryException -
call
protected long[] call(MStack stack, Instance instance, Deque<StackFrame> callStack, int funcId, long[] args, com.dylibso.chicory.wasm.types.FunctionType callType, boolean popResults) throws com.dylibso.chicory.wasm.ChicoryException - Throws:
com.dylibso.chicory.wasm.ChicoryException
-
instance
-
stack
-
eval
protected void eval(MStack stack, Instance instance, Deque<StackFrame> callStack) throws com.dylibso.chicory.wasm.ChicoryException - Throws:
com.dylibso.chicory.wasm.ChicoryException
-
CALL
-
readMemPtr
-
useCurrentInstanceInterpreter
-
THROW_REF
protected static StackFrame THROW_REF(Instance instance, int exceptionIdx, MStack stack, StackFrame frame, Deque<StackFrame> callStack) -
extractArgsForParams
-
verifyIndirectCall
protected static void verifyIndirectCall(com.dylibso.chicory.wasm.types.FunctionType actual, com.dylibso.chicory.wasm.types.FunctionType expected) throws com.dylibso.chicory.wasm.ChicoryException - Throws:
com.dylibso.chicory.wasm.ChicoryException
-