From ef3e6de875155f09561e07edb27ad2fd4374b582 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 16 Jan 2017 18:21:09 -0500 Subject: [PATCH] IR: Move implementation of the constructor and Reset into the cpp file Neither of these are intended to be called extremely frequently to warrant this. --- Source/Core/Core/PowerPC/JitILCommon/IR.cpp | 33 +++++++++++++++++++++ Source/Core/Core/PowerPC/JitILCommon/IR.h | 33 +++------------------ 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp index 6fe5843c8c..9e58e3fc3b 100644 --- a/Source/Core/Core/PowerPC/JitILCommon/IR.cpp +++ b/Source/Core/Core/PowerPC/JitILCommon/IR.cpp @@ -137,6 +137,39 @@ using namespace Gen; namespace IREmitter { +IRBuilder::IRBuilder() +{ + Reset(); +} + +void IRBuilder::Reset() +{ + InstList.clear(); + InstList.reserve(100000); + MarkUsed.clear(); + MarkUsed.reserve(100000); + + for (unsigned i = 0; i < 32; i++) + { + GRegCache[i] = nullptr; + GRegCacheStore[i] = nullptr; + FRegCache[i] = nullptr; + FRegCacheStore[i] = nullptr; + } + + CarryCache = nullptr; + CarryCacheStore = nullptr; + + for (unsigned i = 0; i < 8; i++) + { + CRCache[i] = nullptr; + CRCacheStore[i] = nullptr; + } + + CTRCache = nullptr; + CTRCacheStore = nullptr; +} + InstLoc IRBuilder::EmitZeroOp(unsigned Opcode, unsigned extra = 0) { InstLoc curIndex = InstList.data() + InstList.size(); diff --git a/Source/Core/Core/PowerPC/JitILCommon/IR.h b/Source/Core/Core/PowerPC/JitILCommon/IR.h index 7e5bbcd11c..7125fdc954 100644 --- a/Source/Core/Core/PowerPC/JitILCommon/IR.h +++ b/Source/Core/Core/PowerPC/JitILCommon/IR.h @@ -229,7 +229,10 @@ InstLoc inline getOp2(InstLoc i) class IRBuilder { public: - IRBuilder() { Reset(); } + IRBuilder(); + + void Reset(); + InstLoc EmitIntConst(unsigned value) { return EmitIntConst64(value); } InstLoc EmitIntConst64(u64 value); @@ -382,34 +385,6 @@ public: bool IsMarkUsed(InstLoc I) const; void WriteToFile(u64 codeHash); - void Reset() - { - InstList.clear(); - InstList.reserve(100000); - MarkUsed.clear(); - MarkUsed.reserve(100000); - - for (unsigned i = 0; i < 32; i++) - { - GRegCache[i] = nullptr; - GRegCacheStore[i] = nullptr; - FRegCache[i] = nullptr; - FRegCacheStore[i] = nullptr; - } - - CarryCache = nullptr; - CarryCacheStore = nullptr; - - for (unsigned i = 0; i < 8; i++) - { - CRCache[i] = nullptr; - CRCacheStore[i] = nullptr; - } - - CTRCache = nullptr; - CTRCacheStore = nullptr; - } - private: IRBuilder(IRBuilder&); // DO NOT IMPLEMENT