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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 r.ConvertInputsToString(); | 336 r.ConvertInputsToString(); |
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 if (is_strong(OpParameter<LanguageMode>(node))) { | |
347 return ReduceStrongNumberBinop(node, numberOp); | |
rossberg
2015/04/23 13:29:37
I'd just inline the function.
Michael Starzinger
2015/04/23 13:47:52
+1
conradw
2015/04/23 14:51:54
Done.
| |
348 } | |
346 JSBinopReduction r(this, node); | 349 JSBinopReduction r(this, node); |
347 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 350 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
348 r.ConvertInputsToNumber(frame_state); | 351 r.ConvertInputsToNumber(frame_state); |
349 return r.ChangeToPureOperator(numberOp, Type::Number()); | 352 return r.ChangeToPureOperator(numberOp, Type::Number()); |
350 } | 353 } |
351 | 354 |
355 Reduction JSTypedLowering::ReduceStrongNumberBinop(Node* node, | |
356 const Operator* numberOp) { | |
357 JSBinopReduction r(this, node); | |
358 if (r.left_type()->Is(Type::Number()) && | |
359 (r.right_type()->Is(Type::Number()))) { | |
360 return r.ChangeToPureOperator(numberOp, Type::Number()); | |
361 } | |
362 return NoChange(); | |
363 } | |
364 | |
352 | 365 |
353 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { | 366 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { |
354 JSBinopReduction r(this, node); | 367 JSBinopReduction r(this, node); |
355 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 368 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
356 r.ConvertInputsToNumber(frame_state); | 369 r.ConvertInputsToNumber(frame_state); |
357 r.ConvertInputsToUI32(kSigned, kSigned); | 370 r.ConvertInputsToUI32(kSigned, kSigned); |
358 return r.ChangeToPureOperator(intOp, Type::Integral32()); | 371 return r.ChangeToPureOperator(intOp, Type::Integral32()); |
359 } | 372 } |
360 | 373 |
361 | 374 |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1069 } | 1082 } |
1070 | 1083 |
1071 | 1084 |
1072 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1085 MachineOperatorBuilder* JSTypedLowering::machine() const { |
1073 return jsgraph()->machine(); | 1086 return jsgraph()->machine(); |
1074 } | 1087 } |
1075 | 1088 |
1076 } // namespace compiler | 1089 } // namespace compiler |
1077 } // namespace internal | 1090 } // namespace internal |
1078 } // namespace v8 | 1091 } // namespace v8 |
OLD | NEW |