Class WasmOptions
- java.lang.Object
-
- de.inetsoftware.jwebassembly.module.WasmOptions
-
public class WasmOptions extends java.lang.ObjectThe option/properties for the behavior of the compiler.
-
-
Field Summary
Fields Modifier and Type Field Description private FunctionNamecallInterfaceprivate FunctionNamecallVirtualprivate SyntheticFunctionNamecastprivate booleandebugNames(package private) FunctionManagerfunctionsprivate FunctionNameget_i32private SyntheticFunctionNameinstanceOf(package private) CodeOptimizeroptimizerFunctionNameref_eqNonGC function for ref_eq polyfill.private java.lang.StringsourceMapBaseStringManagerstringsTypeManagertypesprivate booleanuseEHprivate booleanuseGC
-
Constructor Summary
Constructors Constructor Description WasmOptions(java.util.HashMap<java.lang.String,java.lang.String> properties)Create a new instance of options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandebugNames()Property for adding debug names to the output if true.(package private) FunctionNamegetCallInterface()Get the FunctionName for a virtual call and mark it as used.(package private) FunctionNamegetCallVirtual()Get the FunctionName for a virtual call and mark it as used.(package private) SyntheticFunctionNamegetCast()Get the FunctionName for a CAST operation and mark it as used.(package private) SyntheticFunctionNamegetInstanceOf()Get the FunctionName for an INSTANCEOF check and mark it as used.java.lang.StringgetSourceMapBase()Get the relative path between the final wasm file location and the source files location.(package private) voidregisterGet_i32()Register FunctionName "NonGC.get_i32" for frequently access to vtable with non GC mode.booleanuseEH()If the exception handling feature of WASM should be use or an unreachable instruction.booleanuseGC()If the GC feature of WASM should be use or the GC of the JavaScript host.
-
-
-
Field Detail
-
functions
@Nonnull final FunctionManager functions
-
types
@Nonnull public final TypeManager types
-
strings
@Nonnull public final StringManager strings
-
optimizer
@Nonnull final CodeOptimizer optimizer
-
debugNames
private final boolean debugNames
-
useGC
private final boolean useGC
-
useEH
private final boolean useEH
-
sourceMapBase
@Nonnull private final java.lang.String sourceMapBase
-
ref_eq
public FunctionName ref_eq
NonGC function for ref_eq polyfill.
-
get_i32
private FunctionName get_i32
-
callVirtual
private FunctionName callVirtual
-
callInterface
private FunctionName callInterface
-
instanceOf
private SyntheticFunctionName instanceOf
-
cast
private SyntheticFunctionName cast
-
-
Method Detail
-
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 java.lang.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
@Nonnull SyntheticFunctionName 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
@Nonnull SyntheticFunctionName 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
-
-