((VmNormalClass) cls).setObjectSize(objectSize);
((VmNormalClass<?>) cls).setObjectSize(objectSize);
    private static void readFields(ByteBuffer data, VmType< ? > cls, VmCP cp,            VmSharedStatics sharedStatics, VmIsolatedStatics isolatedStatics,            int slotSize, int flags) {        final int fcount = data.getChar();        if (fcount > 0) {            final VmField[] ftable = new VmField[fcount];            int objectSize = 0;            for (int i = 0; i < fcount; i++) {                final boolean wide;                int modifiers = data.getChar();                final String name = cp.getUTF8(data.getChar());                final String signature = cp.getUTF8(data.getChar());                switch (signature.charAt(0)) {                case 'J':                case 'D':                    modifiers = modifiers | Modifier.ACC_WIDE;                    wide = true;                    break;                default:                    wide = false;                }                final boolean isstatic = (modifiers & Modifier.ACC_STATIC) != 0;                final int staticsIdx;                final VmField fs;                final VmStatics statics;                if (isstatic) {                    // Determine if the static field should be shared.                    final boolean shared = cls.isSharedStatics();                    if (shared) {                        statics = sharedStatics;                    } else {                        statics = isolatedStatics;                    }                    // If static allocate space for it.                    switch (signature.charAt(0)) {                    case 'B':                        staticsIdx = statics.allocIntField();                        break;                    case 'C':                        staticsIdx = statics.allocIntField();                        break;                    case 'D':                        staticsIdx = statics.allocLongField();                        break;                    case 'F':                        staticsIdx = statics.allocIntField();                        break;                    case 'I':                        staticsIdx = statics.allocIntField();                        break;                    case 'J':                        staticsIdx = statics.allocLongField();                        break;                    case 'S':                        staticsIdx = statics.allocIntField();                        break;                    case 'Z':                        staticsIdx = statics.allocIntField();                        break;                    default: {                        if (Modifier.isAddressType(signature)) {                            staticsIdx = statics.allocAddressField();                        } else {                            staticsIdx = statics.allocObjectField();                            // System.out.println(NumberUtils.hex(staticsIdx)                            // + "\t" + cls.getName() + "." + name);                        }                    }                        break;                    }                    fs = new VmStaticField(name, signature, modifiers,                            staticsIdx, cls, slotSize, shared);                } else {                    staticsIdx = -1;                    statics = null;                    final int fieldOffset;                    // Set the offset (keep in mind that this will be fixed                    // by ClassResolver with respect to the objectsize of the                    // super-class.                    fieldOffset = objectSize;                    // Increment the objectSize                    if (wide)                        objectSize += 8;                    else if (Modifier.isPrimitive(signature)) {                        objectSize += 4;                    } else {                        objectSize += slotSize;                    }                    fs = new VmInstanceField(name, signature, modifiers,                            fieldOffset, cls, slotSize);                }                ftable[i] = fs;                // Read field attributes                final int acount = data.getChar();                for (int a = 0; a < acount; a++) {                    final String attrName = cp.getUTF8(data.getChar());                    final int length = data.getInt();                    if (isstatic                            && VmArray.equals(ConstantValueAttrName, attrName)) {                        final int idx = data.getChar();                        switch (signature.charAt(0)) {                        case 'B':                            statics.setInt(staticsIdx, cp.getInt(idx));                            break;                        case 'C':                            statics.setInt(staticsIdx, cp.getInt(idx));                            break;                        case 'D':                            final long lval = Double.doubleToRawLongBits(cp                                    .getDouble(idx));                            statics.setLong(staticsIdx, lval);                            break;                        case 'F':                            final int ival = Float.floatToRawIntBits(cp                                    .getFloat(idx));                            statics.setInt(staticsIdx, ival);                            break;                        case 'I':                            statics.setInt(staticsIdx, cp.getInt(idx));                            break;                        case 'J':                            statics.setLong(staticsIdx, cp.getLong(idx));                            break;                        case 'S':                            statics.setInt(staticsIdx, cp.getInt(idx));                            break;                        case 'Z':                            statics.setInt(staticsIdx, cp.getInt(idx));                            break;                        default:                            // throw new IllegalArgumentException("signature "                            // + signature);                            statics.setObject(staticsIdx, cp.getString(idx));                            break;                        }                    } else {                        skip(data, length);                    }                }            }            // Align the instance fields for minimal object size.            if ((flags & NO_FIELD_ALIGNMENT) == 0) {                final int alignedObjectSize = alignInstanceFields(ftable,                        slotSize);                objectSize = alignedObjectSize;            }            cls.setFieldTable(ftable);            if (objectSize > 0) {                ((VmNormalClass) cls).setObjectSize(objectSize);            }        }    }