Style in using #if USE_MCJIT and #if USE_OLD_JIT
Change-Id: Ia824c7fac549b4cb6582b461336a18ce51faef74
diff --git a/lib/ExecutionEngine/Script.cpp b/lib/ExecutionEngine/Script.cpp
index 4e81864..67e59f6 100644
--- a/lib/ExecutionEngine/Script.cpp
+++ b/lib/ExecutionEngine/Script.cpp
@@ -245,16 +245,17 @@
#if USE_MCJIT
getObjPath(objPath);
getInfoPath(infoPath);
- #endif
+#endif
if (objFile.open(objPath.c_str(), OpenMode::Read) < 0) {
// Unable to open the cache file in read mode.
return 1;
}
- #if USE_OLD_JIT
+#if USE_OLD_JIT
CacheReader reader;
- #endif
+#endif
+
#if USE_MCJIT
if (infoFile.open(infoPath.c_str(), OpenMode::Read) < 0) {
// Unable to open the cache file in read mode.
@@ -268,7 +269,7 @@
reader.registerSymbolCallback(mpExtSymbolLookupFn,
mpExtSymbolLookupFnContext);
}
- #endif
+#endif
// Dependencies
#if USE_LIBBCC_SHA1SUM
@@ -287,9 +288,11 @@
#if USE_MCJIT
ScriptCached *cached = reader.readCacheFile(&objFile, &infoFile, this);
#endif
+
#if USE_OLD_JIT
ScriptCached *cached = reader.readCacheFile(&objFile, this);
#endif
+
if (!cached) {
mIsContextSlotNotAvail = reader.isContextSlotNotAvail();
return 1;
@@ -399,6 +402,7 @@
&& infoFile.open(infoPath.c_str(), OpenMode::Write) >= 0
#endif
) {
+
#if USE_MCJIT
MCCacheWriter writer;
#endif
@@ -426,6 +430,7 @@
(uint32_t)mpExtSymbolLookupFn(mpExtSymbolLookupFnContext,
"__isThreadable");
}
+
#if USE_OLD_JIT
if (!writer.writeCacheFile(&objFile, this, libRS_threadable)) {
#endif
@@ -471,6 +476,7 @@
void *Script::lookup(const char *name) {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->lookup(name);
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->lookup(name);
#endif
@@ -485,9 +491,11 @@
size_t Script::getExportVarCount() const {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->getExportVarCount();
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getExportVarCount();
#endif
+
default: return 0;
}
}
@@ -496,9 +504,11 @@
size_t Script::getExportFuncCount() const {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->getExportFuncCount();
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getExportFuncCount();
#endif
+
default: return 0;
}
}
@@ -507,9 +517,11 @@
size_t Script::getPragmaCount() const {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->getPragmaCount();
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getPragmaCount();
#endif
+
default: return 0;
}
}
@@ -518,9 +530,11 @@
size_t Script::getFuncCount() const {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->getFuncCount();
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getFuncCount();
#endif
+
default: return 0;
}
}
@@ -529,9 +543,11 @@
size_t Script::getObjectSlotCount() const {
switch (mStatus) {
case ScriptStatus::Compiled: return mCompiled->getObjectSlotCount();
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getObjectSlotCount();
#endif
+
default: return 0;
}
}
@@ -643,9 +659,11 @@
char *Script::getContext() {
switch (mStatus) {
+
#if USE_CACHE
case ScriptStatus::Cached: return mCached->getContext();
#endif
+
case ScriptStatus::Compiled: return mCompiled->getContext();
default:
@@ -666,6 +684,7 @@
}
return 0;
}
+
#if USE_MCJIT
size_t Script::getELFSize() const {
switch (mStatus) {