Add a field for the HashCode to any object.

This commit is contained in:
Volker Berlin 2020-03-08 21:14:57 +01:00
parent 83188e87e6
commit 853ee503e7

View File

@ -52,6 +52,11 @@ public class TypeManager {
/** name of virtual function table, start with a point for an invalid Java identifier */
static final String VTABLE = ".vtable";
/**
* Name of field with system hash code, start with a point for an invalid Java identifier.
*/
static final String HASHCODE = ".hashcode";
/**
* The reserved position on start of the vtable:
* <li>offset of interface call table (itable)
@ -339,6 +344,7 @@ public class TypeManager {
listStructFields( superClassName, functions, types, classFileLoader, allNeededFields );
} else {
fields.add( new NamedStorageType( ValueType.i32, className, VTABLE ) );
fields.add( new NamedStorageType( ValueType.i32, className, HASHCODE ) );
}
for( FieldInfo field : classFile.getFields() ) {