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/access-builder.h" | 5 #include "src/compiler/access-builder.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/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 return r.ChangeToPureOperator(simplified()->StringAdd()); | 337 return r.ChangeToPureOperator(simplified()->StringAdd()); |
338 } | 338 } |
339 #endif | 339 #endif |
340 return NoChange(); | 340 return NoChange(); |
341 } | 341 } |
342 | 342 |
343 | 343 |
344 Reduction JSTypedLowering::ReduceNumberBinop(Node* node, | 344 Reduction JSTypedLowering::ReduceNumberBinop(Node* node, |
345 const Operator* numberOp) { | 345 const Operator* numberOp) { |
346 JSBinopReduction r(this, node); | 346 JSBinopReduction r(this, node); |
| 347 if (is_strong(OpParameter<LanguageMode>(node))) { |
| 348 if (r.left_type()->Is(Type::Number()) && |
| 349 (r.right_type()->Is(Type::Number()))) { |
| 350 return r.ChangeToPureOperator(numberOp, Type::Number()); |
| 351 } |
| 352 return NoChange(); |
| 353 } |
347 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 354 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
348 r.ConvertInputsToNumber(frame_state); | 355 r.ConvertInputsToNumber(frame_state); |
349 return r.ChangeToPureOperator(numberOp, Type::Number()); | 356 return r.ChangeToPureOperator(numberOp, Type::Number()); |
350 } | 357 } |
351 | 358 |
352 | 359 |
353 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { | 360 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { |
354 JSBinopReduction r(this, node); | 361 JSBinopReduction r(this, node); |
355 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 362 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
356 r.ConvertInputsToNumber(frame_state); | 363 r.ConvertInputsToNumber(frame_state); |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 } | 1076 } |
1070 | 1077 |
1071 | 1078 |
1072 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1079 MachineOperatorBuilder* JSTypedLowering::machine() const { |
1073 return jsgraph()->machine(); | 1080 return jsgraph()->machine(); |
1074 } | 1081 } |
1075 | 1082 |
1076 } // namespace compiler | 1083 } // namespace compiler |
1077 } // namespace internal | 1084 } // namespace internal |
1078 } // namespace v8 | 1085 } // namespace v8 |
OLD | NEW |