Package org.vmmagic.unboxed

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


                pagePtr = physAddr.toWord();
            }

            // There is currently no present page, so do the mapping
            entry = pagePtr.or(Word.fromIntZeroExtend(PF_DEFAULT));
            pdirEntryPtr.store(entry);

            if (debug) {
                Unsafe.debug("mapPage ");
                Unsafe.debug(entry);
                Unsafe.debug('\n');
View Full Code Here


        // Initialize the header
        final Address objPtr = ptr.add(headerSize);
        final ObjectReference tibRef = ObjectReference.fromObject(vmClass
                .getTIB());
        objPtr.store(tibRef, tibOffset);
        objPtr.store((int) 0, flagsOffset);

        // Post allocation
        final Object result = objPtr.toObjectReference().toObject();
        if (false) {
View Full Code Here

        // Initialize the header
        final Address objPtr = ptr.add(headerSize);
        final ObjectReference tibRef = ObjectReference.fromObject(vmClass
                .getTIB());
        objPtr.store(tibRef, tibOffset);
        objPtr.store((int) 0, flagsOffset);

        // Post allocation
        final Object result = objPtr.toObjectReference().toObject();
        if (false) {
            Unsafe.debug("result=");
View Full Code Here

        if (inUse) {
            v |= mask;
        } else {
            v &= ~mask;
        }
        ptr.store((byte) v);
    }

    /**
     * Initialize this manager.
     */
 
View Full Code Here

        } else {
            staticsTable = VmMagic.currentProcessor().getIsolatedStaticsTable();
            offset = Offset.fromIntZeroExtend(f.getIsolatedStaticsIndex() << 2);
        }
        final Address ptr = VmMagic.getArrayData(staticsTable);
        ptr.store(ObjectReference.fromObject(value), offset);
    }

    //io context related

    public static IOContext getIOContext() {
View Full Code Here

                                   int elements, int slotSize) {
        final int size = (VmArray.DATA_OFFSET * slotSize)
            + (elemSize * elements);
        final Object array = allocObject(vmClass, size);
        final Address arrayPtr = ObjectReference.fromObject(array).toAddress();
        arrayPtr.store(elements, Offset.fromIntSignExtend(VmArray.LENGTH_OFFSET
            * slotSize));
        return array;
    }

    /**
 
View Full Code Here

                int ownerId = oldlockword.and(Word.fromIntZeroExtend(ObjectFlags.THREAD_ID_MASK)).toInt();
                VmThread thread = VmMagic.currentProcessor().getScheduler().getThreadById(ownerId);
                if (thread == null) {
                    //the owner of the lock was destroyed              
                    //aquire the lock in fast fashion
                    statusPtr.store(statusFlags.or(tid));
                    return;
                } else {
                    // install an inflated lock.
                    installInflatedLock(object, thread).enter();
                }
View Full Code Here

        if (value) {
            v |= mask;
        } else {
            v &= ~mask;
        }
        ptr.store((byte) v);
    }

    /**
     * Claim an exclusive access lock the Bitmap data structures. This is done without using java
     * monitorenter/exit instructions, since they may need a memory allocation.
View Full Code Here

        if (on) {
            value |= mask;
        } else {
            value &= ~mask;
        }
        bitmapPtr.store((byte) value, idx);
    }

    /**
     * Initialize this heap
     *
 
View Full Code Here

        // Setup a heap object, so the heap can initialize itself.
        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();
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.