int oldValue; int newValue; do { oldValue = addr.prepareInt(); if ((oldValue & ObjectFlags.GC_COLOUR_MASK) != oldColor) {
for (;;) { Word oldValue = addr.prepareWord(); if (oldValue.and(Word.fromIntZeroExtend(ObjectFlags.GC_COLOUR_MASK)).NE(Word.fromIntZeroExtend(oldColor))) {
    public boolean atomicChangeObjectColor(Object dst, int oldColor,            int newColor) {        final Address addr = ObjectReference.fromObject(dst).toAddress().add(                flagsOffset);        int oldValue;        int newValue;        do {            oldValue = addr.prepareInt();            if ((oldValue & ObjectFlags.GC_COLOUR_MASK) != oldColor) {                return false;            }            newValue = (oldValue & ~ObjectFlags.GC_COLOUR_MASK) | newColor;        } while (!addr.attempt(oldValue, newValue));        return true;    }