summaryrefslogtreecommitdiff
path: root/runtime/jit/jit.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/jit/jit.h')
-rw-r--r--runtime/jit/jit.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h
index e2123666f9..96f9608a94 100644
--- a/runtime/jit/jit.h
+++ b/runtime/jit/jit.h
@@ -34,9 +34,11 @@ struct RuntimeArgumentMap;
namespace jit {
class JitCodeCache;
-class JitInstrumentationCache;
class JitOptions;
+static constexpr int16_t kJitCheckForOSR = -1;
+static constexpr int16_t kJitHotnessDisabled = -2;
+
class Jit {
public:
static constexpr bool kStressMode = kIsDebugBuild;
@@ -46,17 +48,16 @@ class Jit {
static Jit* Create(JitOptions* options, std::string* error_msg);
bool CompileMethod(ArtMethod* method, Thread* self, bool osr)
SHARED_REQUIRES(Locks::mutator_lock_);
- void CreateInstrumentationCache(size_t compile_threshold,
- size_t warmup_threshold,
- size_t osr_threshold,
- uint16_t priority_thread_weight);
void CreateThreadPool();
+
const JitCodeCache* GetCodeCache() const {
return code_cache_.get();
}
+
JitCodeCache* GetCodeCache() {
return code_cache_.get();
}
+
void DeleteThreadPool();
// Dump interesting info: #methods compiled, code vs data size, compile / verify cumulative
// loggers.
@@ -68,10 +69,39 @@ class Jit {
REQUIRES(!lock_)
SHARED_REQUIRES(Locks::mutator_lock_);
- JitInstrumentationCache* GetInstrumentationCache() const {
- return instrumentation_cache_.get();
+ size_t OSRMethodThreshold() const {
+ return osr_method_threshold_;
+ }
+
+ size_t HotMethodThreshold() const {
+ return hot_method_threshold_;
+ }
+
+ size_t WarmMethodThreshold() const {
+ return warm_method_threshold_;
}
+ uint16_t PriorityThreadWeight() const {
+ return priority_thread_weight_;
+ }
+
+ // Wait until there is no more pending compilation tasks.
+ void WaitForCompilationToFinish(Thread* self);
+
+ // Profiling methods.
+ void MethodEntered(Thread* thread, ArtMethod* method)
+ SHARED_REQUIRES(Locks::mutator_lock_);
+
+ void AddSamples(Thread* self, ArtMethod* method, uint16_t samples)
+ SHARED_REQUIRES(Locks::mutator_lock_);
+
+ void InvokeVirtualOrInterface(Thread* thread,
+ mirror::Object* this_object,
+ ArtMethod* caller,
+ uint32_t dex_pc,
+ ArtMethod* callee)
+ SHARED_REQUIRES(Locks::mutator_lock_);
+
// Starts the profile saver if the config options allow profile recording.
// The profile will be stored in the specified `filename` and will contain
// information collected from the given `code_paths` (a set of dex locations).
@@ -137,11 +167,15 @@ class Jit {
Histogram<uint64_t> memory_use_ GUARDED_BY(lock_);
Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
- std::unique_ptr<jit::JitInstrumentationCache> instrumentation_cache_;
std::unique_ptr<jit::JitCodeCache> code_cache_;
bool save_profiling_info_;
static bool generate_debug_info_;
+ uint16_t hot_method_threshold_;
+ uint16_t warm_method_threshold_;
+ uint16_t osr_method_threshold_;
+ uint16_t priority_thread_weight_;
+ std::unique_ptr<ThreadPool> thread_pool_;
DISALLOW_COPY_AND_ASSIGN(Jit);
};