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

Issue 10916228: Inline monomorphic calls. (Closed)

Created:
8 years, 3 months ago by Kevin Millikin (Google)
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Inline monomorphic calls. Also add inlining support for more instructions that can not deoptimize. Original changelist: http://codereview.chromium.org/10913010/ BUG= Committed: https://code.google.com/p/dart/source/detail?r=12244

Patch Set 1 #

Total comments: 19

Patch Set 2 : Incorporated review comments. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -116 lines) Patch
M runtime/vm/compiler.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph.h View 2 chunks +2 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph.cc View 1 3 chunks +10 lines, -12 lines 0 comments Download
M runtime/vm/flow_graph_builder.h View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 74 chunks +35 lines, -82 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 8 chunks +94 lines, -14 lines 4 comments Download
M runtime/vm/intermediate_language.h View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Kevin Millikin (Google)
Original change from Ian.
8 years, 3 months ago (2012-09-11 13:28:13 UTC) #1
Florian Schneider
https://chromiumcodereview.appspot.com/10916228/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://chromiumcodereview.appspot.com/10916228/diff/1/runtime/vm/flow_graph_builder.cc#newcode243 runtime/vm/flow_graph_builder.cc:243: InlineBailout("EffectGraphVisitor::BuildStoreLocal (deopt)"); Why this bailout? https://chromiumcodereview.appspot.com/10916228/diff/1/runtime/vm/flow_graph_builder.cc#newcode267 runtime/vm/flow_graph_builder.cc:267: InlineBailout("EffectGraphVisitor::BuildLoadLocal (deopt)"); ...
8 years, 3 months ago (2012-09-11 14:36:09 UTC) #2
Florian Schneider
Otherwise LGTM.
8 years, 3 months ago (2012-09-11 14:37:26 UTC) #3
srdjan
LGTM with comments http://codereview.chromium.org/10916228/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): http://codereview.chromium.org/10916228/diff/1/runtime/vm/flow_graph.cc#newcode782 runtime/vm/flow_graph.cc:782: if (callee_exits->length() == 0) { is_empty() ...
8 years, 3 months ago (2012-09-11 14:44:07 UTC) #4
Kevin Millikin (Google)
Incorporated comments, removed the unnecessary check. Please take another quick look. http://codereview.chromium.org/10916228/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): ...
8 years, 3 months ago (2012-09-11 16:29:20 UTC) #5
Florian Schneider
8 years, 3 months ago (2012-09-11 16:54:15 UTC) #6
lgtm

http://codereview.chromium.org/10916228/diff/4002/runtime/vm/flow_graph_inlin...
File runtime/vm/flow_graph_inliner.cc (right):

http://codereview.chromium.org/10916228/diff/4002/runtime/vm/flow_graph_inlin...
runtime/vm/flow_graph_inliner.cc:176: const ICData& ic_data = *call->ic_data();
This can be made even simpler for monomorphic calls:

void VisitPolymorphicInstanceCall(PolymorphicInstanceCallInstr* instr) {
  if (instr->with_checks()) {
    if (FLAG_trace_inlining) OS::Print("Inline aborted: multiple targets");
    return;
  }
  const ICData& ic_data = instr->ic_data();

http://codereview.chromium.org/10916228/diff/4002/runtime/vm/flow_graph_inlin...
runtime/vm/flow_graph_inliner.cc:184: if (ic_data.NumberOfChecks() != 1) {
I think this check is not necesary since we only generate a monomorphic
PolymorphicInstanceCall if the target is unique for all class ids.

http://codereview.chromium.org/10916228/diff/4002/runtime/vm/flow_graph_inlin...
runtime/vm/flow_graph_inliner.cc:191: ic_data.GetCheckAt(0, &class_ids,
&target);
const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));

http://codereview.chromium.org/10916228/diff/4002/runtime/vm/flow_graph_inlin...
runtime/vm/flow_graph_inliner.cc:193: if (class_id == kIllegalCid) {
Not sure if those can actually occur in type feedback:

I think you can just
ASSERT (class_id != kIllegalCid);
ASSERT (class_id != kSmiCid);
ASSERT (class_id != kDynamicCid);

Powered by Google App Engine
This is Rietveld 408576698