Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2877713003: Eliminated with_checks variable (Closed)
Patch Set: Removed TODO Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 95e634b1a1815002f21702aa1889bdf8a54acbf0..e60ec2b687cf956f4395cb08a1f896b6337aba94 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -297,14 +297,8 @@ class CallSites : public ValueObject {
GrowableArray<intptr_t> static_call_counts(num_static_calls);
for (intptr_t i = 0; i < num_static_calls; ++i) {
- intptr_t aggregate_count = 0;
- if (static_calls_[i + static_call_start_ix].call->ic_data() == NULL) {
- aggregate_count = 0;
- } else {
- aggregate_count = static_calls_[i + static_call_start_ix]
- .call->ic_data()
- ->AggregateCount();
- }
+ intptr_t aggregate_count =
+ static_calls_[i + static_call_start_ix].call->CallCount();
static_call_counts.Add(aggregate_count);
if (aggregate_count > max_count) max_count = aggregate_count;
}
@@ -1287,46 +1281,18 @@ class CallSiteInliner : public ValueObject {
call_info.length()));
for (intptr_t call_idx = 0; call_idx < call_info.length(); ++call_idx) {
PolymorphicInstanceCallInstr* call = call_info[call_idx].call;
- if (call->with_checks()) {
- // PolymorphicInliner introduces deoptimization paths.
- if (!call->complete() && !FLAG_polymorphic_with_deopt) {
- TRACE_INLINING(
- THR_Print(" => %s\n Bailout: call with checks\n",
- call->instance_call()->function_name().ToCString()));
- continue;
- }
- const Function& cl = call_info[call_idx].caller();
- intptr_t caller_inlining_id =
- call_info[call_idx].caller_graph->inlining_id();
- PolymorphicInliner inliner(this, call, cl, caller_inlining_id);
- inliner.Inline();
+ // PolymorphicInliner introduces deoptimization paths.
+ if (!call->complete() && !FLAG_polymorphic_with_deopt) {
+ TRACE_INLINING(
+ THR_Print(" => %s\n Bailout: call with checks\n",
+ call->instance_call()->function_name().ToCString()));
continue;
}
-
- const Function& target = call->targets().MostPopularTarget();
- if (!inliner_->AlwaysInline(target) &&
- (call_info[call_idx].ratio * 100) < FLAG_inlining_hotness) {
- if (trace_inlining()) {
- String& name = String::Handle(target.QualifiedUserVisibleName());
- THR_Print(" => %s (deopt count %d)\n Bailout: cold %f\n",
- name.ToCString(), target.deoptimization_counter(),
- call_info[call_idx].ratio);
- }
- PRINT_INLINING_TREE("Too cold", &call_info[call_idx].caller(), &target,
- call);
- continue;
- }
- GrowableArray<Value*> arguments(call->ArgumentCount());
- for (int arg_i = 0; arg_i < call->ArgumentCount(); ++arg_i) {
- arguments.Add(call->PushArgumentAt(arg_i)->value());
- }
- InlinedCallData call_data(
- call, &arguments, call_info[call_idx].caller(),
- call_info[call_idx].caller_graph->inlining_id());
- if (TryInlining(target, call->instance_call()->argument_names(),
- &call_data)) {
- InlineCall(&call_data);
- }
+ const Function& cl = call_info[call_idx].caller();
+ intptr_t caller_inlining_id =
+ call_info[call_idx].caller_graph->inlining_id();
+ PolymorphicInliner inliner(this, call, cl, caller_inlining_id);
+ inliner.Inline();
}
}
@@ -1892,8 +1858,7 @@ TargetEntryInstr* PolymorphicInliner::BuildDecisionGraph() {
}
PolymorphicInstanceCallInstr* fallback_call =
new PolymorphicInstanceCallInstr(
- call_->instance_call(), *non_inlined_variants_,
- /* with_checks = */ true, call_->complete());
+ call_->instance_call(), *non_inlined_variants_, call_->complete());
fallback_call->set_ssa_temp_index(
owner_->caller_graph()->alloc_ssa_temp_index());
fallback_call->InheritDeoptTarget(zone(), call_);
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698