Class WasmInstruction
java.lang.Object
de.inetsoftware.jwebassembly.module.WasmInstruction
- Direct Known Subclasses:
DupThis, JumpInstruction, WasmArrayInstruction, WasmBlockInstruction, WasmCallInstruction, WasmConstInstruction, WasmConvertInstruction, WasmGlobalInstruction, WasmLocalInstruction, WasmMemoryInstruction, WasmNopInstruction, WasmNumericInstruction, WasmStructInstruction, WasmTableInstruction
Base class of all WasmInstruction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumType of instruction to faster differ as with instanceof. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWasmInstruction(int javaCodePos, int lineNumber) Create a new instance of an instruction -
Method Summary
Modifier and TypeMethodDescription(package private) intGet current code position in Java method.(package private) intGet the line number in the Java source file(package private) abstract intGet the count of values that are removed from the stack.(package private) abstract AnyType[](package private) abstract AnyTypeGet the ValueType if this instruction push a value on the stack.(package private) abstract WasmInstruction.TypegetType()Get the type of instruction(package private) voidsetCodePosition(int newPos) Set a new code position after reorganize the order(package private) abstract voidwriteTo(ModuleWriter writer) Write this instruction to the WASM module.
-
Field Details
-
javaCodePos
private int javaCodePos -
lineNumber
private final int lineNumber
-
-
Constructor Details
-
WasmInstruction
WasmInstruction(int javaCodePos, int lineNumber) Create a new instance of an instruction- Parameters:
javaCodePos- the code position/offset in the Java methodlineNumber- the line number in the Java source code
-
-
Method Details
-
getType
-
writeTo
Write this instruction to the WASM module.- Parameters:
writer- the target writer- Throws:
IOException- if any I/O error occur
-
getCodePosition
int getCodePosition()Get current code position in Java method.- Returns:
- the position
-
getLineNumber
int getLineNumber()Get the line number in the Java source file- Returns:
- the line number
-
setCodePosition
void setCodePosition(int newPos) Set a new code position after reorganize the order- Parameters:
newPos- new position
-
getPushValueType
-
getPopCount
abstract int getPopCount()Get the count of values that are removed from the stack.- Returns:
- the count
-
getPopValueTypes
-