1, k);
1);
    private static Monitor installInflatedLock(Object k) {        Monitor m = null;        Word monAddr = null;        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);            }            if (m == null) {                m = new Monitor(VmMagic.currentProcessor().getCurrentThread(),                        1, k);                monAddr = ObjectReference.fromObject(m).toAddress().toWord();                if (!monAddr.and(                        Word.fromIntZeroExtend(ObjectFlags.LOCK_EXPANDED                                | ObjectFlags.STATUS_FLAGS_MASK)).isZero()) {                    throw new InternalError(                            "Monitor object has address that conflicts with header flags 0x"                                    + NumberUtils.hex(monAddr.toInt()));                }            }            // Put entry count & owner in monitor            int lockcount = 1 + oldlockword.and(                    Word.fromIntZeroExtend(ObjectFlags.LOCK_COUNT_MASK)).rshl(                    ObjectFlags.LOCK_COUNT_SHIFT).toInt();            int ownerId = oldlockword.and(                    Word.fromIntZeroExtend(ObjectFlags.THREAD_ID_MASK)).toInt();            m.initialize(VmMagic.currentProcessor().getScheduler().getThreadById(ownerId), lockcount);            final Word statusFlags = oldlockword.and(Word                    .fromIntZeroExtend(ObjectFlags.STATUS_FLAGS_MASK));            final Word newlockword = monAddr.or(statusFlags).or(                    Word.fromIntZeroExtend(ObjectFlags.LOCK_EXPANDED));            if (statusPtr.attempt(oldlockword, newlockword)) {                // successfully obtained inflated lock.                return m;            }        }    }