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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2127273002: VM: Move inlining of _bitAndFromSmi to the flow graph inliner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: correct condition Created 4 years, 5 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/jit_optimizer.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 f93b1d18e5ea752ea895ca86c4b4bb45a92265a0..994e13e9be089587db16bf6138847e1b723e1329 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -2460,6 +2460,29 @@ static bool InlineDoubleOp(FlowGraph* flow_graph,
}
+static bool InlineSmiBitAndFromSmi(FlowGraph* flow_graph,
+ Instruction* call,
+ TargetEntryInstr** entry,
+ Definition** last) {
+ Definition* left = call->ArgumentAt(0);
+ Definition* right = call->ArgumentAt(1);
+
+ *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
+ (*entry)->InheritDeoptTarget(Z, call);
+ // Right arguments is known to be smi: other._bitAndFromSmi(this);
+ BinarySmiOpInstr* smi_op =
+ new(Z) BinarySmiOpInstr(Token::kBIT_AND,
+ new(Z) Value(left),
+ new(Z) Value(right),
+ call->deopt_id());
+ flow_graph->AppendTo(*entry, smi_op, call->env(), FlowGraph::kValue);
+ *last = smi_op;
+
+ return true;
+}
+
+
static bool InlineGrowableArraySetter(FlowGraph* flow_graph,
intptr_t offset,
StoreBarrierType store_barrier_type,
@@ -3227,6 +3250,8 @@ bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph,
return InlineGrowableArraySetter(
flow_graph, GrowableObjectArray::length_offset(), kNoStoreBarrier,
call, entry, last);
+ case MethodRecognizer::kSmi_bitAndFromSmi:
+ return InlineSmiBitAndFromSmi(flow_graph, call, entry, last);
default:
return false;
}
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698