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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 691513002: [turbofan] Introduce new Select operator to improve bounds checking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/compiler/control-reducer.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index c16aa82bafaad8e3af459df12a8099a7d08a8b61..11979ec6edc9ea800980354a4ca70521fe7bddaa 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -64,6 +64,7 @@ Reduction JSGenericLowering::Reduce(Node* node) {
Lower##x(node); \
break;
DECLARE_CASE(Branch)
+ DECLARE_CASE(Select)
JS_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
default:
@@ -241,6 +242,23 @@ void JSGenericLowering::LowerBranch(Node* node) {
}
+void JSGenericLowering::LowerSelect(Node* node) {
+ // TODO(bmeurer): This should probably be moved into a separate file.
+ SelectParameters const& p = SelectParametersOf(node->op());
+ Node* branch = graph()->NewNode(common()->Branch(p.hint()), node->InputAt(0),
+ graph()->start());
+ Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
+ Node* vtrue = node->InputAt(1);
+ Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
+ Node* vfalse = node->InputAt(2);
+ Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
+ node->set_op(common()->Phi(p.type(), 2));
+ node->ReplaceInput(0, vtrue);
+ node->ReplaceInput(1, vfalse);
+ node->ReplaceInput(2, merge);
+}
+
+
void JSGenericLowering::LowerJSUnaryNot(Node* node) {
Callable callable = CodeFactory::ToBoolean(
isolate(), ToBooleanStub::RESULT_AS_INVERSE_ODDBALL);
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698