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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 26191002: Hook ByteArrayViewLoad operations into polymorphic inliner (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | runtime/vm/flow_graph_optimizer.h » ('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 dc22d62244e212c8b90ecb09a8a840a1d79b02db..eac4aa72caba511780dbc3af7b3201e139e59486 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -363,8 +363,8 @@ class PolymorphicInliner : public ValueObject {
bool CheckInlinedDuplicate(const Function& target);
bool CheckNonInlinedDuplicate(const Function& target);
- bool TryInlining(const Function& target);
- bool TryInlineRecognizedMethod(const Function& target);
+ bool TryInlining(intptr_t receiver_cid, const Function& target);
+ bool TryInlineRecognizedMethod(intptr_t receiver_cid, const Function& target);
TargetEntryInstr* BuildDecisionGraph();
@@ -1033,7 +1033,8 @@ PolymorphicInliner::PolymorphicInliner(CallSiteInliner* owner,
// * JoinEntry: the inlined body is shared and this is a subsequent variant.
bool PolymorphicInliner::CheckInlinedDuplicate(const Function& target) {
for (intptr_t i = 0; i < inlined_variants_.length(); ++i) {
- if (target.raw() == inlined_variants_[i].target->raw()) {
+ if ((target.raw() == inlined_variants_[i].target->raw()) &&
+ !MethodRecognizer::PolymorphicTarget(target)) {
// The call target is shared with a previous inlined variant. Share
// the graph. This requires a join block at the entry, and edge-split
// form requires a target for each branch.
@@ -1089,9 +1090,10 @@ bool PolymorphicInliner::CheckNonInlinedDuplicate(const Function& target) {
}
-bool PolymorphicInliner::TryInlining(const Function& target) {
+bool PolymorphicInliner::TryInlining(intptr_t receiver_cid,
+ const Function& target) {
if (!target.is_optimizable()) {
- if (TryInlineRecognizedMethod(target)) {
+ if (TryInlineRecognizedMethod(receiver_cid, target)) {
owner_->inlined_ = true;
return true;
}
@@ -1157,11 +1159,13 @@ static Instruction* AppendInstruction(Instruction* first,
}
-bool PolymorphicInliner::TryInlineRecognizedMethod(const Function& target) {
+bool PolymorphicInliner::TryInlineRecognizedMethod(intptr_t receiver_cid,
+ const Function& target) {
FlowGraphOptimizer optimizer(owner_->caller_graph());
TargetEntryInstr* entry;
Definition* last;
- if (optimizer.TryInlineRecognizedMethod(target,
+ if (optimizer.TryInlineRecognizedMethod(receiver_cid,
+ target,
call_,
call_->instance_call()->token_pos(),
*call_->instance_call()->ic_data(),
@@ -1412,6 +1416,7 @@ void PolymorphicInliner::Inline() {
FlowGraphCompiler::SortICDataByCount(call_->ic_data(), &variants_);
for (intptr_t var_idx = 0; var_idx < variants_.length(); ++var_idx) {
const Function& target = *variants_[var_idx].target;
+ const intptr_t receiver_cid = variants_[var_idx].cid;
// First check if this is the same target as an earlier inlined variant.
if (CheckInlinedDuplicate(target)) {
@@ -1428,7 +1433,7 @@ void PolymorphicInliner::Inline() {
}
// Make an inlining decision.
- if (TryInlining(target)) {
+ if (TryInlining(receiver_cid, target)) {
inlined_variants_.Add(variants_[var_idx]);
} else {
non_inlined_variants_.Add(variants_[var_idx]);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698