Class WasmEmbbeddedCode

java.lang.Object
de.inetsoftware.jwebassembly.module.WasmEmbbeddedCode

class WasmEmbbeddedCode extends 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static ArithmeticException
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WasmEmbbeddedCode

      WasmEmbbeddedCode()
  • Method Details

    • 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 operation
      divisor - 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 quotient
      divisor - the divisior
      Returns:
      the result
    • createDivByZero

      static ArithmeticException createDivByZero()
      Create an ArithmeticException with message "/ by zero"
      Returns:
      the exception