Commit 2fb41102 by Nicolas Capens Committed by Nicolas Capens

Rename MemoryManager to RoutineManager.

BUG=15907357 Change-Id: I3aeffd19952f6b3d3c35d0dbdb6720a229824cd0 Reviewed-on: https://swiftshader-review.googlesource.com/1141Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 4f8facd0
...@@ -293,8 +293,8 @@ ...@@ -293,8 +293,8 @@
<Unit filename="./../../Main/serialcommon.h" /> <Unit filename="./../../Main/serialcommon.h" />
<Unit filename="./../../Main/serialvalid.cpp" /> <Unit filename="./../../Main/serialvalid.cpp" />
<Unit filename="./../../Main/serialvalid.h" /> <Unit filename="./../../Main/serialvalid.h" />
<Unit filename="./../../Reactor/MemoryManager.cpp" /> <Unit filename="./../../Reactor/RoutineManager.cpp" />
<Unit filename="./../../Reactor/MemoryManager.hpp" /> <Unit filename="./../../Reactor/RoutineManager.hpp" />
<Unit filename="./../../Reactor/Nucleus.cpp" /> <Unit filename="./../../Reactor/Nucleus.cpp" />
<Unit filename="./../../Reactor/Nucleus.hpp" /> <Unit filename="./../../Reactor/Nucleus.hpp" />
<Unit filename="./../../Reactor/Reactor.hpp" /> <Unit filename="./../../Reactor/Reactor.hpp" />
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "llvm/Support/TargetSelect.h" #include "llvm/Support/TargetSelect.h"
#include "../lib/ExecutionEngine/JIT/JIT.h" #include "../lib/ExecutionEngine/JIT/JIT.h"
#include "MemoryManager.hpp" #include "RoutineManager.hpp"
#include "x86.hpp" #include "x86.hpp"
#include "CPUID.hpp" #include "CPUID.hpp"
#include "Thread.hpp" #include "Thread.hpp"
...@@ -59,7 +59,7 @@ namespace sw ...@@ -59,7 +59,7 @@ namespace sw
using namespace llvm; using namespace llvm;
MemoryManager *Nucleus::memoryManager = 0; RoutineManager *Nucleus::routineManager = 0;
ExecutionEngine *Nucleus::executionEngine = 0; ExecutionEngine *Nucleus::executionEngine = 0;
Builder *Nucleus::builder = 0; Builder *Nucleus::builder = 0;
LLVMContext *Nucleus::context = 0; LLVMContext *Nucleus::context = 0;
...@@ -76,7 +76,7 @@ namespace sw ...@@ -76,7 +76,7 @@ namespace sw
buffer = memory; buffer = memory;
entry = memory; entry = memory;
functionSize = bufferSize; // Updated by MemoryManager::endFunctionBody functionSize = bufferSize; // Updated by RoutineManager::endFunctionBody
bindCount = 0; bindCount = 0;
} }
...@@ -158,7 +158,7 @@ namespace sw ...@@ -158,7 +158,7 @@ namespace sw
} }
module = new Module("", *context); module = new Module("", *context);
memoryManager = new MemoryManager(); routineManager = new RoutineManager();
#if defined(__x86_64__) #if defined(__x86_64__)
const char *architecture = "x86-64"; const char *architecture = "x86-64";
...@@ -177,7 +177,7 @@ namespace sw ...@@ -177,7 +177,7 @@ namespace sw
std::string error; std::string error;
TargetMachine *targetMachine = EngineBuilder::selectTarget(module, architecture, "", MAttrs, Reloc::Default, CodeModel::JITDefault, &error); TargetMachine *targetMachine = EngineBuilder::selectTarget(module, architecture, "", MAttrs, Reloc::Default, CodeModel::JITDefault, &error);
executionEngine = JIT::createJIT(module, 0, memoryManager, CodeGenOpt::Aggressive, true, targetMachine); executionEngine = JIT::createJIT(module, 0, routineManager, CodeGenOpt::Aggressive, true, targetMachine);
if(!builder) if(!builder)
{ {
...@@ -202,7 +202,7 @@ namespace sw ...@@ -202,7 +202,7 @@ namespace sw
delete executionEngine; delete executionEngine;
executionEngine = 0; executionEngine = 0;
memoryManager = 0; routineManager = 0;
function = 0; function = 0;
module = 0; module = 0;
} }
...@@ -244,7 +244,7 @@ namespace sw ...@@ -244,7 +244,7 @@ namespace sw
void *entry = executionEngine->getPointerToFunction(function); void *entry = executionEngine->getPointerToFunction(function);
Routine *routine = memoryManager->acquireRoutine(); Routine *routine = routineManager->acquireRoutine();
routine->entry = entry; routine->entry = entry;
markExecutable(routine->buffer, routine->bufferSize); markExecutable(routine->buffer, routine->bufferSize);
......
...@@ -61,7 +61,7 @@ namespace sw ...@@ -61,7 +61,7 @@ namespace sw
extern Optimization optimization[10]; extern Optimization optimization[10];
class MemoryManager; class RoutineManager;
class Builder; class Builder;
class Nucleus; class Nucleus;
...@@ -249,7 +249,7 @@ namespace sw ...@@ -249,7 +249,7 @@ namespace sw
static llvm::Function *function; static llvm::Function *function;
static llvm::LLVMContext *context; static llvm::LLVMContext *context;
static llvm::Module *module; static llvm::Module *module;
static MemoryManager *memoryManager; static RoutineManager *routineManager;
}; };
class Byte; class Byte;
......
...@@ -261,14 +261,14 @@ ...@@ -261,14 +261,14 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="DLL.cpp" /> <ClCompile Include="DLL.cpp" />
<ClCompile Include="MemoryManager.cpp" />
<ClCompile Include="Nucleus.cpp" /> <ClCompile Include="Nucleus.cpp" />
<ClCompile Include="RoutineManager.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="DLL.hpp" /> <ClInclude Include="DLL.hpp" />
<ClInclude Include="MemoryManager.hpp" />
<ClInclude Include="Nucleus.hpp" /> <ClInclude Include="Nucleus.hpp" />
<ClInclude Include="Reactor.hpp" /> <ClInclude Include="Reactor.hpp" />
<ClInclude Include="RoutineManager.hpp" />
<ClInclude Include="x86.hpp" /> <ClInclude Include="x86.hpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<ClCompile Include="DLL.cpp"> <ClCompile Include="DLL.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="MemoryManager.cpp"> <ClCompile Include="Nucleus.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Nucleus.cpp"> <ClCompile Include="RoutineManager.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
<ClInclude Include="DLL.hpp"> <ClInclude Include="DLL.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="MemoryManager.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Nucleus.hpp"> <ClInclude Include="Nucleus.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
...@@ -41,5 +38,8 @@ ...@@ -41,5 +38,8 @@
<ClInclude Include="x86.hpp"> <ClInclude Include="x86.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="RoutineManager.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// or implied, including but not limited to any patent rights, are granted to you. // or implied, including but not limited to any patent rights, are granted to you.
// //
#include "MemoryManager.hpp" #include "RoutineManager.hpp"
#include "Nucleus.hpp" #include "Nucleus.hpp"
...@@ -17,29 +17,29 @@ namespace sw ...@@ -17,29 +17,29 @@ namespace sw
{ {
using namespace llvm; using namespace llvm;
MemoryManager::MemoryManager() RoutineManager::RoutineManager()
{ {
routine = 0; routine = 0;
} }
MemoryManager::~MemoryManager() RoutineManager::~RoutineManager()
{ {
delete routine; delete routine;
} }
void MemoryManager::AllocateGOT() void RoutineManager::AllocateGOT()
{ {
// FIXME: ASSERT(false); // FIXME: ASSERT(false);
} }
unsigned char *MemoryManager::allocateStub(const GlobalValue *function, unsigned stubSize, unsigned alignment) unsigned char *RoutineManager::allocateStub(const GlobalValue *function, unsigned stubSize, unsigned alignment)
{ {
// FIXME: ASSERT(false); // FIXME: ASSERT(false);
return 0; return 0;
} }
unsigned char *MemoryManager::startFunctionBody(const llvm::Function *function, uintptr_t &actualSize) unsigned char *RoutineManager::startFunctionBody(const llvm::Function *function, uintptr_t &actualSize)
{ {
if(actualSize == 0) if(actualSize == 0)
{ {
...@@ -54,59 +54,59 @@ namespace sw ...@@ -54,59 +54,59 @@ namespace sw
return (unsigned char*)routine->getBuffer(); return (unsigned char*)routine->getBuffer();
} }
void MemoryManager::endFunctionBody(const llvm::Function *function, unsigned char *functionStart, unsigned char *functionEnd) void RoutineManager::endFunctionBody(const llvm::Function *function, unsigned char *functionStart, unsigned char *functionEnd)
{ {
routine->setFunctionSize(functionEnd - functionStart); routine->setFunctionSize(functionEnd - functionStart);
} }
unsigned char *MemoryManager::startExceptionTable(const llvm::Function* F, uintptr_t &ActualSize) unsigned char *RoutineManager::startExceptionTable(const llvm::Function* F, uintptr_t &ActualSize)
{ {
// FIXME: ASSERT(false); // FIXME: ASSERT(false);
return 0; return 0;
} }
void MemoryManager::endExceptionTable(const llvm::Function *F, unsigned char *TableStart, unsigned char *TableEnd, unsigned char* FrameRegister) void RoutineManager::endExceptionTable(const llvm::Function *F, unsigned char *TableStart, unsigned char *TableEnd, unsigned char* FrameRegister)
{ {
// FIXME: ASSERT(false); // FIXME: ASSERT(false);
} }
unsigned char *MemoryManager::getGOTBase() const unsigned char *RoutineManager::getGOTBase() const
{ {
return 0; return 0;
} }
unsigned char *MemoryManager::allocateSpace(intptr_t Size, unsigned Alignment) unsigned char *RoutineManager::allocateSpace(intptr_t Size, unsigned Alignment)
{ {
return 0; return 0;
} }
unsigned char *MemoryManager::allocateGlobal(uintptr_t Size, unsigned Alignment) unsigned char *RoutineManager::allocateGlobal(uintptr_t Size, unsigned Alignment)
{ {
return 0; return 0;
} }
void MemoryManager::deallocateFunctionBody(void *Body) void RoutineManager::deallocateFunctionBody(void *Body)
{ {
} }
void MemoryManager::deallocateExceptionTable(void *ET) void RoutineManager::deallocateExceptionTable(void *ET)
{ {
} }
void MemoryManager::setMemoryWritable() void RoutineManager::setMemoryWritable()
{ {
} }
void MemoryManager::setMemoryExecutable() void RoutineManager::setMemoryExecutable()
{ {
} }
void MemoryManager::setPoisonMemory(bool poison) void RoutineManager::setPoisonMemory(bool poison)
{ {
} }
Routine *MemoryManager::acquireRoutine() Routine *RoutineManager::acquireRoutine()
{ {
Routine *result = routine; Routine *result = routine;
...@@ -115,11 +115,11 @@ namespace sw ...@@ -115,11 +115,11 @@ namespace sw
return result; return result;
} }
void MemoryManager::SetDlsymTable(void *pointer) void RoutineManager::SetDlsymTable(void *pointer)
{ {
} }
void *MemoryManager::getDlsymTable() const void *RoutineManager::getDlsymTable() const
{ {
return 0; return 0;
} }
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
// or implied, including but not limited to any patent rights, are granted to you. // or implied, including but not limited to any patent rights, are granted to you.
// //
#ifndef sw_MemoryManager_hpp #ifndef sw_RoutineManager_hpp
#define sw_MemoryManager_hpp #define sw_RoutineManager_hpp
#include "llvm/GlobalValue.h" #include "llvm/GlobalValue.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/ExecutionEngine/JITMemoryManager.h"
...@@ -19,12 +19,12 @@ namespace sw ...@@ -19,12 +19,12 @@ namespace sw
{ {
class Routine; class Routine;
class MemoryManager : public llvm::JITMemoryManager class RoutineManager : public llvm::JITMemoryManager
{ {
public: public:
MemoryManager(); RoutineManager();
~MemoryManager(); ~RoutineManager();
void AllocateGOT(); void AllocateGOT();
...@@ -51,4 +51,4 @@ namespace sw ...@@ -51,4 +51,4 @@ namespace sw
}; };
} }
#endif // sw_MemoryManager_hpp #endif // sw_RoutineManager_hpp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment