Chromium Code Reviews| Index: runtime/vm/flow_graph_inliner.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_inliner.cc (revision 42083) |
| +++ runtime/vm/flow_graph_inliner.cc (working copy) |
| @@ -591,15 +591,6 @@ |
| function.ToCString(), |
| function.deoptimization_counter())); |
| - // TODO(fschneider): Enable inlining inside try-blocks. |
| - if (call_data->call->GetBlock()->try_index() != |
| - CatchClauseNode::kInvalidTryIndex) { |
| - TRACE_INLINING(OS::Print(" Bailout: inside try-block\n")); |
| - PRINT_INLINING_TREE("Inside try-block", |
| - &call_data->caller, &function, call_data->call); |
| - return false; |
| - } |
| - |
| // Make a handle for the unoptimized code so that it is not disconnected |
| // from the function while we are trying to inline it. |
| const Code& unoptimized_code = Code::Handle(function.unoptimized_code()); |
| @@ -730,6 +721,16 @@ |
| ASSERT(arguments->length() == function.NumParameters()); |
| ASSERT(param_stubs->length() == callee_graph->parameter_count()); |
| + // Update try-index of the callee graph. |
| + if (call_data->call->GetBlock()->InsideTryBlock()) { |
| + intptr_t try_index = call_data->call->GetBlock()->try_index(); |
|
zerny-google
2014/12/03 13:22:27
Nit: cache the GetBlock call.
Florian Schneider
2014/12/03 13:45:43
Done.
|
| + for (BlockIterator it = callee_graph->reverse_postorder_iterator(); |
| + !it.Done(); it.Advance()) { |
| + BlockEntryInstr* block = it.Current(); |
| + block->set_try_index(try_index); |
| + } |
| + } |
| + |
| BlockScheduler block_scheduler(callee_graph); |
| block_scheduler.AssignEdgeWeights(); |