Class MultiArrayFunctionName


public class MultiArrayFunctionName extends WatCodeSyntheticFunctionName
Synthetic functions for creating multidimensional dimensional arrays
  • Field Details

    • dim

      private int dim
    • type

      private ArrayType type
  • Constructor Details

    • MultiArrayFunctionName

      MultiArrayFunctionName(int dim, ArrayType type)
      Create a new instance
      Parameters:
      dim - the count of dimensions, should be >= 2
      type - the full type of the allocated array
  • Method Details

    • getElementType

      private static ValueType getElementType(ArrayType type)
      The element type of the array
      Parameters:
      type - the full type of the allocated array
      Returns:
      the element type
    • createName

      private static String createName(int dim, ArrayType type)
      Create the unique name depends on dimension and type
      Parameters:
      dim - the dimension
      type - the full type of the allocated array
      Returns:
      the name
    • createSignature

      private static AnyType[] createSignature(int dim, ArrayType type)
      Create the signature of the function.
      Parameters:
      dim - the dimension
      type - the full type of the allocated array
      Returns:
      the signature
    • getCodeBuilder

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