Class TypeManager.StructType
java.lang.Object
de.inetsoftware.jwebassembly.module.TypeManager.StructType
- All Implemented Interfaces:
AnyType
- Direct Known Subclasses:
ArrayType
- Enclosing class:
TypeManager
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStructType(String name, TypeManager.StructTypeKind kind, TypeManager manager) Create a reference to type -
Method Summary
Modifier and TypeMethodDescriptionintThe running index of the class/type for class meta data, instanceof and interface calls.intgetCode()The type code(typeidx) in WebAssembly.protected intThe running index of the component/array class/type for class meta data, instanceof and interface calls.Get the fields of this structgetKind()Get kind of the StructTypegetName()Get the name of the Java typeintGet the vtable offset.booleanIf the type is a reference type.booleanisSubTypeOf(AnyType type) Check if this is a sub type of given type.toString()voidwriteToStream(ByteArrayOutputStream dataStream, ToIntFunction<FunctionName> getFunctionsID, WasmOptions options) Write the struct/class meta data to the datastream and set the offset position.
-
Constructor Details
-
StructType
protected StructType(@Nonnull String name, @Nonnull TypeManager.StructTypeKind kind, @Nonnull TypeManager manager) Create a reference to type- Parameters:
name- the Java class name like "java/lang/String"kind- the type kindmanager- the manager which hold all StructTypes
-
-
Method Details
-
getCode
-
isRefType
-
isSubTypeOf
Check if this is a sub type of given type.- Specified by:
isSubTypeOfin interfaceAnyType- Parameters:
type- type to check- Returns:
- true, if both are identical or this is a sub type of
other. Or ifotheris a parent type of this.
-
getKind
-
getName
-
getClassIndex
public int getClassIndex()The running index of the class/type for class meta data, instanceof and interface calls.- Returns:
- the unique index
-
getComponentClassIndex
protected int getComponentClassIndex()The running index of the component/array class/type for class meta data, instanceof and interface calls.- Returns:
- the unique index or -1 id not an array
-
getFields
-
writeToStream
public void writeToStream(ByteArrayOutputStream dataStream, ToIntFunction<FunctionName> getFunctionsID, WasmOptions options) throws IOException Write the struct/class meta data to the datastream and set the offset position.- Parameters:
dataStream- the target streamgetFunctionsID- source for function IDsoptions- the compiler options- Throws:
IOException- should never occur- See Also:
-
getVTable
public int getVTable()Get the vtable offset.- Returns:
- the offset
-
toString
-