Remove #include "oat_file.h" from class_linker.h .
Refactor the OatClass and OatMethod related functions from
ClassLinker to OatFile and ArtMethod, respectively. Refactor
the remaining ClassLinker dependencies on OatFile to break
the #include dependency and reduce incremental build times.
Test: m test-art-host
Change-Id: Iebc5b9f81b48fbcf79821cc827a5d7c4a0261bf6
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index f69a576..63389d8 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -34,7 +34,7 @@
#include "dex_file.h"
#include "gc_root.h"
#include "jni.h"
-#include "oat_file.h"
+#include "mirror/class.h"
#include "object_callbacks.h"
#include "verifier/verifier_log_mode.h"
@@ -57,8 +57,9 @@
class StackTraceElement;
} // namespace mirror
-class ImtConflictTable;
template<class T> class Handle;
+class ImtConflictTable;
+template<typename T> class LengthPrefixedArray;
template<class T> class MutableHandle;
class InternTable;
template<class T> class ObjectLock;
@@ -511,19 +512,10 @@
REQUIRES(!dex_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
- // Get the oat code for a method when its class isn't yet initialized
+ // Get the oat code for a method when its class isn't yet initialized.
const void* GetQuickOatCodeFor(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
- // Get compiled code for a method, return null if no code
- // exists. This is unlike Get..OatCodeFor which will return a bridge
- // or interpreter entrypoint.
- const void* GetOatMethodQuickCodeFor(ArtMethod* method)
- REQUIRES_SHARED(Locks::mutator_lock_);
-
- const OatFile::OatMethod FindOatMethodFor(ArtMethod* method, bool* found)
- REQUIRES_SHARED(Locks::mutator_lock_);
-
pid_t GetClassesLockOwner(); // For SignalCatcher.
pid_t GetDexLockOwner(); // For SignalCatcher.
@@ -540,6 +532,10 @@
// Is the given entry point quick code to run the generic JNI stub?
bool IsQuickGenericJniStub(const void* entry_point) const;
+ const void* GetQuickToInterpreterBridgeTrampoline() const {
+ return quick_to_interpreter_bridge_trampoline_;
+ }
+
InternTable* GetInternTable() const {
return intern_table_;
}
@@ -783,8 +779,7 @@
void LoadClassMembers(Thread* self,
const DexFile& dex_file,
const uint8_t* class_data,
- Handle<mirror::Class> klass,
- const OatFile::OatClass* oat_class)
+ Handle<mirror::Class> klass)
REQUIRES_SHARED(Locks::mutator_lock_);
void LoadField(const ClassDataItemIterator& it, Handle<mirror::Class> klass, ArtField* dst)
@@ -797,11 +792,6 @@
void FixupStaticTrampolines(mirror::Class* klass) REQUIRES_SHARED(Locks::mutator_lock_);
- // Finds the associated oat class for a dex_file and descriptor. Returns an invalid OatClass on
- // error and sets found to false.
- OatFile::OatClass FindOatClass(const DexFile& dex_file, uint16_t class_def_idx, bool* found)
- REQUIRES_SHARED(Locks::mutator_lock_);
-
void RegisterDexFileLocked(const DexFile& dex_file, Handle<mirror::DexCache> dex_cache)
REQUIRES(dex_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
@@ -861,11 +851,6 @@
ArtMethod** out_imt)
REQUIRES_SHARED(Locks::mutator_lock_);
- // Does anything needed to make sure that the compiler will not generate a direct invoke to this
- // method. Should only be called on non-invokable methods.
- void EnsureThrowsInvocationError(ArtMethod* method)
- REQUIRES_SHARED(Locks::mutator_lock_);
-
// A wrapper class representing the result of a method translation used for linking methods and
// updating superclass default methods. For each method in a classes vtable there are 4 states it
// could be in:
@@ -1015,10 +1000,6 @@
REQUIRES_SHARED(Locks::mutator_lock_);
bool LinkFields(Thread* self, Handle<mirror::Class> klass, bool is_static, size_t* class_size)
REQUIRES_SHARED(Locks::mutator_lock_);
- void LinkCode(ArtMethod* method,
- const OatFile::OatClass* oat_class,
- uint32_t class_def_method_index)
- REQUIRES_SHARED(Locks::mutator_lock_);
void CreateReferenceInstanceOffsets(Handle<mirror::Class> klass)
REQUIRES_SHARED(Locks::mutator_lock_);