Remove OLD_JIT support from libbcc.
BUG=6051742
This change removes some legacy defines and files related to the original
LLVM JIT path. A follow-up change should remove MCJIT-related defines, since
we are not a JIT, but instead using MC CodeGen to emit ELF.
Change-Id: I193235a7716e5f8c653a617a2fb74840bf3406e0
diff --git a/lib/ExecutionEngine/Script.cpp b/lib/ExecutionEngine/Script.cpp
index 4b0b406..3b67e04 100644
--- a/lib/ExecutionEngine/Script.cpp
+++ b/lib/ExecutionEngine/Script.cpp
@@ -18,19 +18,10 @@
#include "Config.h"
-#if USE_OLD_JIT
-#include "OldJIT/CacheReader.h"
-#include "OldJIT/CacheWriter.h"
-#endif
-
#include "MCCacheReader.h"
#include "MCCacheWriter.h"
#include "CompilerOption.h"
-#if USE_OLD_JIT
-#include "OldJIT/ContextManager.h"
-#endif
-
#include "DebugHelper.h"
#include "FileHandle.h"
#include "GDBJITRegistrar.h"
@@ -294,9 +285,7 @@
return 1;
}
-#if USE_OLD_JIT
- CacheReader reader;
-#elif USE_MCJIT
+#if USE_MCJIT
MCCacheReader reader;
// Register symbol lookup function
@@ -413,12 +402,7 @@
// Note: If the address of the context is not in the context slot, then
// we don't have to cache it.
- if (
-#if USE_OLD_JIT
- !mIsContextSlotNotAvail &&
- ContextManager::get().isManagingContext(getContext()) &&
-#endif
- isCacheable()) {
+ if (isCacheable()) {
std::string objPath = getCachedObjectPath();
std::string infoPath = getCacheInfoPath();
@@ -428,7 +412,7 @@
// to modify its contents. (The same script may be running concurrently in
// the same process or a different process!)
::unlink(objPath.c_str());
-#if !USE_OLD_JIT && USE_MCJIT
+#if USE_MCJIT
::unlink(infoPath.c_str());
#endif
@@ -438,9 +422,7 @@
if (objFile.open(objPath.c_str(), OpenMode::Write) >= 0 &&
infoFile.open(infoPath.c_str(), OpenMode::Write) >= 0) {
-#if USE_OLD_JIT
- CacheWriter writer;
-#elif USE_MCJIT
+#if USE_MCJIT
MCCacheWriter writer;
#endif
@@ -798,29 +780,6 @@
}
-#if USE_OLD_JIT
-char *Script::getContext() {
- switch (mStatus) {
-
-#if USE_CACHE
- case ScriptStatus::Cached: {
- return mCached->getContext();
- }
-#endif
-
- case ScriptStatus::Compiled: {
- return mCompiled->getContext();
- }
-
- default: {
- mErrorCode = BCC_INVALID_OPERATION;
- return NULL;
- }
- }
-}
-#endif
-
-
int Script::registerSymbolCallback(BCCSymbolLookupFn pFn, void *pContext) {
mpExtSymbolLookupFn = pFn;
mpExtSymbolLookupFnContext = pContext;