1 package shark.internal 2 3 import shark.PrimitiveType 4 5 internal sealed class IndexedObject { 6 abstract val position: Long 7 abstract val recordSize: Long 8 9 class IndexedClass( 10 override val position: Long, 11 val superclassId: Long, 12 val instanceSize: Int, 13 override val recordSize: Long, 14 val fieldsIndex: Int 15 ) : IndexedObject() 16 17 class IndexedInstance( 18 override val position: Long, 19 val classId: Long, 20 override val recordSize: Long 21 ) : IndexedObject() 22 23 class IndexedObjectArray( 24 override val position: Long, 25 val arrayClassId: Long, 26 override val recordSize: Long 27 ) : IndexedObject() 28 29 class IndexedPrimitiveArray( 30 override val position: Long, 31 primitiveType: PrimitiveType, 32 override val recordSize: Long 33 ) : IndexedObject() { 34 private val primitiveTypeOrdinal: Byte = primitiveType.ordinal.toByte() 35 val primitiveType: PrimitiveType 36 get() = PrimitiveType.values()[primitiveTypeOrdinal.toInt()] 37 } 38 }