diff options
author | 2015-09-14 21:26:33 +0000 | |
---|---|---|
committer | 2015-09-14 21:26:33 +0000 | |
commit | 659562aaf133c41b8d90ec9216c07646f0f14362 (patch) | |
tree | be1beae390262bf2f5a17bfa44de93081a849d07 /compiler/optimizing/optimizing_compiler.cc | |
parent | b022fa1300e6d78639b3b910af0cf85c43df44bb (diff) |
Revert "ART: Register allocation and runtime support for try/catch"
Breaks libcore test org.apache.harmony.security.tests.java.security.KeyStorePrivateKeyEntryTest#testGetCertificateChain. Need to investigate.
This reverts commit b022fa1300e6d78639b3b910af0cf85c43df44bb.
Change-Id: Ib24d3a80064d963d273e557a93469c95f37b1f6f
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 0099b21343..f549ba8391 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -485,43 +485,34 @@ static void RunOptimizations(HGraph* graph, RunOptimizations(optimizations1, arraysize(optimizations1), pass_observer); - // TODO: Update passes incompatible with try/catch so we have the same - // pipeline for all methods. if (graph->HasTryCatch()) { - HOptimization* optimizations2[] = { - side_effects, - gvn, - dce2, - // The codegen has a few assumptions that only the instruction simplifier - // can satisfy. For example, the code generator does not expect to see a - // HTypeConversion from a type to the same type. - simplify4, - }; - - RunOptimizations(optimizations2, arraysize(optimizations2), pass_observer); - } else { - MaybeRunInliner(graph, driver, stats, dex_compilation_unit, pass_observer, handles); - - HOptimization* optimizations2[] = { - // BooleanSimplifier depends on the InstructionSimplifier removing - // redundant suspend checks to recognize empty blocks. - boolean_simplify, - fold2, // TODO: if we don't inline we can also skip fold2. - side_effects, - gvn, - licm, - bce, - simplify3, - dce2, - // The codegen has a few assumptions that only the instruction simplifier - // can satisfy. For example, the code generator does not expect to see a - // HTypeConversion from a type to the same type. - simplify4, - }; - - RunOptimizations(optimizations2, arraysize(optimizations2), pass_observer); + // TODO: Update the optimizations below to work correctly under try/catch + // semantics. The optimizations above suffice for running codegen + // in the meanwhile. + return; } + MaybeRunInliner(graph, driver, stats, dex_compilation_unit, pass_observer, handles); + + HOptimization* optimizations2[] = { + // BooleanSimplifier depends on the InstructionSimplifier removing redundant + // suspend checks to recognize empty blocks. + boolean_simplify, + fold2, // TODO: if we don't inline we can also skip fold2. + side_effects, + gvn, + licm, + bce, + simplify3, + dce2, + // The codegen has a few assumptions that only the instruction simplifier can + // satisfy. For example, the code generator does not expect to see a + // HTypeConversion from a type to the same type. + simplify4, + }; + + RunOptimizations(optimizations2, arraysize(optimizations2), pass_observer); + RunArchOptimizations(driver->GetInstructionSet(), graph, stats, pass_observer); } @@ -575,6 +566,11 @@ CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph, RunOptimizations(graph, compiler_driver, compilation_stats_.get(), dex_compilation_unit, pass_observer, &handles); + if (graph->HasTryCatch()) { + soa.Self()->TransitionFromSuspendedToRunnable(); + return nullptr; + } + AllocateRegisters(graph, codegen, pass_observer); ArenaAllocator* arena = graph->GetArena(); |