void check(long value) { assertEquals(1, IncompatMask.populationCount(value)); boolean isLong = (value >>> 32) != 0; assertEquals(value, IncompatMask.getFlagBits(true, value)); assertEquals(value, IncompatMask.getFlagBits(true, ~value)); if (!isLong) { assertEquals(value, IncompatMask.getFlagBits(false, value)); assertEquals(value, IncompatMask.getFlagBits(false, ~value)); } }
case Const.IAND: case Const.LAND: arg1 = getArg(); bitop = Const.IAND; return; case Const.IOR: case Const.LOR: arg1 = getArg(); bitop = Const.IOR; return; case Const.LCMP: if (checkItem(2)) { arg2 = getArg(); if (checkItem(2)) { arg2 = getArg(); equality = true; case Const.IFEQ: case Const.IFNE: if (arg1 instanceof Integer && checkItem(1)) { arg2 = 0; case Const.IFGT: case Const.IFGE: if (arg1 instanceof Integer && checkItem(1)) { arg2 = 0; long bits = getFlagBits(isLong, arg1.longValue());
noteVal(-1); return; case ICONST_0: noteVal(0); return; case ICONST_1: noteVal(1); return; case ICONST_2: noteVal(2); return; case ICONST_3: noteVal(3); return; case ICONST_4: noteVal(4); return; case ICONST_5: noteVal(5); return; case LCONST_0: noteVal(0); return; case LCONST_1: noteVal(1); return; bitop = IAND; isLong = seen == LAND;
static long getFlagBits(boolean isLong, long arg0) { long bits = arg0; if (isLong) { if (populationCount(bits) > populationCount(~bits)) { bits = ~bits; } } else if (populationCount(0xffffffffL & bits) > populationCount(0xffffffffL & ~bits)) { bits = 0xffffffffL & ~bits; } return bits; } }
@Override public void sawInt(int val) { noteVal(val); }
static long getFlagBits(boolean isLong, long arg0) { long bits = arg0; if (isLong) { if (populationCount(bits) > populationCount(~bits)) { bits = ~bits; } } else if (populationCount(0xffffffffL & bits) > populationCount(0xffffffffL & ~bits)) { bits = 0xffffffffL & ~bits; } return bits; } }
@Override public void sawLong(long val) { noteVal(val); }