Package org.vmmagic.unboxed

Examples of org.vmmagic.unboxed.ObjectReference


        size += this.headerSize;
        final Address ptr = alloc(size, align, this.headerSize, allocator);

        // 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
View Full Code Here


            // We already own this lock, increment the lock count.
            lockCount = lockCount.add(Word.one());
        } else {
            final Address ownerAddr = ObjectReference.fromObject(this)
                .toAddress();
            final ObjectReference procRef = ObjectReference.fromObject(VmMagic
                .currentProcessor());
            while (!ownerAddr.attempt(null, procRef)) {
                // Busy wait
            }
            // Now I'm the owner
View Full Code Here

        println("getSelector point A");
        if (obj == null)
            return -1;

        println("getSelector point B");
        ObjectReference objRef = ObjectReference.fromObject(obj);

        println("getSelector point C");
        return (objRef == null) ? null : getSelector(objRef.toAddress());
    }
View Full Code Here

    }

    @Inline
    private final void verifyChild(Object child, Object parent, String where) {
        if (child != null) {
            final ObjectReference childRef = ObjectReference.fromObject(child);
            if (!heapManager.isObject(childRef.toAddress())) {
                Unsafe.debug("GCVerifyError: in ");
                Unsafe.debug(where);
                Unsafe.debug(", parent type ");
                Unsafe.debug(VmMagic.getObjectType(parent).getName());
                Unsafe.debug(VmMagic.getObjectColor(parent));
                Unsafe.debug("; child (");
                Unsafe.debug(childRef.toAddress().toInt());
                Unsafe.debug(") is not an object ");
                Unsafe.debug(VmMagic.getObjectColor(childRef));
                errorCount++;
            }
        }
View Full Code Here

            if ((offset < 0) || (offset >= size)) {
                Unsafe.debug("reference offset out of range!");
                Unsafe.debug(vmClass.getName());
                helper.die("Class internal error");
            } else {
                final ObjectReference child = objAddr.loadObjectReference(Offset.fromIntZeroExtend(offset));
                if (child != null) {
                    // Enable the following in the case of heap corruption
                    if (false) {
                        verifyChild(child, object, "object child", i, offset);
                    }
View Full Code Here

    }

    @Inline
    private final void verifyChild(Object child, Object parent, String where, int i, int offset) {
        if (child != null) {
            final ObjectReference childRef = ObjectReference.fromObject(child);
            if (!heapManager.isObject(childRef.toAddress())) {
                Unsafe.debug("GCMarkError: in ");
                Unsafe.debug(where);
                Unsafe.debug(", i ");
                Unsafe.debug(i);
                Unsafe.debug(", offset ");
                Unsafe.debug(offset);
                Unsafe.debug(", parent type ");
                Unsafe.debug(VmMagic.getObjectType(parent).getName());
                Unsafe.debug(VmMagic.getObjectColor(parent));
                Unsafe.debug("; child (");
                Unsafe.debug(childRef.toAddress().toInt());
                Unsafe.debug(") is not an object ");
                Unsafe.debug(VmMagic.getObjectColor(childRef));
                helper.die("Corrupted heap");
            }
        }
View Full Code Here

TOP

Related Classes of org.vmmagic.unboxed.ObjectReference

Copyright © 2018 www.massapicom. 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.