< prev index next >
src/share/vm/shark/sharkCompiler.cpp
Print this page
@@ -59,11 +59,19 @@
SharkCompiler::SharkCompiler()
: AbstractCompiler(shark) {
// Create the lock to protect the memory manager and execution engine
_execution_engine_lock = new Monitor(Mutex::leaf, "SharkExecutionEngineLock");
+ {
MutexLocker locker(execution_engine_lock());
+ init_llvm();
+ }
+ // All done
+ set_state(initialized);
+}
+
+void SharkCompiler::init_llvm() {
// Make LLVM safe for multithreading
if (!llvm_start_multithreaded())
fatal("llvm_start_multithreaded() failed");
@@ -132,13 +140,10 @@
printf("Unknown error while creating Shark JIT\n");
exit(1);
}
execution_engine()->addModule(_native_context->module());
-
- // All done
- set_state(initialized);
}
void SharkCompiler::initialize() {
ShouldNotCallThis();
}
@@ -163,11 +168,11 @@
if (!fnmatch(SharkPrintTypeflowOf, name, 0))
flow->print_on(tty);
}
// Create the recorders
- Arena arena;
+ Arena arena(mtCompiler);
env->set_oop_recorder(new OopRecorder(&arena));
OopMapSet oopmaps;
env->set_debug_info(new DebugInformationRecorder(env->oop_recorder()));
env->debug_info()->set_oopmaps(&oopmaps);
env->set_dependencies(new Dependencies(env));
< prev index next >