From e7f82e2515f47f3c3292281312d7031a34a58ffc Mon Sep 17 00:00:00 2001 From: Fred Shih Date: Wed, 6 Aug 2014 10:46:37 -0700 Subject: Added support for patching classes from different dex files. Added support for class patching from different dex files and moved ScopedObjectAccess from the quick compiler to driver. Slight refactoring for clarity. Bug: 16656190 Change-Id: I107fcbce75db42ca61321ea1c5d5f236680a1b3d --- compiler/driver/compiler_driver.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 6dae398372..6dea8dc38f 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -213,6 +213,12 @@ class CompilerDriver { bool* is_type_initialized, bool* use_direct_type_ptr, uintptr_t* direct_type_ptr, bool* out_is_finalizable); + // Query methods for the java.lang.ref.Reference class. + bool CanEmbedReferenceTypeInCode(ClassReference* ref, + bool* use_direct_type_ptr, uintptr_t* direct_type_ptr); + uint32_t GetReferenceSlowFlagOffset() const; + uint32_t GetReferenceDisableFlagOffset() const; + // Get the DexCache for the mirror::DexCache* GetDexCache(const DexCompilationUnit* mUnit) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -356,6 +362,7 @@ class CompilerDriver { uint16_t referrer_class_def_idx, uint32_t referrer_method_idx, uint32_t target_method_idx, + const DexFile* target_dex_file, size_t literal_offset) LOCKS_EXCLUDED(compiled_methods_lock_); @@ -549,6 +556,10 @@ class CompilerDriver { class TypePatchInformation : public PatchInformation { public: + const DexFile& GetTargetTypeDexFile() const { + return *target_type_dex_file_; + } + uint32_t GetTargetTypeIdx() const { return target_type_idx_; } @@ -565,13 +576,15 @@ class CompilerDriver { uint16_t referrer_class_def_idx, uint32_t referrer_method_idx, uint32_t target_type_idx, + const DexFile* target_type_dex_file, size_t literal_offset) : PatchInformation(dex_file, referrer_class_def_idx, referrer_method_idx, literal_offset), - target_type_idx_(target_type_idx) { + target_type_idx_(target_type_idx), target_type_dex_file_(target_type_dex_file) { } const uint32_t target_type_idx_; + const DexFile* target_type_dex_file_; friend class CompilerDriver; DISALLOW_COPY_AND_ASSIGN(TypePatchInformation); -- cgit v1.2.3-59-g8ed1b