JitIL: Improved the compilation speed by fixing the bug that getNumberOfOperands() initializes the table each time it is called.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6173 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nodchip 2010-09-04 14:25:39 +00:00
parent f4a6e585be
commit 6dc16b7416
1 changed files with 3 additions and 1 deletions

View File

@ -1105,7 +1105,9 @@ unsigned IRBuilder::getComplexity(InstLoc I) const {
unsigned IRBuilder::getNumberOfOperands(InstLoc I) const { unsigned IRBuilder::getNumberOfOperands(InstLoc I) const {
static unsigned numberOfOperands[256]; static unsigned numberOfOperands[256];
if (numberOfOperands[0] == 0) { static bool initialized = false;
if (!initialized) {
initialized = true;
std::fill_n(numberOfOperands, sizeof(numberOfOperands) / sizeof(numberOfOperands[0]), -1U); std::fill_n(numberOfOperands, sizeof(numberOfOperands) / sizeof(numberOfOperands[0]), -1U);
numberOfOperands[Nop] = 0; numberOfOperands[Nop] = 0;