final int heapObjSize = ObjectLayout.objectAlign(heapClass .getObjectSize());
final Word heapObjSize = Word.fromIntZeroExtend(ObjectLayout.objectAlign(heapClass .getObjectSize())); final Word flags = Word.fromIntZeroExtend(ObjectFlags.GC_DEFAULT_COLOR);
    protected static VmAbstractHeap setupHeap(HeapHelper helper, Address start,            VmNormalClass heapClass, int slotSize) {        final int headerSize = ObjectLayout                .objectAlign((ObjectLayout.HEADER_SLOTS + 1) * slotSize);        final Offset vmtOffset = Offset.fromIntSignExtend(ObjectLayout.TIB_SLOT * slotSize);        final Offset sizeOffset = Offset.fromIntSignExtend(-((ObjectLayout.HEADER_SLOTS + 1) * slotSize));        final Offset flagsOffset = Offset.fromIntSignExtend(ObjectLayout.FLAGS_SLOT * slotSize);        // Setup a heap object, so the heap can initialize itself.        final Address heapPtr = start.add(headerSize);        final int heapObjSize = ObjectLayout.objectAlign(heapClass                .getObjectSize());        heapPtr.store(heapObjSize, sizeOffset);        heapPtr.store(ObjectFlags.GC_DEFAULT_COLOR, flagsOffset);        heapPtr.store(ObjectReference.fromObject(heapClass.getTIB()), vmtOffset);        helper.clear(heapPtr, heapObjSize);        VmDefaultHeap heap = (VmDefaultHeap) heapPtr.toObjectReference().toObject();        heap.helper = helper;        return heap;    }