summaryrefslogtreecommitdiffstats
path: root/compiler/jni
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-01-08 14:52:29 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-01-12 14:08:55 +0000
commit425f239c291d435f519a1cf4bdd9ccc9a2c0c070 (patch)
tree6c4ec2cef8fd0caf45712191bcbc5d72ed0d318b /compiler/jni
parent11adb76fbc2dc3d8cbb6665945ff5d6733e2a8e6 (diff)
downloadandroid_art-425f239c291d435f519a1cf4bdd9ccc9a2c0c070.tar.gz
android_art-425f239c291d435f519a1cf4bdd9ccc9a2c0c070.tar.bz2
android_art-425f239c291d435f519a1cf4bdd9ccc9a2c0c070.zip
Fix handling of long argument spanning register/memory.
Comment in arm_lir.h says: * If a 64-bit argument would span the register/memory argument * boundary, it will instead be fully passed in the frame. This change implements such logic for all platforms. We still need to pass the low part in register as well because I haven't ported the jni compilers (x86 and mips) to it. Once the jni compilers are updated, we can remove the register assignment. Note that this greatly simplifies optimizing's register allocator by not having to understand a long spanning register and memory. Change-Id: I59706ca5d47269fc46e5489ac99bd6576e87e7f3
Diffstat (limited to 'compiler/jni')
-rw-r--r--compiler/jni/quick/arm/calling_convention_arm.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/jni/quick/arm/calling_convention_arm.cc b/compiler/jni/quick/arm/calling_convention_arm.cc
index a3323e133a..fd207150f7 100644
--- a/compiler/jni/quick/arm/calling_convention_arm.cc
+++ b/compiler/jni/quick/arm/calling_convention_arm.cc
@@ -168,9 +168,13 @@ const ManagedRegisterEntrySpills& ArmManagedRuntimeCallingConvention::EntrySpill
} else {
// FIXME: Pointer this returns as both reference and long.
if (IsCurrentParamALong() && !IsCurrentParamAReference()) { // Long.
- if (gpr_index < arraysize(kHFCoreArgumentRegisters)) {
+ // If it spans register and memory, we must use the value in memory.
+ if (gpr_index < arraysize(kHFCoreArgumentRegisters) - 1) {
entry_spills_.push_back(
ArmManagedRegister::FromCoreRegister(kHFCoreArgumentRegisters[gpr_index++]));
+ } else if (gpr_index == arraysize(kHFCoreArgumentRegisters) - 1) {
+ gpr_index++;
+ entry_spills_.push_back(ManagedRegister::NoRegister(), 4);
} else {
entry_spills_.push_back(ManagedRegister::NoRegister(), 4);
}