Class WatCodeSyntheticFunctionName

Direct Known Subclasses:
MultiArrayFunctionName

class WatCodeSyntheticFunctionName extends ArraySyntheticFunctionName
Synthetic/dynamic method based on WAT code (WASM in text form).
  • Field Details

    • code

      private final String code
  • Constructor Details

    • WatCodeSyntheticFunctionName

      public WatCodeSyntheticFunctionName(String name, String code, AnyType... signatureTypes)
      Create a new instance.
      Parameters:
      name - the function name
      code - the WAT code (WASM in text form)
      signatureTypes - the method signature, first the parameters, then null and the the return types
    • WatCodeSyntheticFunctionName

      public WatCodeSyntheticFunctionName(String className, String name, String signature, @Nonnull String code, AnyType... signatureTypes)
      Create a new instance.
      Parameters:
      className - the Java class name
      name - the function name
      signature - the string signature
      code - the WAT code (WASM in text form)
      signatureTypes - the method signature, first the parameters, then null and the the return types
  • Method Details

    • getCode

      @Nonnull protected String getCode()
      Get Wat code, can be overridden.
      Returns:
      the code
    • hasWasmCode

      protected boolean hasWasmCode()
      If this function has WASM code or if this function is a import with JavaScript code.
      Specified by:
      hasWasmCode in class SyntheticFunctionName
      Returns:
      true, if WASM code
    • getCodeBuilder

      protected WasmCodeBuilder getCodeBuilder(WatParser watParser)
      Get the WasmCodeBuilder for the synthetic WASM code.
      Overrides:
      getCodeBuilder in class SyntheticFunctionName
      Parameters:
      watParser - a helping WatParser
      Returns:
      the code