Class WasmOptions

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

public class WasmOptions extends Object
The option/properties for the behavior of the compiler.
  • Field Details

  • Constructor Details

    • WasmOptions

      public WasmOptions(HashMap<String,String> properties)
      Create a new instance of options
      Parameters:
      properties - compiler properties
  • Method Details

    • debugNames

      public boolean debugNames()
      Property for adding debug names to the output if true.
      Returns:
      true, add debug information
    • useGC

      public boolean useGC()
      If the GC feature of WASM should be use or the GC of the JavaScript host.
      Returns:
      true, use the GC instructions of WASM.
    • useEH

      public boolean useEH()
      If the exception handling feature of WASM should be use or an unreachable instruction.
      Returns:
      true, use the EH instructions of WASM; false, generate an unreachable instruction
    • getSourceMapBase

      @Nonnull public String getSourceMapBase()
      Get the relative path between the final wasm file location and the source files location. If not empty it should end with a slash like "../../src/main/java/".
      Returns:
      the path
    • registerGet_i32

      void registerGet_i32()
      Register FunctionName "NonGC.get_i32" for frequently access to vtable with non GC mode.
    • getCallVirtual

      @Nonnull FunctionName getCallVirtual()
      Get the FunctionName for a virtual call and mark it as used. The function has 2 parameters (THIS, virtualfunctionIndex) and returns the index of the function.
      Returns:
      the name
    • getCallInterface

      @Nonnull FunctionName getCallInterface()
      Get the FunctionName for a virtual call and mark it as used. The function has 2 parameters (THIS, virtualfunctionIndex) and returns the index of the function.
      Returns:
      the name
    • getInstanceOf

      Get the FunctionName for an INSTANCEOF check and mark it as used. The function has 2 parameters (THIS, classIndex) and returns true or false.
      Returns:
      the name
    • getCast

      Get the FunctionName for a CAST operation and mark it as used. The function has 2 parameters (THIS, classIndex) and returns THIS or throw an exception.
      Returns:
      the name