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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2433813002: Reland "Add DoubleTestOp instruction" (Closed)
Patch Set: Created 4 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 | « runtime/vm/constants_dbc.h ('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 726f6e82a4a43642376c9f9a7d76d1fa636250c6..05f6579c70831abdd3c1831d916fb192056b578f 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -2402,6 +2402,34 @@ static bool InlineDoubleOp(FlowGraph* flow_graph,
}
+static bool InlineDoubleTestOp(FlowGraph* flow_graph,
+ Instruction* call,
+ MethodRecognizer::Kind kind,
+ TargetEntryInstr** entry,
+ Definition** last) {
+ if (!CanUnboxDouble()) {
+ return false;
+ }
+ Definition* d = call->ArgumentAt(0);
+
+ *entry = new(Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
+ (*entry)->InheritDeoptTarget(Z, call);
+ // Arguments are checked. No need for class check.
+
+ DoubleTestOpInstr* double_test_op =
+ new(Z) DoubleTestOpInstr(kind,
+ new(Z) Value(d),
+ call->deopt_id(),
+ call->token_pos());
+ flow_graph->AppendTo(
+ *entry, double_test_op, call->env(), FlowGraph::kValue);
+ *last = double_test_op;
+
+ return true;
+}
+
+
static bool InlineSmiBitAndFromSmi(FlowGraph* flow_graph,
Instruction* call,
TargetEntryInstr** entry,
@@ -3649,6 +3677,9 @@ bool FlowGraphInliner::TryInlineRecognizedMethod(FlowGraph* flow_graph,
return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last);
case MethodRecognizer::kDoubleDiv:
return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last);
+ case MethodRecognizer::kDouble_getIsNaN:
+ case MethodRecognizer::kDouble_getIsInfinite:
+ return InlineDoubleTestOp(flow_graph, call, kind, entry, last);
case MethodRecognizer::kGrowableArraySetData:
ASSERT(receiver_cid == kGrowableObjectArrayCid);
ASSERT(ic_data.NumberOfChecks() == 1);
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698