improvements for getComponentType()

This commit is contained in:
Volker Berlin 2020-05-30 18:36:12 +02:00
parent a0d56ddcc3
commit 56c38bbc63

View File

@ -69,16 +69,22 @@ public class TypeManager {
static final int TYPE_DESCRIPTION_INSTANCEOF_OFFSET = 4;
/**
* Byte position in the type description that contains the offset to class name idx. Length 4 bytes.
* Byte position in the type description that contains the offset to class name idx in the string constant table. Length 4 bytes.
*/
static final int TYPE_DESCRIPTION_TYPE_NAME = 8;
/**
* Byte position in the type description that contains the type of the array (component type). Length 4 bytes.
*/
static final int TYPE_DESCRIPTION_ARRAY_TYPE = 12;
/**
* The reserved position on start of the vtable:
* <li>offset of interface call table (itable)
* <li>offset of instanceof list
* <li>offset of class name idx in the string constant table
*/
private static final int VTABLE_FIRST_FUNCTION_INDEX = 3;
private static final int VTABLE_FIRST_FUNCTION_INDEX = 4;
private static final FunctionName CLASS_CONSTANT_FUNCTION = new FunctionName( "java/lang/Class.classConstant(I)Ljava/lang/Class;" );
@ -833,6 +839,9 @@ public class TypeManager {
// header position TYPE_DESCRIPTION_TYPE_NAME
header.writeInt32( classNameIdx ); // string id of the className
// header position TYPE_DESCRIPTION_ARRAY_TYPE
header.writeInt32( -1 );
data.writeTo( dataStream );
}