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.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Node* ReduceUnop(const Operator* op, Type* input_type) { | 107 Node* ReduceUnop(const Operator* op, Type* input_type) { |
108 return reduce(Unop(op, Parameter(input_type))); | 108 return reduce(Unop(op, Parameter(input_type))); |
109 } | 109 } |
110 | 110 |
111 Node* ReduceBinop(const Operator* op, Type* left_type, Type* right_type) { | 111 Node* ReduceBinop(const Operator* op, Type* left_type, Type* right_type) { |
112 return reduce(Binop(op, Parameter(left_type, 0), Parameter(right_type, 1))); | 112 return reduce(Binop(op, Parameter(left_type, 0), Parameter(right_type, 1))); |
113 } | 113 } |
114 | 114 |
115 Node* Binop(const Operator* op, Node* left, Node* right) { | 115 Node* Binop(const Operator* op, Node* left, Node* right) { |
116 // JS binops also require context, effect, and control | 116 // JS binops also require context, effect, and control |
117 return graph.NewNode(op, left, right, context(), start(), control()); | 117 if (OperatorProperties::HasFrameStateInput(op)) { |
| 118 return graph.NewNode(op, left, right, context(), |
| 119 EmptyFrameState(context()), start(), control()); |
| 120 } else { |
| 121 return graph.NewNode(op, left, right, context(), start(), control()); |
| 122 } |
118 } | 123 } |
119 | 124 |
120 Node* Unop(const Operator* op, Node* input) { | 125 Node* Unop(const Operator* op, Node* input) { |
121 // JS unops also require context, effect, and control | 126 // JS unops also require context, effect, and control |
122 if (OperatorProperties::HasFrameStateInput(op)) { | 127 if (OperatorProperties::HasFrameStateInput(op)) { |
123 return graph.NewNode(op, input, context(), EmptyFrameState(context()), | 128 return graph.NewNode(op, input, context(), EmptyFrameState(context()), |
124 start(), control()); | 129 start(), control()); |
125 } else { | 130 } else { |
126 return graph.NewNode(op, input, context(), start(), control()); | 131 return graph.NewNode(op, input, context(), start(), control()); |
127 } | 132 } |
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 CHECK_EQ(p1, r->InputAt(0)); | 1282 CHECK_EQ(p1, r->InputAt(0)); |
1278 CHECK_EQ(p0, r->InputAt(1)); | 1283 CHECK_EQ(p0, r->InputAt(1)); |
1279 } else { | 1284 } else { |
1280 CHECK_EQ(p0, r->InputAt(0)); | 1285 CHECK_EQ(p0, r->InputAt(0)); |
1281 CHECK_EQ(p1, r->InputAt(1)); | 1286 CHECK_EQ(p1, r->InputAt(1)); |
1282 } | 1287 } |
1283 } | 1288 } |
1284 } | 1289 } |
1285 } | 1290 } |
1286 } | 1291 } |
OLD | NEW |