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/graph-inl.h" | 6 #include "src/compiler/graph-inl.h" |
7 #include "src/compiler/js-builtin-reducer.h" | 7 #include "src/compiler/js-builtin-reducer.h" |
8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
9 #include "src/compiler/node-aux-data-inl.h" | 9 #include "src/compiler/node-aux-data-inl.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 NodeProperties::ReplaceWithValue(node, reduction.replacement()); | 605 NodeProperties::ReplaceWithValue(node, reduction.replacement()); |
606 return reduction; | 606 return reduction; |
607 } | 607 } |
608 return Reducer::NoChange(); | 608 return Reducer::NoChange(); |
609 } | 609 } |
610 | 610 |
611 | 611 |
612 Reduction JSTypedLowering::Reduce(Node* node) { | 612 Reduction JSTypedLowering::Reduce(Node* node) { |
613 // Check if the output type is a singleton. In that case we already know the | 613 // Check if the output type is a singleton. In that case we already know the |
614 // result value and can simply replace the node unless there are effects. | 614 // result value and can simply replace the node unless there are effects. |
615 if (node->bounds().upper->IsConstant() && | 615 if (NodeProperties::IsTyped(node) && |
| 616 NodeProperties::GetBounds(node).upper->IsConstant() && |
616 !IrOpcode::IsLeafOpcode(node->opcode()) && | 617 !IrOpcode::IsLeafOpcode(node->opcode()) && |
617 !OperatorProperties::HasEffectOutput(node->op())) { | 618 !OperatorProperties::HasEffectOutput(node->op())) { |
618 return ReplaceEagerly(node, jsgraph()->Constant( | 619 return ReplaceEagerly(node, jsgraph()->Constant( |
619 node->bounds().upper->AsConstant()->Value())); | 620 NodeProperties::GetBounds(node).upper->AsConstant()->Value())); |
620 // TODO(neis): Extend this to Range(x,x), NaN, MinusZero, ...? | 621 // TODO(neis): Extend this to Range(x,x), NaN, MinusZero, ...? |
621 } | 622 } |
622 switch (node->opcode()) { | 623 switch (node->opcode()) { |
623 case IrOpcode::kJSEqual: | 624 case IrOpcode::kJSEqual: |
624 return ReduceJSEqual(node, false); | 625 return ReduceJSEqual(node, false); |
625 case IrOpcode::kJSNotEqual: | 626 case IrOpcode::kJSNotEqual: |
626 return ReduceJSEqual(node, true); | 627 return ReduceJSEqual(node, true); |
627 case IrOpcode::kJSStrictEqual: | 628 case IrOpcode::kJSStrictEqual: |
628 return ReduceJSStrictEqual(node, false); | 629 return ReduceJSStrictEqual(node, false); |
629 case IrOpcode::kJSStrictNotEqual: | 630 case IrOpcode::kJSStrictNotEqual: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 return JSBuiltinReducer(jsgraph()).Reduce(node); | 692 return JSBuiltinReducer(jsgraph()).Reduce(node); |
692 default: | 693 default: |
693 break; | 694 break; |
694 } | 695 } |
695 return NoChange(); | 696 return NoChange(); |
696 } | 697 } |
697 | 698 |
698 } // namespace compiler | 699 } // namespace compiler |
699 } // namespace internal | 700 } // namespace internal |
700 } // namespace v8 | 701 } // namespace v8 |
OLD | NEW |