Package org.vmmagic.unboxed

Examples of org.vmmagic.unboxed.Address.store()


        final Address heapPtr = start.add(headerSize);
        final Word heapObjSize = Word.fromIntZeroExtend(ObjectLayout.objectAlign(heapClass
            .getObjectSize()));
        final Word flags = Word.fromIntZeroExtend(ObjectFlags.GC_DEFAULT_COLOR);
        heapPtr.store(heapObjSize, sizeOffset);
        heapPtr.store(flags, flagsOffset);
        heapPtr.store(ObjectReference.fromObject(heapClass.getTIB()), vmtOffset);
        helper.clear(heapPtr, heapObjSize.toInt());

        VmDefaultHeap heap = (VmDefaultHeap) heapPtr.toObjectReference().toObject();
        heap.helper = helper;
View Full Code Here


        final Word heapObjSize = Word.fromIntZeroExtend(ObjectLayout.objectAlign(heapClass
            .getObjectSize()));
        final Word flags = Word.fromIntZeroExtend(ObjectFlags.GC_DEFAULT_COLOR);
        heapPtr.store(heapObjSize, sizeOffset);
        heapPtr.store(flags, flagsOffset);
        heapPtr.store(ObjectReference.fromObject(heapClass.getTIB()), vmtOffset);
        helper.clear(heapPtr, heapObjSize.toInt());

        VmDefaultHeap heap = (VmDefaultHeap) heapPtr.toObjectReference().toObject();
        heap.helper = helper;
        return heap;
View Full Code Here

        final int allocationBitmapSize = ObjectLayout
            .objectAlign((allocationBits + 7) / 8);
        this.allocationBitmapPtr = firstObject;
        final Address bitmapPtr = this.allocationBitmapPtr;
        // Make the bitmap an object, so it is easy to manipulate.
        bitmapPtr.store(Word.fromIntZeroExtend(allocationBitmapSize), sizeOffset);
        bitmapPtr.store(Word.fromIntZeroExtend(GC_DEFAULT_COLOR), flagsOffset);
        bitmapPtr.store(ObjectReference.fromObject(VmType.getObjectClass().getTIB()), tibOffset);
        firstObject = firstObject.add(allocationBitmapSize + headerSize);
        helper.clear(allocationBitmapPtr, allocationBitmapSize);
        this.allocationBitmap = allocationBitmapPtr.toObjectReference().toObject();
View Full Code Here

            .objectAlign((allocationBits + 7) / 8);
        this.allocationBitmapPtr = firstObject;
        final Address bitmapPtr = this.allocationBitmapPtr;
        // Make the bitmap an object, so it is easy to manipulate.
        bitmapPtr.store(Word.fromIntZeroExtend(allocationBitmapSize), sizeOffset);
        bitmapPtr.store(Word.fromIntZeroExtend(GC_DEFAULT_COLOR), flagsOffset);
        bitmapPtr.store(ObjectReference.fromObject(VmType.getObjectClass().getTIB()), tibOffset);
        firstObject = firstObject.add(allocationBitmapSize + headerSize);
        helper.clear(allocationBitmapPtr, allocationBitmapSize);
        this.allocationBitmap = allocationBitmapPtr.toObjectReference().toObject();
View Full Code Here

        this.allocationBitmapPtr = firstObject;
        final Address bitmapPtr = this.allocationBitmapPtr;
        // Make the bitmap an object, so it is easy to manipulate.
        bitmapPtr.store(Word.fromIntZeroExtend(allocationBitmapSize), sizeOffset);
        bitmapPtr.store(Word.fromIntZeroExtend(GC_DEFAULT_COLOR), flagsOffset);
        bitmapPtr.store(ObjectReference.fromObject(VmType.getObjectClass().getTIB()), tibOffset);
        firstObject = firstObject.add(allocationBitmapSize + headerSize);
        helper.clear(allocationBitmapPtr, allocationBitmapSize);
        this.allocationBitmap = allocationBitmapPtr.toObjectReference().toObject();

        // Mark this heap in the allocation bitmap
View Full Code Here

        setAllocationBit(allocationBitmap, true);

        // Initialize the remaining space as free object.
        final Word remainingSize = end.toWord().sub(firstObject.toWord());
        final Address ptr = firstObject;
        ptr.store(remainingSize, sizeOffset);
        ptr.store(ObjectReference.fromObject(FREE), tibOffset);
        this.nextFreePtr = ptr;
        this.freeSize = remainingSize.toExtent();
    }
View Full Code Here

        // Initialize the remaining space as free object.
        final Word remainingSize = end.toWord().sub(firstObject.toWord());
        final Address ptr = firstObject;
        ptr.store(remainingSize, sizeOffset);
        ptr.store(ObjectReference.fromObject(FREE), tibOffset);
        this.nextFreePtr = ptr;
        this.freeSize = remainingSize.toExtent();
    }

    /**
 
View Full Code Here

                    Unsafe.debug("\nheaderSize  "); Unsafe.debug(headerSize);
                    throw new Error("Block splitup failed");
                }*/
                final Address newFreePtr = objectPtr.add(totalSize);
                // Set the header for the remaining free block
                newFreePtr.store(newFreeSize, sizeOffset);
                newFreePtr.store(0, flagsOffset);
                newFreePtr.store(ObjectReference.fromObject(FREE), tibOffset);
                // Set the next free offset
                nextFreePtr = newFreePtr;
            } else {
View Full Code Here

                    throw new Error("Block splitup failed");
                }*/
                final Address newFreePtr = objectPtr.add(totalSize);
                // Set the header for the remaining free block
                newFreePtr.store(newFreeSize, sizeOffset);
                newFreePtr.store(0, flagsOffset);
                newFreePtr.store(ObjectReference.fromObject(FREE), tibOffset);
                // Set the next free offset
                nextFreePtr = newFreePtr;
            } else {
                // The block is not large enough to split up, make the
View Full Code Here

                }*/
                final Address newFreePtr = objectPtr.add(totalSize);
                // Set the header for the remaining free block
                newFreePtr.store(newFreeSize, sizeOffset);
                newFreePtr.store(0, flagsOffset);
                newFreePtr.store(ObjectReference.fromObject(FREE), tibOffset);
                // Set the next free offset
                nextFreePtr = newFreePtr;
            } else {
                // The block is not large enough to split up, make the
                // new object the size of the free block.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.