summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-02-24 01:29:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-24 01:29:47 +0000
commit4fa1a274024067e160a60d0a77124e95dca980e1 (patch)
tree61dd41429b6b2ed29239f0c619c0e7ea058fd4ac /runtime/runtime.h
parent40c99de1fd26f9ba6fae20a01175240b96fc7443 (diff)
parent2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 (diff)
downloadart-4fa1a274024067e160a60d0a77124e95dca980e1.tar.gz
art-4fa1a274024067e160a60d0a77124e95dca980e1.tar.bz2
art-4fa1a274024067e160a60d0a77124e95dca980e1.zip
Merge "Add JIT"
Diffstat (limited to 'runtime/runtime.h')
-rw-r--r--runtime/runtime.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 944c8bd0dd..5078b7f1d6 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -48,6 +48,12 @@ namespace gc {
class GarbageCollector;
} // namespace collector
} // namespace gc
+
+namespace jit {
+ class Jit;
+ class JitOptions;
+} // namespace jit
+
namespace mirror {
class ArtMethod;
class ClassLoader;
@@ -95,12 +101,18 @@ class Runtime {
static bool Create(const RuntimeOptions& options, bool ignore_unrecognized)
SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_);
+ // IsAotCompiler for compilers that don't have a running runtime. Only dex2oat currently.
+ bool IsAotCompiler() const {
+ return !UseJit() && IsCompiler();
+ }
+
+ // IsCompiler is any runtime which has a running compiler, either dex2oat or JIT.
bool IsCompiler() const {
return compiler_callbacks_ != nullptr;
}
bool CanRelocate() const {
- return !IsCompiler() || compiler_callbacks_->IsRelocationPossible();
+ return !IsAotCompiler() || compiler_callbacks_->IsRelocationPossible();
}
bool ShouldRelocate() const {
@@ -339,9 +351,7 @@ class Runtime {
return !imt_conflict_method_.IsNull();
}
- void SetImtConflictMethod(mirror::ArtMethod* method) {
- imt_conflict_method_ = GcRoot<mirror::ArtMethod>(method);
- }
+ void SetImtConflictMethod(mirror::ArtMethod* method);
void SetImtUnimplementedMethod(mirror::ArtMethod* method) {
imt_unimplemented_method_ = GcRoot<mirror::ArtMethod>(method);
}
@@ -421,6 +431,14 @@ class Runtime {
kUnload,
kInitialize
};
+
+ jit::Jit* GetJit() {
+ return jit_.get();
+ }
+ bool UseJit() const {
+ return jit_.get() != nullptr;
+ }
+
void PreZygoteFork();
bool InitZygote();
void DidForkFromZygote(JNIEnv* env, NativeBridgeAction action, const char* isa);
@@ -525,6 +543,8 @@ class Runtime {
return zygote_max_failed_boots_;
}
+ void CreateJit();
+
private:
static void InitPlatformSignalHandlers();
@@ -604,6 +624,9 @@ class Runtime {
JavaVMExt* java_vm_;
+ std::unique_ptr<jit::Jit> jit_;
+ std::unique_ptr<jit::JitOptions> jit_options_;
+
// Fault message, printed when we get a SIGSEGV.
Mutex fault_message_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
std::string fault_message_ GUARDED_BY(fault_message_lock_);