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 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2538 } | 2538 } |
2539 } else { | 2539 } else { |
2540 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 2540 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
2541 } | 2541 } |
2542 return; | 2542 return; |
2543 } | 2543 } |
2544 case IrOpcode::kObjectIsDetectableCallable: { | 2544 case IrOpcode::kObjectIsDetectableCallable: { |
2545 VisitObjectIs(node, Type::DetectableCallable(), lowering); | 2545 VisitObjectIs(node, Type::DetectableCallable(), lowering); |
2546 return; | 2546 return; |
2547 } | 2547 } |
2548 case IrOpcode::kObjectIsNaN: { | |
2549 Type* const input_type = TypeOf(node->InputAt(0)); | |
2550 if (input_type->Is(Type::NaN())) { | |
2551 VisitUnop(node, UseInfo::None(), MachineRepresentation::kBit); | |
Jarin
2017/02/27 15:15:49
Are you sure it is ok to change the use infos base
Benedikt Meurer
2017/03/03 08:42:15
Changed to GetUpperBound now, and added tests.
| |
2552 if (lower()) { | |
2553 DeferReplacement(node, lowering->jsgraph()->Int32Constant(1)); | |
2554 } | |
2555 } else if (!input_type->Maybe(Type::NaN())) { | |
2556 VisitUnop(node, UseInfo::Any(), MachineRepresentation::kBit); | |
2557 if (lower()) { | |
2558 DeferReplacement(node, lowering->jsgraph()->Int32Constant(0)); | |
2559 } | |
2560 } else if (input_type->Is(Type::Number())) { | |
2561 VisitUnop(node, UseInfo::TruncatingFloat64(), | |
2562 MachineRepresentation::kBit); | |
2563 if (lower()) { | |
2564 // ObjectIsNaN(x:kRepFloat64) => Word32Equal(Float64Equal(x,x),#0) | |
2565 Node* const input = node->InputAt(0); | |
2566 node->ReplaceInput( | |
2567 0, | |
2568 jsgraph_->graph()->NewNode(lowering->machine()->Float64Equal(), | |
2569 input, input)); | |
2570 node->AppendInput(jsgraph_->zone(), jsgraph_->Int32Constant(0)); | |
2571 NodeProperties::ChangeOp(node, lowering->machine()->Word32Equal()); | |
2572 } | |
2573 } else { | |
2574 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); | |
2575 } | |
2576 return; | |
2577 } | |
2548 case IrOpcode::kObjectIsNonCallable: { | 2578 case IrOpcode::kObjectIsNonCallable: { |
2549 VisitObjectIs(node, Type::NonCallable(), lowering); | 2579 VisitObjectIs(node, Type::NonCallable(), lowering); |
2550 return; | 2580 return; |
2551 } | 2581 } |
2552 case IrOpcode::kObjectIsNumber: { | 2582 case IrOpcode::kObjectIsNumber: { |
2553 VisitObjectIs(node, Type::Number(), lowering); | 2583 VisitObjectIs(node, Type::Number(), lowering); |
2554 return; | 2584 return; |
2555 } | 2585 } |
2556 case IrOpcode::kObjectIsReceiver: { | 2586 case IrOpcode::kObjectIsReceiver: { |
2557 VisitObjectIs(node, Type::Receiver(), lowering); | 2587 VisitObjectIs(node, Type::Receiver(), lowering); |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3532 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3562 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3533 Operator::kNoProperties); | 3563 Operator::kNoProperties); |
3534 to_number_operator_.set(common()->Call(desc)); | 3564 to_number_operator_.set(common()->Call(desc)); |
3535 } | 3565 } |
3536 return to_number_operator_.get(); | 3566 return to_number_operator_.get(); |
3537 } | 3567 } |
3538 | 3568 |
3539 } // namespace compiler | 3569 } // namespace compiler |
3540 } // namespace internal | 3570 } // namespace internal |
3541 } // namespace v8 | 3571 } // namespace v8 |
OLD | NEW |