summaryrefslogtreecommitdiffstats
path: root/compiler/dex
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-02-04 09:45:14 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-04 09:45:14 +0000
commitf4b24f7ea507ff41db39154a1e6a681a582e224a (patch)
treeed70e8d35e91dd93d9dd5130ab88d6453dd4b6f3 /compiler/dex
parent6bc17805d2df2678de186e3b4c3e2f959a48555f (diff)
parent3e6a3bf797e49b7f449256455c7e522e888687d8 (diff)
downloadart-f4b24f7ea507ff41db39154a1e6a681a582e224a.zip
art-f4b24f7ea507ff41db39154a1e6a681a582e224a.tar.gz
art-f4b24f7ea507ff41db39154a1e6a681a582e224a.tar.bz2
Merge "ART: Change x86 long param ABI (Quick/JNI/Opt)"
Diffstat (limited to 'compiler/dex')
-rwxr-xr-xcompiler/dex/quick/x86/target_x86.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/dex/quick/x86/target_x86.cc b/compiler/dex/quick/x86/target_x86.cc
index 43ebf55..c4adb09 100755
--- a/compiler/dex/quick/x86/target_x86.cc
+++ b/compiler/dex/quick/x86/target_x86.cc
@@ -2469,11 +2469,17 @@ RegStorage X86Mir2Lir::InToRegStorageX86Mapper::GetNextReg(ShortyArg arg) {
return m2l_->TargetReg(fpArgMappingToPhysicalReg[cur_fp_reg_++],
arg.IsWide() ? kWide : kNotWide);
}
- } else {
- if (cur_core_reg_ < coreArgMappingToPhysicalRegSize) {
- result = m2l_->TargetReg(coreArgMappingToPhysicalReg[cur_core_reg_++],
- arg.IsRef() ? kRef : kNotWide);
- if (arg.IsWide() && cur_core_reg_ < coreArgMappingToPhysicalRegSize) {
+ } else if (cur_core_reg_ < coreArgMappingToPhysicalRegSize) {
+ result = m2l_->TargetReg(coreArgMappingToPhysicalReg[cur_core_reg_++],
+ arg.IsRef() ? kRef : kNotWide);
+ if (arg.IsWide()) {
+ // This must be a long, as double is handled above.
+ // Ensure that we don't split a long across the last register and the stack.
+ if (cur_core_reg_ == coreArgMappingToPhysicalRegSize) {
+ // Leave the last core register unused and force the whole long to the stack.
+ cur_core_reg_++;
+ result = RegStorage::InvalidReg();
+ } else if (cur_core_reg_ < coreArgMappingToPhysicalRegSize) {
result = RegStorage::MakeRegPair(
result, m2l_->TargetReg(coreArgMappingToPhysicalReg[cur_core_reg_++], kNotWide));
}