Class WasmEmbbeddedCode
- java.lang.Object
-
- de.inetsoftware.jwebassembly.module.WasmEmbbeddedCode
-
class WasmEmbbeddedCode extends java.lang.Object
Code that will directly embedded in the compiler output. The code can be written in Java or via Wat code. This is not a replacement of runtime API. It emulate the behavior of the Java VM.The class should not have any references to classes of the JWebAssembly compiler to prevent that parts of the compiler will be embedded.
-
-
Constructor Summary
Constructors Constructor Description WasmEmbbeddedCode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.ArithmeticException
createDivByZero()
Create an ArithmeticException with message "/ by zero"(package private) static int
idiv(int quotient, int divisor)
Integer division that throw an ArithmeticException on a division by zero instead a trap of the WebAssembly engine.(package private) static long
ldiv(long quotient, long divisor)
Long division that throw an ArithmeticException on a division by zero instead a trap of the WebAssembly engine.
-
-
-
Method Detail
-
idiv
static int idiv(int quotient, int divisor)
Integer division that throw an ArithmeticException on a division by zero instead a trap of the WebAssembly engine.- Parameters:
quotient
- the quotient of the operationdivisor
- the divisor of the operation- Returns:
- the result
-
ldiv
static long ldiv(long quotient, long divisor)
Long division that throw an ArithmeticException on a division by zero instead a trap of the WebAssembly engine.- Parameters:
quotient
- the quotientdivisor
- the divisior- Returns:
- the result
-
createDivByZero
static java.lang.ArithmeticException createDivByZero()
Create an ArithmeticException with message "/ by zero"- Returns:
- the exception
-
-