OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/graph-inl.h" | 5 #include "src/compiler/graph-inl.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/js-typed-lowering.h" | 7 #include "src/compiler/js-typed-lowering.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return reduce(Binop(op, Parameter(left_type, 0), Parameter(right_type, 1))); | 111 return reduce(Binop(op, Parameter(left_type, 0), Parameter(right_type, 1))); |
112 } | 112 } |
113 | 113 |
114 Node* Binop(const Operator* op, Node* left, Node* right) { | 114 Node* Binop(const Operator* op, Node* left, Node* right) { |
115 // JS binops also require context, effect, and control | 115 // JS binops also require context, effect, and control |
116 return graph.NewNode(op, left, right, context(), start(), control()); | 116 return graph.NewNode(op, left, right, context(), start(), control()); |
117 } | 117 } |
118 | 118 |
119 Node* Unop(const Operator* op, Node* input) { | 119 Node* Unop(const Operator* op, Node* input) { |
120 // JS unops also require context, effect, and control | 120 // JS unops also require context, effect, and control |
121 return graph.NewNode(op, input, context(), start(), control()); | 121 if (OperatorProperties::HasFrameStateInput(op)) { |
| 122 return graph.NewNode(op, input, context(), EmptyFrameState(context()), |
| 123 start(), control()); |
| 124 } else { |
| 125 return graph.NewNode(op, input, context(), start(), control()); |
| 126 } |
122 } | 127 } |
123 | 128 |
124 Node* UseForEffect(Node* node) { | 129 Node* UseForEffect(Node* node) { |
125 // TODO(titzer): use EffectPhi after fixing EffectCount | 130 // TODO(titzer): use EffectPhi after fixing EffectCount |
126 if (OperatorProperties::HasFrameStateInput(javascript.ToNumber())) { | 131 if (OperatorProperties::HasFrameStateInput(javascript.ToNumber())) { |
127 return graph.NewNode(javascript.ToNumber(), node, context(), | 132 return graph.NewNode(javascript.ToNumber(), node, context(), |
128 EmptyFrameState(context()), node, control()); | 133 EmptyFrameState(context()), node, control()); |
129 } else { | 134 } else { |
130 return graph.NewNode(javascript.ToNumber(), node, context(), node, | 135 return graph.NewNode(javascript.ToNumber(), node, context(), node, |
131 control()); | 136 control()); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 CHECK_EQ(p1, r->InputAt(0)); | 1280 CHECK_EQ(p1, r->InputAt(0)); |
1276 CHECK_EQ(p0, r->InputAt(1)); | 1281 CHECK_EQ(p0, r->InputAt(1)); |
1277 } else { | 1282 } else { |
1278 CHECK_EQ(p0, r->InputAt(0)); | 1283 CHECK_EQ(p0, r->InputAt(0)); |
1279 CHECK_EQ(p1, r->InputAt(1)); | 1284 CHECK_EQ(p1, r->InputAt(1)); |
1280 } | 1285 } |
1281 } | 1286 } |
1282 } | 1287 } |
1283 } | 1288 } |
1284 } | 1289 } |
OLD | NEW |