diff options
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r-- | compiler/driver/compiler_driver.h | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index c562f76..c4ac9db 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -39,10 +39,15 @@ namespace art { +namespace verifier { +class MethodVerifier; +} // namespace verifier + class AOTCompilationStats; class ParallelCompilationManager; class DexCompilationUnit; class DexFileToMethodInlinerMap; +class InlineIGetIPutData; class OatWriter; class TimingLogger; class VerificationResults; @@ -196,6 +201,13 @@ class CompilerDriver { bool* is_type_initialized, bool* use_direct_type_ptr, uintptr_t* direct_type_ptr); + // Can we fast path instance field access in a verified accessor? + // If yes, computes field's offset and volatility and whether the method is static or not. + static bool ComputeSpecialAccessorInfo(uint32_t field_idx, bool is_put, + verifier::MethodVerifier* verifier, + InlineIGetIPutData* result) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Can we fast path instance field access? Computes field's offset and volatility. bool ComputeInstanceFieldInfo(uint32_t field_idx, const DexCompilationUnit* mUnit, bool is_put, int* field_offset, bool* is_volatile) @@ -228,6 +240,15 @@ class CompilerDriver { InvokeType target_invoke_type, size_t literal_offset) LOCKS_EXCLUDED(compiled_methods_lock_); + void AddRelativeCodePatch(const DexFile* dex_file, + uint16_t referrer_class_def_idx, + uint32_t referrer_method_idx, + InvokeType referrer_invoke_type, + uint32_t target_method_idx, + InvokeType target_invoke_type, + size_t literal_offset, + int32_t pc_relative_offset) + LOCKS_EXCLUDED(compiled_methods_lock_); void AddMethodPatch(const DexFile* dex_file, uint16_t referrer_class_def_idx, uint32_t referrer_method_idx, @@ -361,8 +382,14 @@ class CompilerDriver { bool IsCall() const { return true; } + virtual bool IsRelative() const { + return false; + } + virtual int RelativeOffset() const { + return 0; + } - private: + protected: CallPatchInformation(const DexFile* dex_file, uint16_t referrer_class_def_idx, uint32_t referrer_method_idx, @@ -377,6 +404,7 @@ class CompilerDriver { target_invoke_type_(target_invoke_type) { } + private: const InvokeType referrer_invoke_type_; const uint32_t target_method_idx_; const InvokeType target_invoke_type_; @@ -385,6 +413,36 @@ class CompilerDriver { DISALLOW_COPY_AND_ASSIGN(CallPatchInformation); }; + class RelativeCallPatchInformation : public CallPatchInformation { + public: + bool IsRelative() const { + return true; + } + int RelativeOffset() const { + return offset_; + } + + private: + RelativeCallPatchInformation(const DexFile* dex_file, + uint16_t referrer_class_def_idx, + uint32_t referrer_method_idx, + InvokeType referrer_invoke_type, + uint32_t target_method_idx, + InvokeType target_invoke_type, + size_t literal_offset, + int32_t pc_relative_offset) + : CallPatchInformation(dex_file, referrer_class_def_idx, + referrer_method_idx, referrer_invoke_type, + target_method_idx, target_invoke_type, literal_offset), + offset_(pc_relative_offset) { + } + + const int offset_; + + friend class CompilerDriver; + DISALLOW_COPY_AND_ASSIGN(RelativeCallPatchInformation); + }; + class TypePatchInformation : public PatchInformation { public: uint32_t GetTargetTypeIdx() const { |