summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-06-09 23:00:48 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-06-09 23:00:49 +0000
commit73d01bc3b227a2090be4b383c4731e1a520a282d (patch)
tree212f20bd769ad495cb15da9aa71426f0f2ab8f06 /compiler/optimizing/builder.cc
parentedc9ea1047a0e31fc55442c60871ebe1f7eb15f4 (diff)
parentda9badb9edea5e0d18cd9f97eff0d0937ad48310 (diff)
Merge "ART: Check long and double register pairs in invokes"
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r--compiler/optimizing/builder.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index cbd042901d..e4680ff2fa 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -748,13 +748,11 @@ bool HGraphBuilder::BuildInvoke(const Instruction& instruction,
for (size_t i = start_index; i < number_of_vreg_arguments; i++, argument_index++) {
Primitive::Type type = Primitive::GetType(descriptor[descriptor_index++]);
bool is_wide = (type == Primitive::kPrimLong) || (type == Primitive::kPrimDouble);
- if (!is_range && is_wide && args[i] + 1 != args[i + 1]) {
- LOG(WARNING) << "Non sequential register pair in " << dex_compilation_unit_->GetSymbol()
- << " at " << dex_pc;
- // We do not implement non sequential register pair.
- MaybeRecordStat(MethodCompilationStat::kNotCompiledNonSequentialRegPair);
- return false;
- }
+ // Longs and doubles should be in pairs, that is, sequential registers. The verifier should
+ // reject any class where this is violated.
+ DCHECK(is_range || !is_wide || (args[i] + 1 == args[i + 1]))
+ << "Non sequential register pair in " << dex_compilation_unit_->GetSymbol()
+ << " at " << dex_pc;
HInstruction* arg = LoadLocal(is_range ? register_index + i : args[i], type);
invoke->SetArgumentAt(argument_index, arg);
if (is_wide) {