Package org.vmmagic.unboxed

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


     */
    @Inline
    final void free(Object object) {
        final Address ptr = ObjectReference.fromObject(object).toAddress();
        final Word objSize = ptr.loadWord(sizeOffset);
        ptr.store(ObjectReference.fromObject(FREE), tibOffset);
        setAllocationBit(object, false);
        freeSize = freeSize.add(objSize);
    }

    /**
 
View Full Code Here


    @Inline
    private final void addIsolatedState(int value) {
        if (VmMagic.isRunningJNode()) {
            final Address ptr = VmMagic
                .getIsolatedStaticFieldAddress(isolatedStaticsIndex);
            ptr.store(ptr.loadInt() | value);
        } else {
            final VmIsolatedStatics statics;
            final int index = isolatedStaticsIndex;
            statics = loader.getIsolatedStatics();
            statics.setInt(index, statics.getInt(index) | value);
View Full Code Here

    public static boolean compareAndSwapObject(Unsafe instance, Object o, long offset,
                                              Object expected, Object x) {
        //todo make sure it's atomic
        final Address address = ObjectReference.fromObject(o).toAddress().add((int) offset);
        if(address.loadObjectReference().toObject() == expected){
            address.store(ObjectReference.fromObject(x));
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

    public static boolean compareAndSwapInt(Unsafe instance, Object o, long offset,
                                           int expected, int x) {
        //todo make sure it's atomic
        final Address address = ObjectReference.fromObject(o).toAddress().add((int) offset);
        if(address.loadInt() == expected){
            address.store(x);
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

                                            long expected,
                                            long x) {
        //todo make sure it's atomic
        final Address address = ObjectReference.fromObject(o).toAddress().add((int) offset);
        if(address.loadLong() == expected){
            address.store(x);
            return true;
        } else {
            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.