Class 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.

    • 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.
      • Methods inherited from class java.lang.Object

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

      • WasmEmbbeddedCode

        WasmEmbbeddedCode()
    • 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 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 java.lang.ArithmeticException createDivByZero()
        Create an ArithmeticException with message "/ by zero"
        Returns:
        the exception