Examples of prepareWord()


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

        final Address objectPtr = ObjectReference.fromObject(object).toAddress();
        final Address statusPtr = objectPtr.add(ObjectLayout.FLAGS_SLOT * Address.size());

        for (;;) {
            // attempt fast path: object is not locked.
            final Word oldlockword = statusPtr.prepareWord();

            final Word statusFlags = oldlockword.and(Word.fromIntZeroExtend(ObjectFlags.STATUS_FLAGS_MASK));
            if (statusPtr.attempt(statusFlags, statusFlags.or(tid))) {
                // fast path succeeded, the object was not locked and
                // has been locked by the current thread.
View Full Code Here

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

        final Word tid = Word.fromIntZeroExtend(VmMagic.currentProcessor().getCurrentThread().getId());
        final Address objectPtr = ObjectReference.fromObject(object).toAddress();
        final Address statusPtr = objectPtr.add(ObjectLayout.FLAGS_SLOT * Address.size());

        for (;;) {
            final Word oldlockword = statusPtr.prepareWord();

            // Unsafe.debug(" exit:");
            // proc.getArchitecture().getStackReader().debugStackTrace();
            // Unsafe.debug(oldlockword); Unsafe.debug(tid); Unsafe.debug('}');

View Full Code Here

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

                Unsafe.debug(oldlockword);
                Unsafe.debug(objectPtr);
                Unsafe.debug(statusPtr);
                Unsafe.debug(oldlockword.and(Word.fromIntZeroExtend(ObjectFlags.LOCK_COUNT_MASK)));
                Unsafe.debug(tid);
                Unsafe.debug(statusPtr.prepareWord());
                VmMagic.currentProcessor().getArchitecture().getStackReader().debugStackTrace();
                Unsafe.die("Please report this problem with the above values to epr@jnode.org");
                throw new IllegalMonitorStateException(exMsg);
            }
        }
View Full Code Here

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

        final Address kPtr = ObjectReference.fromObject(k).toAddress();
        final Address statusPtr = kPtr.add(ObjectLayout.FLAGS_SLOT * Address.size());

        for (;;) {
            final Word oldlockword = statusPtr.prepareWord();
            if (!oldlockword.and(Word.fromIntZeroExtend(ObjectFlags.LOCK_EXPANDED)).isZero()) {
                // inflated by another thread, use that one.
                return getMonitor(oldlockword);
            }

View Full Code Here

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

    public boolean atomicChangeObjectColor(Object dst, int oldColor,
                                           int newColor) {
        final Address addr = ObjectReference.fromObject(dst).toAddress().add(
            flagsOffset);
        for (;;) {
            Word oldValue = addr.prepareWord();
            if (oldValue
                .and(Word.fromIntZeroExtend(ObjectFlags.GC_COLOUR_MASK))
                .NE(Word.fromIntZeroExtend(oldColor))) {
                return false;
            }
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.