Class ArrayType

All Implemented Interfaces:
AnyType

public class ArrayType extends TypeManager.StructType
A reference to an array type
Author:
Volker Berlin
  • Constructor Details

    • ArrayType

      public ArrayType(AnyType arrayType, @Nonnull TypeManager manager, int componentClassIndex, WasmOptions options)
      Create a new array type
      Parameters:
      arrayType - the type of the array
      manager - the manager which hold all StructTypes
      componentClassIndex - the running index of the component/array class/type
      options - compiler properties
  • Method Details

    • getArrayType

      public AnyType getArrayType()
      The element type of the array
      Returns:
      the type
    • getNativeArrayType

      public AnyType getNativeArrayType()
      The native webassembly array type that we wrap
      Returns:
      the type
    • getNativeFieldName

      public NamedStorageType getNativeFieldName()
      The native field name
      Returns:
      the field name
    • getComponentClassIndex

      protected int getComponentClassIndex()
      The running index of the component/array class/type for class meta data, instanceof and interface calls.
      Overrides:
      getComponentClassIndex in class TypeManager.StructType
      Returns:
      the unique index or -1 id not an array
    • isRefType

      public boolean isRefType()
      If the type is a reference type. A GC reference to the heap.
      Specified by:
      isRefType in interface AnyType
      Overrides:
      isRefType in class TypeManager.StructType
      Returns:
      true, is GC type
    • isSubTypeOf

      public boolean isSubTypeOf(AnyType type)
      Check if this is a sub type of given type.
      Specified by:
      isSubTypeOf in interface AnyType
      Overrides:
      isSubTypeOf in class TypeManager.StructType
      Parameters:
      type - type to check
      Returns:
      true, if both are identical or this is a sub type of other. Or if other is a parent type of this.