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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 node->ReplaceInput( | 1442 node->ReplaceInput( |
1443 0, jsgraph_->graph()->NewNode( | 1443 0, jsgraph_->graph()->NewNode( |
1444 lowering->machine()->Float64ExtractHighWord32(), | 1444 lowering->machine()->Float64ExtractHighWord32(), |
1445 node->InputAt(0))); | 1445 node->InputAt(0))); |
1446 node->AppendInput(jsgraph_->zone(), | 1446 node->AppendInput(jsgraph_->zone(), |
1447 jsgraph_->Int32Constant(kHoleNanUpper32)); | 1447 jsgraph_->Int32Constant(kHoleNanUpper32)); |
1448 NodeProperties::ChangeOp(node, jsgraph_->machine()->Word32Equal()); | 1448 NodeProperties::ChangeOp(node, jsgraph_->machine()->Word32Equal()); |
1449 } | 1449 } |
1450 return; | 1450 return; |
1451 } | 1451 } |
| 1452 case IrOpcode::kNumberConvertHoleNaN: { |
| 1453 if (truncation.TruncatesToFloat64()) { |
| 1454 // NumberConvertHoleNaN(x) => x |
| 1455 VisitUnop(node, UseInfo::TruncatingFloat64(), |
| 1456 MachineRepresentation::kFloat64); |
| 1457 if (lower()) DeferReplacement(node, node->InputAt(0)); |
| 1458 } else { |
| 1459 VisitUnop(node, UseInfo::TruncatingFloat64(), |
| 1460 MachineRepresentation::kTagged); |
| 1461 if (lower()) { |
| 1462 // NumberConvertHoleNaN(x) => |
| 1463 // Select(Word32Equal(Float64ExtractHighWord32(x), |
| 1464 // #HoleNanUpper32), |
| 1465 // #Undefined, |
| 1466 // ChangeFloat64ToTagged(x)) |
| 1467 Node* value = node->InputAt(0); |
| 1468 node->ReplaceInput( |
| 1469 0, |
| 1470 jsgraph_->graph()->NewNode( |
| 1471 jsgraph_->machine()->Word32Equal(), |
| 1472 jsgraph_->graph()->NewNode( |
| 1473 jsgraph_->machine()->Float64ExtractHighWord32(), value), |
| 1474 jsgraph_->Int32Constant(kHoleNanUpper32))); |
| 1475 node->AppendInput(jsgraph_->zone(), jsgraph_->UndefinedConstant()); |
| 1476 node->AppendInput( |
| 1477 jsgraph_->zone(), |
| 1478 jsgraph_->graph()->NewNode( |
| 1479 jsgraph_->simplified()->ChangeFloat64ToTagged(), value)); |
| 1480 NodeProperties::ChangeOp( |
| 1481 node, jsgraph_->common()->Select(MachineRepresentation::kTagged, |
| 1482 BranchHint::kFalse)); |
| 1483 } |
| 1484 } |
| 1485 return; |
| 1486 } |
1452 case IrOpcode::kReferenceEqual: { | 1487 case IrOpcode::kReferenceEqual: { |
1453 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); | 1488 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); |
1454 if (lower()) { | 1489 if (lower()) { |
1455 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); | 1490 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); |
1456 } | 1491 } |
1457 return; | 1492 return; |
1458 } | 1493 } |
1459 case IrOpcode::kStringEqual: { | 1494 case IrOpcode::kStringEqual: { |
1460 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 1495 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
1461 if (lower()) { | 1496 if (lower()) { |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2862 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 2897 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
2863 Operator::kNoProperties); | 2898 Operator::kNoProperties); |
2864 to_number_operator_.set(common()->Call(desc)); | 2899 to_number_operator_.set(common()->Call(desc)); |
2865 } | 2900 } |
2866 return to_number_operator_.get(); | 2901 return to_number_operator_.get(); |
2867 } | 2902 } |
2868 | 2903 |
2869 } // namespace compiler | 2904 } // namespace compiler |
2870 } // namespace internal | 2905 } // namespace internal |
2871 } // namespace v8 | 2906 } // namespace v8 |
OLD | NEW |