aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-27 20:30:28 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-27 20:30:28 +0000
commitdc85724f703bddf6988b6b3f20203beab775f32b (patch)
treea936eb2947dd33c21f495fd517444bb74ab89493 /lib/ExecutionEngine/JIT/JITEmitter.cpp
parent5f75cf511bca0598d4db3b19d0f154ce5657f058 (diff)
Change the JIT to compile eagerly by default as agreed in
http://llvm.org/PR5184, and beef up the comments to describe what both options do and the risks of lazy compilation in the presence of threads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITEmitter.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 394fd8ff2a..79f1eb43c6 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -295,11 +295,11 @@ void *JITResolver::getFunctionStub(Function *F) {
void *&Stub = state.getFunctionToStubMap(locked)[F];
if (Stub) return Stub;
- // Call the lazy resolver function unless we are JIT'ing non-lazily, in which
- // case we must resolve the symbol now.
- void *Actual = TheJIT->isLazyCompilationDisabled()
- ? (void *)0 : (void *)(intptr_t)LazyResolverFn;
-
+ // Call the lazy resolver function if we are JIT'ing lazily. Otherwise we
+ // must resolve the symbol now.
+ void *Actual = TheJIT->isCompilingLazily()
+ ? (void *)(intptr_t)LazyResolverFn : (void *)0;
+
// If this is an external declaration, attempt to resolve the address now
// to place in the stub.
if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode()) {
@@ -334,7 +334,7 @@ void *JITResolver::getFunctionStub(Function *F) {
// If we are JIT'ing non-lazily but need to call a function that does not
// exist yet, add it to the JIT's work list so that we can fill in the stub
// address later.
- if (!Actual && TheJIT->isLazyCompilationDisabled())
+ if (!Actual && !TheJIT->isCompilingLazily())
if (!F->isDeclaration() || F->hasNotBeenReadFromBitcode())
TheJIT->addPendingFunction(F);
@@ -471,7 +471,7 @@ void *JITResolver::JITCompilerFn(void *Stub) {
// Otherwise we don't have it, do lazy compilation now.
// If lazy compilation is disabled, emit a useful error message and abort.
- if (TheJIT->isLazyCompilationDisabled()) {
+ if (!TheJIT->isCompilingLazily()) {
llvm_report_error("LLVM JIT requested to do lazy compilation of function '"
+ F->getName() + "' when lazy compiles are disabled!");
}
@@ -769,7 +769,7 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
// mechanism is capable of rewriting the instruction directly, prefer to do
// that instead of emitting a stub. This uses the lazy resolver, so is not
// legal if lazy compilation is disabled.
- if (DoesntNeedStub && !TheJIT->isLazyCompilationDisabled())
+ if (DoesntNeedStub && TheJIT->isCompilingLazily())
return Resolver.AddCallbackAtLocation(F, Reference);
// Otherwise, we have to emit a stub.