#include <algorithm>
static Statistic<>
-NumOversized("bytecodewriter", "Number of oversized instructions");
-static Statistic<>
-NumNormal("bytecodewriter", "Number of normal instructions");
+NumInstrs("bytecodewriter", "Number of instructions");
typedef unsigned char uchar;
}
align32(Out); // We must maintain correct alignment!
- ++NumOversized;
}
output_vbr((unsigned)Slot, Out);
}
align32(Out); // We must maintain correct alignment!
- ++NumOversized;
}
unsigned Bits = 1 | (Opcode << 2) | (Type << 8) | (Slots[0] << 20);
// cerr << "1 " << IType << " " << Type << " " << Slots[0] << endl;
output(Bits, Out);
- ++NumNormal;
}
// cerr << "2 " << IType << " " << Type << " " << Slots[0] << " "
// << Slots[1] << endl;
output(Bits, Out);
- ++NumNormal;
}
//cerr << "3 " << IType << " " << Type << " " << Slots[0] << " "
// << Slots[1] << " " << Slots[2] << endl;
output(Bits, Out);
- ++NumNormal;
}
void BytecodeWriter::processInstruction(const Instruction &I) {
}
}
+ ++NumInstrs;
+
// Decide which instruction encoding to use. This is determined primarily by
// the number of operands, and secondarily by whether or not the max operand
// will fit into the instruction encoding. More operands == fewer bits per