summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/x86/call_x86.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-03-13 16:32:44 -0700
committerMathieu Chartier <mathieuc@google.com>2015-03-13 18:49:27 -0700
commit921d6eb3c4e12a2000fe490c4e58d0e6e0628b90 (patch)
treee93a9a3cf8274d69463b5fb3703040ae05285c30 /compiler/dex/quick/x86/call_x86.cc
parent97930feb1288f1b8ef08f11af5db9e0fe1e6bbe7 (diff)
downloadandroid_art-921d6eb3c4e12a2000fe490c4e58d0e6e0628b90.tar.gz
android_art-921d6eb3c4e12a2000fe490c4e58d0e6e0628b90.tar.bz2
android_art-921d6eb3c4e12a2000fe490c4e58d0e6e0628b90.zip
Fix 32 bit loads of 64 bit direct code pointers
Fixes 64 bit problems for JIT since the JIT code cache isn't always in the low 2GB. (cherry picked from commit 0d2ac187be10838c008e6aaa03e5e55014e9087e) Change-Id: Ifd37d6a86166a91be1b258da7329c888fd82e4b9
Diffstat (limited to 'compiler/dex/quick/x86/call_x86.cc')
-rw-r--r--compiler/dex/quick/x86/call_x86.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/dex/quick/x86/call_x86.cc b/compiler/dex/quick/x86/call_x86.cc
index c3db3a64e5..11c146549e 100644
--- a/compiler/dex/quick/x86/call_x86.cc
+++ b/compiler/dex/quick/x86/call_x86.cc
@@ -332,7 +332,12 @@ static int X86NextSDCallInsn(CompilationUnit* cu, CallInfo* info,
switch (state) {
case 0: // Get the current Method* [sets kArg0]
if (direct_method != static_cast<uintptr_t>(-1)) {
- cg->LoadConstant(cg->TargetReg(kArg0, kRef), direct_method);
+ auto target_reg = cg->TargetReg(kArg0, kRef);
+ if (target_reg.Is64Bit()) {
+ cg->LoadConstantWide(target_reg, direct_method);
+ } else {
+ cg->LoadConstant(target_reg, direct_method);
+ }
} else {
cg->LoadMethodAddress(target_method, type, kArg0);
}