From 6dc16b74160a49bac66b1c0f9afdc31f85d9e363 Mon Sep 17 00:00:00 2001 From: nodchip Date: Sat, 4 Sep 2010 14:25:39 +0000 Subject: [PATCH] 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 --- Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp index e9d11e99f3..f9125da873 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR.cpp @@ -1105,7 +1105,9 @@ unsigned IRBuilder::getComplexity(InstLoc I) const { unsigned IRBuilder::getNumberOfOperands(InstLoc I) const { 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); numberOfOperands[Nop] = 0;