| Index: runtime/vm/flow_graph.cc
|
| diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
|
| index f513b304c012f92220fa118ad8641bb91b59e133..e2f8e825d21a3edd51fe5fbd8a849a5d8fdee077 100644
|
| --- a/runtime/vm/flow_graph.cc
|
| +++ b/runtime/vm/flow_graph.cc
|
| @@ -2014,7 +2014,10 @@ void FlowGraph::EliminateEnvironments() {
|
| }
|
| for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
|
| Instruction* current = it.Current();
|
| - if (!current->CanDeoptimize()) {
|
| + if (!current->CanDeoptimize() &&
|
| + (!current->MayThrow() || !current->GetBlock()->InsideTryBlock())) {
|
| + // Instructions that can throw need an environment for optimized
|
| + // try-catch.
|
| // TODO(srdjan): --source-lines needs deopt environments to get at
|
| // the code for this instruction, however, leaving the environment
|
| // changes code.
|
|
|