summaryrefslogtreecommitdiffstats
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
authorMark Mendell <mark.p.mendell@intel.com>2014-02-06 11:02:52 -0800
committerMark Mendell <mark.p.mendell@intel.com>2014-02-10 12:21:49 -0800
commit55d0eac918321e0525f6e6491f36a80977e0d416 (patch)
tree4fe2bc465d3fa74fb24b9052465e1dbabd81277e /compiler/driver/compiler_driver.h
parent14fb1314cc8ef4c8342e5e6f3f830e4a64521623 (diff)
downloadart-55d0eac918321e0525f6e6491f36a80977e0d416.zip
art-55d0eac918321e0525f6e6491f36a80977e0d416.tar.gz
art-55d0eac918321e0525f6e6491f36a80977e0d416.tar.bz2
Support Direct Method/Type access for X86
Thumb generates code to optimize calls to methods within core.oat. Implement this for X86 as well, but take advantage of mov with 32 bit immediate and call relative with 32 bit immediate. Fix some incorrect return locations for long inlines. Change-Id: I1907bdfc7574f3d0aa76c7fad13dc537acdf1ed3 Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h48
1 files changed, 47 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index ea43e4f..e9b695b 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -238,6 +238,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,
@@ -362,8 +371,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,
@@ -378,6 +393,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_;
@@ -386,6 +402,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 {