From e63db27db913f1a88e2095a1ee8239b2bb9124e8 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Tue, 15 Jul 2014 15:36:11 -0700 Subject: Break apart header files. Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933 --- runtime/runtime.h | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index 45af437..fccccbd 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -32,7 +32,6 @@ #include "offsets.h" #include "profiler_options.h" #include "quick/quick_method_frame_info.h" -#include "read_barrier-inl.h" #include "runtime_stats.h" #include "safe_map.h" @@ -69,6 +68,8 @@ class ThreadList; class Trace; class Transaction; +typedef std::vector> RuntimeOptions; + // Not all combinations of flags are valid. You may not visit all roots as well as the new roots // (no logical reason to do this). You also may not start logging new roots and stop logging new // roots (also no logical reason to do this). @@ -82,10 +83,8 @@ enum VisitRootFlags : uint8_t { class Runtime { public: - typedef std::vector> Options; - // Creates and initializes a new runtime. - static bool Create(const Options& options, bool ignore_unrecognized) + static bool Create(const RuntimeOptions& options, bool ignore_unrecognized) SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_); bool IsCompiler() const { @@ -266,13 +265,10 @@ class Runtime { SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // Returns a special method that calls into a trampoline for runtime method resolution - mirror::ArtMethod* GetResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK(HasResolutionMethod()); - return ReadBarrier::BarrierForRoot(&resolution_method_); - } + mirror::ArtMethod* GetResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool HasResolutionMethod() const { - return resolution_method_ != NULL; + return resolution_method_ != nullptr; } void SetResolutionMethod(mirror::ArtMethod* method) { @@ -281,14 +277,11 @@ class Runtime { mirror::ArtMethod* CreateResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - // Returns a special method that calls into a trampoline for runtime imt conflicts - mirror::ArtMethod* GetImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK(HasImtConflictMethod()); - return ReadBarrier::BarrierForRoot(&imt_conflict_method_); - } + // Returns a special method that calls into a trampoline for runtime imt conflicts. + mirror::ArtMethod* GetImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool HasImtConflictMethod() const { - return imt_conflict_method_ != NULL; + return imt_conflict_method_ != nullptr; } void SetImtConflictMethod(mirror::ArtMethod* method) { @@ -299,14 +292,10 @@ class Runtime { // Returns an imt with every entry set to conflict, used as default imt for all classes. mirror::ObjectArray* GetDefaultImt() - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - CHECK(HasDefaultImt()); - return ReadBarrier::BarrierForRoot, kWithReadBarrier>( - &default_imt_); - } + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool HasDefaultImt() const { - return default_imt_ != NULL; + return default_imt_ != nullptr; } void SetDefaultImt(mirror::ObjectArray* imt) { @@ -329,17 +318,10 @@ class Runtime { } mirror::ArtMethod* GetCalleeSaveMethod(CalleeSaveType type) - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - DCHECK(HasCalleeSaveMethod(type)); - return ReadBarrier::BarrierForRoot( - &callee_save_methods_[type]); - } + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); mirror::ArtMethod* GetCalleeSaveMethodUnchecked(CalleeSaveType type) - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return ReadBarrier::BarrierForRoot( - &callee_save_methods_[type]); - } + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); QuickMethodFrameInfo GetCalleeSaveMethodFrameInfo(CalleeSaveType type) const { return callee_save_method_frame_infos_[type]; @@ -474,7 +456,7 @@ class Runtime { void BlockSignals(); - bool Init(const Options& options, bool ignore_unrecognized) + bool Init(const RuntimeOptions& options, bool ignore_unrecognized) SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_); void InitNativeMethods() LOCKS_EXCLUDED(Locks::mutator_lock_); void InitThreadGroups(Thread* self); -- cgit v1.1