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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/js-typed-lowering.h" | 10 #include "src/compiler/js-typed-lowering.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (op->ControlInputCount() > 0) { | 150 if (op->ControlInputCount() > 0) { |
151 inputs.push_back(control()); | 151 inputs.push_back(control()); |
152 } | 152 } |
153 return graph.NewNode(op, static_cast<int>(inputs.size()), | 153 return graph.NewNode(op, static_cast<int>(inputs.size()), |
154 &(inputs.front())); | 154 &(inputs.front())); |
155 } | 155 } |
156 | 156 |
157 Node* Unop(const Operator* op, Node* input) { | 157 Node* Unop(const Operator* op, Node* input) { |
158 // JS unops also require context, effect, and control | 158 // JS unops also require context, effect, and control |
159 if (OperatorProperties::GetFrameStateInputCount(op) > 0) { | 159 if (OperatorProperties::GetFrameStateInputCount(op) > 0) { |
160 DCHECK(OperatorProperties::GetFrameStateInputCount(op) == 1); | 160 CHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(op)); |
161 return graph.NewNode(op, input, context(), EmptyFrameState(context()), | 161 return graph.NewNode(op, input, context(), EmptyFrameState(context()), |
162 start(), control()); | 162 start(), control()); |
163 } else { | 163 } else { |
164 return graph.NewNode(op, input, context(), start(), control()); | 164 return graph.NewNode(op, input, context(), start(), control()); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 Node* UseForEffect(Node* node) { | 168 Node* UseForEffect(Node* node) { |
169 // TODO(titzer): use EffectPhi after fixing EffectCount | 169 // TODO(titzer): use EffectPhi after fixing EffectCount |
170 if (OperatorProperties::GetFrameStateInputCount(javascript.ToNumber()) > | 170 if (OperatorProperties::GetFrameStateInputCount(javascript.ToNumber()) > |
171 0) { | 171 0) { |
172 DCHECK(OperatorProperties::GetFrameStateInputCount( | 172 CHECK_EQ(1, OperatorProperties::GetFrameStateInputCount( |
173 javascript.ToNumber()) == 1); | 173 javascript.ToNumber())); |
174 return graph.NewNode(javascript.ToNumber(), node, context(), | 174 return graph.NewNode(javascript.ToNumber(), node, context(), |
175 EmptyFrameState(context()), node, control()); | 175 EmptyFrameState(context()), node, control()); |
176 } else { | 176 } else { |
177 return graph.NewNode(javascript.ToNumber(), node, context(), node, | 177 return graph.NewNode(javascript.ToNumber(), node, context(), node, |
178 control()); | 178 control()); |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 void CheckEffectInput(Node* effect, Node* use) { | 182 void CheckEffectInput(Node* effect, Node* use) { |
183 CHECK_EQ(effect, NodeProperties::GetEffectInput(use)); | 183 CHECK_EQ(effect, NodeProperties::GetEffectInput(use)); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 726 |
727 Node* effect_use = NULL; | 727 Node* effect_use = NULL; |
728 for (int i = 0; i < 10; i++) { | 728 for (int i = 0; i < 10; i++) { |
729 Node* p0 = R.Parameter(Type::Number()); | 729 Node* p0 = R.Parameter(Type::Number()); |
730 Node* ton = R.Unop(R.javascript.ToNumber(), p0); | 730 Node* ton = R.Unop(R.javascript.ToNumber(), p0); |
731 Node* frame_state = R.EmptyFrameState(R.context()); | 731 Node* frame_state = R.EmptyFrameState(R.context()); |
732 effect_use = NULL; | 732 effect_use = NULL; |
733 | 733 |
734 switch (i) { | 734 switch (i) { |
735 case 0: | 735 case 0: |
736 DCHECK(OperatorProperties::GetFrameStateInputCount( | 736 CHECK_EQ(1, OperatorProperties::GetFrameStateInputCount( |
737 R.javascript.ToNumber()) == 1); | 737 R.javascript.ToNumber())); |
738 effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(), | 738 effect_use = R.graph.NewNode(R.javascript.ToNumber(), p0, R.context(), |
739 frame_state, ton, R.start()); | 739 frame_state, ton, R.start()); |
740 break; | 740 break; |
741 case 1: | 741 case 1: |
742 DCHECK(OperatorProperties::GetFrameStateInputCount( | 742 CHECK_EQ(1, OperatorProperties::GetFrameStateInputCount( |
743 R.javascript.ToNumber()) == 1); | 743 R.javascript.ToNumber())); |
744 effect_use = R.graph.NewNode(R.javascript.ToNumber(), ton, R.context(), | 744 effect_use = R.graph.NewNode(R.javascript.ToNumber(), ton, R.context(), |
745 frame_state, ton, R.start()); | 745 frame_state, ton, R.start()); |
746 break; | 746 break; |
747 case 2: | 747 case 2: |
748 effect_use = R.graph.NewNode(R.common.EffectPhi(1), ton, R.start()); | 748 effect_use = R.graph.NewNode(R.common.EffectPhi(1), ton, R.start()); |
749 case 3: | 749 case 3: |
750 effect_use = R.graph.NewNode(R.javascript.Add(language_mode, R.hints), | 750 effect_use = R.graph.NewNode(R.javascript.Add(language_mode, R.hints), |
751 ton, ton, R.context(), frame_state, | 751 ton, ton, R.context(), frame_state, |
752 frame_state, ton, R.start()); | 752 frame_state, ton, R.start()); |
753 break; | 753 break; |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 CHECK_EQ(p1, r->InputAt(1)); | 1279 CHECK_EQ(p1, r->InputAt(1)); |
1280 } | 1280 } |
1281 } | 1281 } |
1282 } | 1282 } |
1283 } | 1283 } |
1284 } | 1284 } |
1285 | 1285 |
1286 } // namespace compiler | 1286 } // namespace compiler |
1287 } // namespace internal | 1287 } // namespace internal |
1288 } // namespace v8 | 1288 } // namespace v8 |
OLD | NEW |