private short getConsecutiveSlots(int count, boolean isConst) {
        if (isConst)
            count++;
        short result = firstFreeLocal;
        while (true) {
            if (result >= (MAX_LOCALS - 1))
                break;
            int i;
            for (i = 0; i < count; i++)
                if (locals[result + i] != 0)
                    break;
            if (i >= count)
                break;
            result++;
        }
        return result;
    }