Chromium Code Reviews| Index: runtime/vm/flow_graph_inliner.cc |
| diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc |
| index b42bba53d3ccab8bd7dc7569574db7ba23ee2b94..037d20a4cd385b863e3760c2a5e1c6427d3d66f4 100644 |
| --- a/runtime/vm/flow_graph_inliner.cc |
| +++ b/runtime/vm/flow_graph_inliner.cc |
| @@ -829,7 +829,8 @@ class CallSiteInliner : public ValueObject { |
| // Deopt-ids overlap between caller and callee. |
| if (FLAG_precompiled_mode) { |
| #ifdef DART_PRECOMPILER |
| - AotOptimizer optimizer(callee_graph, |
| + AotOptimizer optimizer(inliner_->precompiler_, |
| + callee_graph, |
| inliner_->use_speculative_inlining_, |
| inliner_->inlining_black_list_); |
| optimizer.PopulateWithICData(); |
| @@ -1878,14 +1879,16 @@ FlowGraphInliner::FlowGraphInliner( |
| GrowableArray<TokenPosition>* inline_id_to_token_pos, |
| GrowableArray<intptr_t>* caller_inline_id, |
| bool use_speculative_inlining, |
| - GrowableArray<intptr_t>* inlining_black_list) |
| + GrowableArray<intptr_t>* inlining_black_list, |
| + Precompiler* precompiler) |
| : flow_graph_(flow_graph), |
| inline_id_to_function_(inline_id_to_function), |
| inline_id_to_token_pos_(inline_id_to_token_pos), |
| caller_inline_id_(caller_inline_id), |
| trace_inlining_(ShouldTraceInlining(flow_graph)), |
| use_speculative_inlining_(use_speculative_inlining), |
| - inlining_black_list_(inlining_black_list) { |
| + inlining_black_list_(inlining_black_list), |
| + precompiler_(precompiler) { |
| ASSERT(!use_speculative_inlining || (inlining_black_list != NULL)); |
| } |
| @@ -3758,6 +3761,36 @@ bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph, |
| return false; |
| } |
| + case MethodRecognizer::kObjectRuntimeType: { |
| + Type& type = Type::Handle(Z); |
| + if (RawObject::IsStringClassId(receiver_cid)) { |
| + type = Type::StringType(); |
| + } else if (receiver_cid == kDoubleCid) { |
| + type = Type::Double(); |
| + } else if (RawObject::IsIntegerClassId(receiver_cid)) { |
| + type = Type::IntType(); |
| + } else if (receiver_cid != kClosureCid) { |
| + const Class& cls = Class::Handle(Z, |
| + flow_graph->isolate()->class_table()->At(receiver_cid)); |
| + if (!cls.IsGeneric()) { |
| + type = cls.CanonicalType(); |
| + } |
| + } |
| + |
| + if (!type.IsNull()) { |
| + *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(), |
| + call->GetBlock()->try_index()); |
| + (*entry)->InheritDeoptTarget(Z, call); |
| + *last = new(Z) ConstantInstr(type); |
| + flow_graph->AppendTo(*entry, *last, |
| + call->deopt_id() != Thread::kNoDeoptId ? |
|
Florian Schneider
2016/10/06 18:03:19
Can call ever have Thread::kNoDeoptId?
Vyacheslav Egorov (Google)
2016/10/24 20:23:03
That's an interesting question. In JIT it should n
|
| + call->env() : NULL, |
| + FlowGraph::kValue); |
| + return true; |
| + } |
| + return false; |
| + } |
| + |
| case MethodRecognizer::kOneByteStringSetAt: { |
| // This is an internal method, no need to check argument types nor |
| // range. |