diff options
author | David Brazdil <dbrazdil@google.com> | 2015-02-02 18:58:27 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-02-02 19:02:47 +0000 |
commit | 2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308 (patch) | |
tree | 79bc01ffc77cec97eb4b785b8bde9aeb59ab24c7 /compiler/optimizing/builder.cc | |
parent | 852eaffe8e478186e134d88a02843a469118ef8c (diff) | |
download | android_art-2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308.tar.gz android_art-2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308.tar.bz2 android_art-2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308.zip |
Fix broken gtests after SuspendCheck optimization
Fixes hardcoded graph dumps in pretty printer tests and an assumption
that non-zero branch offset in dex implies presence of HInstructions.
Change-Id: Iee273c06b7b36410b4621107bef2f3592ece2f5b
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index eed56146e3..c50960666a 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -1077,11 +1077,10 @@ void HGraphBuilder::PotentiallyAddSuspendCheck(HBasicBlock* target, uint32_t dex if (target_offset <= 0) { // DX generates back edges to the first encountered return. We can save // time of later passes by not adding redundant suspend checks. - if (target_offset != 0) { - DCHECK(target->GetLastInstruction() != nullptr); - if (target->GetLastInstruction()->IsReturn()) { - return; - } + HInstruction* last_in_target = target->GetLastInstruction(); + if (last_in_target != nullptr && + (last_in_target->IsReturn() || last_in_target->IsReturnVoid())) { + return; } // Add a suspend check to backward branches which may potentially loop. We |