summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_mips.cc
diff options
context:
space:
mode:
authorAart Bik <ajcbik@google.com>2018-01-09 11:01:02 -0800
committerAart Bik <ajcbik@google.com>2018-01-16 09:44:28 -0800
commita8b8e9b12a9740d71cff2fa65d47825b74f72c37 (patch)
tree301275759cf145711175992a503fcc7d710c2d2f /compiler/optimizing/code_generator_mips.cc
parent6d4c343ee5db18f039aeb3e07ff8d3c1fd37c3a0 (diff)
Improve code sinking near "always throwing" method calls
Rationale: With simple dex bytecode analysis, the inliner marks methods that always throw to help subsequent code sinking. This reduces overhead of non-nullable enforcing calls found in e.g the Kotlin runtime library (1%-2% improvement on tree microbenchmark, about 5% on Denis' benchmark). Test: test-art-host test-art-target Change-Id: I45348f049721476828eb5443738021720d2857c0
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r--compiler/optimizing/code_generator_mips.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc
index c8bd5d4fc8..5c8e46ed19 100644
--- a/compiler/optimizing/code_generator_mips.cc
+++ b/compiler/optimizing/code_generator_mips.cc
@@ -4034,7 +4034,11 @@ void LocationsBuilderMIPS::VisitGoto(HGoto* got) {
}
void InstructionCodeGeneratorMIPS::HandleGoto(HInstruction* got, HBasicBlock* successor) {
- DCHECK(!successor->IsExitBlock());
+ if (successor->IsExitBlock()) {
+ DCHECK(got->GetPrevious()->AlwaysThrows());
+ return; // no code needed
+ }
+
HBasicBlock* block = got->GetBlock();
HInstruction* previous = got->GetPrevious();
HLoopInformation* info = block->GetLoopInformation();