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

Side by Side Diff: test/unittests/compiler/control-flow-optimizer-unittest.cc

Issue 1106613003: [turbofan] Unify frame state inputs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/compiler/pipeline.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/control-flow-optimizer.h" 5 #include "src/compiler/control-flow-optimizer.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-operator.h" 7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "test/unittests/compiler/graph-unittest.h" 9 #include "test/unittests/compiler/graph-unittest.h"
10 #include "test/unittests/compiler/node-test-utils.h" 10 #include "test/unittests/compiler/node-test-utils.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 IsEnd(IsMerge(IsIfValue(0, CaptureEq(&switch_capture)), 69 IsEnd(IsMerge(IsIfValue(0, CaptureEq(&switch_capture)),
70 IsIfValue(1, CaptureEq(&switch_capture)), 70 IsIfValue(1, CaptureEq(&switch_capture)),
71 IsIfDefault(AllOf(CaptureEq(&switch_capture), 71 IsIfDefault(AllOf(CaptureEq(&switch_capture),
72 IsSwitch(index, start())))))); 72 IsSwitch(index, start()))))));
73 } 73 }
74 74
75 75
76 TEST_F(ControlFlowOptimizerTest, BuildSwitch2) { 76 TEST_F(ControlFlowOptimizerTest, BuildSwitch2) {
77 Node* input = Parameter(0); 77 Node* input = Parameter(0);
78 Node* context = Parameter(1); 78 Node* context = Parameter(1);
79 Node* index = FLAG_turbo_deoptimization 79 Node* index = graph()->NewNode(javascript()->ToNumber(), input, context,
80 ? graph()->NewNode(javascript()->ToNumber(), input, context, 80 EmptyFrameState(), start(), start());
81 EmptyFrameState(), start(), start())
82 : graph()->NewNode(javascript()->ToNumber(), input, context,
83 start(), start());
84 Node* if_success = graph()->NewNode(common()->IfSuccess(), index); 81 Node* if_success = graph()->NewNode(common()->IfSuccess(), index);
85 Node* branch0 = graph()->NewNode( 82 Node* branch0 = graph()->NewNode(
86 common()->Branch(), 83 common()->Branch(),
87 graph()->NewNode(machine()->Word32Equal(), index, Int32Constant(0)), 84 graph()->NewNode(machine()->Word32Equal(), index, Int32Constant(0)),
88 if_success); 85 if_success);
89 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); 86 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
90 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); 87 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
91 Node* branch1 = graph()->NewNode( 88 Node* branch1 = graph()->NewNode(
92 common()->Branch(), 89 common()->Branch(),
93 graph()->NewNode(machine()->Word32Equal(), index, Int32Constant(1)), 90 graph()->NewNode(machine()->Word32Equal(), index, Int32Constant(1)),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 IsIfTrue(CaptureEq(&branch2_capture))), 128 IsIfTrue(CaptureEq(&branch2_capture))),
132 IsMerge(IsIfFalse(AllOf(CaptureEq(&branch1_capture), 129 IsMerge(IsIfFalse(AllOf(CaptureEq(&branch1_capture),
133 IsBranch(cond1, control1))), 130 IsBranch(cond1, control1))),
134 IsIfFalse(AllOf(CaptureEq(&branch2_capture), 131 IsIfFalse(AllOf(CaptureEq(&branch2_capture),
135 IsBranch(cond2, control2))))))); 132 IsBranch(cond2, control2)))))));
136 } 133 }
137 134
138 } // namespace compiler 135 } // namespace compiler
139 } // namespace internal 136 } // namespace internal
140 } // namespace v8 137 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698