| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 #include "src/compiler/graph-reducer.h" | 6 #include "src/compiler/graph-reducer.h" |
| 7 #include "src/compiler/js-operator.h" | 7 #include "src/compiler/js-operator.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 return Bounds(Type::None(zone()), Type::Boolean(zone())); | 589 return Bounds(Type::None(zone()), Type::Boolean(zone())); |
| 590 } | 590 } |
| 591 | 591 |
| 592 | 592 |
| 593 Bounds Typer::Visitor::TypeParameter(Node* node) { | 593 Bounds Typer::Visitor::TypeParameter(Node* node) { |
| 594 return Bounds::Unbounded(zone()); | 594 return Bounds::Unbounded(zone()); |
| 595 } | 595 } |
| 596 | 596 |
| 597 | 597 |
| 598 Bounds Typer::Visitor::TypeOsrValue(Node* node) { | 598 Bounds Typer::Visitor::TypeOsrValue(Node* node) { |
| 599 // OSR values explicitly have type {None} before OSR form is deconstructed. | |
| 600 if (node->InputAt(0)->opcode() == IrOpcode::kOsrLoopEntry) { | 599 if (node->InputAt(0)->opcode() == IrOpcode::kOsrLoopEntry) { |
| 600 // Before deconstruction, OSR values have type {None} to avoid polluting |
| 601 // the types of phis and other nodes in the graph. |
| 601 return Bounds(Type::None(), Type::None()); | 602 return Bounds(Type::None(), Type::None()); |
| 602 } | 603 } |
| 603 // TODO(turbofan): preserve the type of OSR values after deconstruction. | 604 if (NodeProperties::IsTyped(node)) { |
| 605 // After deconstruction, OSR values may have had a type explicitly set. |
| 606 return NodeProperties::GetBounds(node); |
| 607 } |
| 608 // Otherwise, be conservative. |
| 604 return Bounds::Unbounded(zone()); | 609 return Bounds::Unbounded(zone()); |
| 605 } | 610 } |
| 606 | 611 |
| 607 | 612 |
| 608 Bounds Typer::Visitor::TypeInt32Constant(Node* node) { | 613 Bounds Typer::Visitor::TypeInt32Constant(Node* node) { |
| 609 double number = OpParameter<int32_t>(node); | 614 double number = OpParameter<int32_t>(node); |
| 610 return Bounds(Type::Intersect( | 615 return Bounds(Type::Intersect( |
| 611 Type::Range(number, number, zone()), Type::UntaggedSigned32(), zone())); | 616 Type::Range(number, number, zone()), Type::UntaggedSigned32(), zone())); |
| 612 } | 617 } |
| 613 | 618 |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2142 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 2138 #undef TYPED_ARRAY_CASE | 2143 #undef TYPED_ARRAY_CASE |
| 2139 } | 2144 } |
| 2140 } | 2145 } |
| 2141 return Type::Constant(value, zone()); | 2146 return Type::Constant(value, zone()); |
| 2142 } | 2147 } |
| 2143 | 2148 |
| 2144 } // namespace compiler | 2149 } // namespace compiler |
| 2145 } // namespace internal | 2150 } // namespace internal |
| 2146 } // namespace v8 | 2151 } // namespace v8 |
| OLD | NEW |