| Index: src/compiler/typer.cc
|
| diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
|
| index e9f3a3564ffd8da3e93b35b4eb8c644fb7baad32..24d02446e1131a869282b098f6cde6c71a6ac75e 100644
|
| --- a/src/compiler/typer.cc
|
| +++ b/src/compiler/typer.cc
|
| @@ -596,11 +596,16 @@ Bounds Typer::Visitor::TypeParameter(Node* node) {
|
|
|
|
|
| Bounds Typer::Visitor::TypeOsrValue(Node* node) {
|
| - // OSR values explicitly have type {None} before OSR form is deconstructed.
|
| if (node->InputAt(0)->opcode() == IrOpcode::kOsrLoopEntry) {
|
| + // Before deconstruction, OSR values have type {None} to avoid polluting
|
| + // the types of phis and other nodes in the graph.
|
| return Bounds(Type::None(), Type::None());
|
| }
|
| - // TODO(turbofan): preserve the type of OSR values after deconstruction.
|
| + if (NodeProperties::IsTyped(node)) {
|
| + // After deconstruction, OSR values may have had a type explicitly set.
|
| + return NodeProperties::GetBounds(node);
|
| + }
|
| + // Otherwise, be conservative.
|
| return Bounds::Unbounded(zone());
|
| }
|
|
|
|
|