mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
pass the component class index
This commit is contained in:
parent
0433a4d0d4
commit
852bb25158
@ -803,6 +803,15 @@ public class TypeManager {
|
||||
return classIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* The running index of the component/array class/type for class meta data, instanceof and interface calls.
|
||||
*
|
||||
* @return the unique index or -1 id not an array
|
||||
*/
|
||||
protected int getComponentClassIndex() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fields of this struct
|
||||
* @return the fields
|
||||
@ -885,7 +894,7 @@ public class TypeManager {
|
||||
header.writeInt32( classNameIdx ); // string id of the className
|
||||
|
||||
// header position TYPE_DESCRIPTION_ARRAY_TYPE
|
||||
header.writeInt32( -1 );
|
||||
header.writeInt32( getComponentClassIndex() );
|
||||
|
||||
data.writeTo( dataStream );
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ public class ArrayType extends StructType {
|
||||
|
||||
private AnyType arrayType;
|
||||
|
||||
private int componentClassIndex;
|
||||
|
||||
/**
|
||||
* Create a new array type
|
||||
*
|
||||
@ -41,6 +43,7 @@ public class ArrayType extends StructType {
|
||||
//TODO name
|
||||
super( "[", classIndex );
|
||||
this.arrayType = arrayType;
|
||||
this.componentClassIndex = componentClassIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,6 +54,14 @@ public class ArrayType extends StructType {
|
||||
return arrayType;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected int getComponentClassIndex() {
|
||||
return componentClassIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user