| Index: src/compiler/typer.cc
|
| diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
|
| index f960153be3c02a61efa0e8b44c9057d3a8cb55ef..e80abdb3a36bb45e8e81609f741b0e8f73f579ac 100644
|
| --- a/src/compiler/typer.cc
|
| +++ b/src/compiler/typer.cc
|
| @@ -164,9 +164,11 @@ class Typer::Decorator final : public GraphDecorator {
|
| };
|
|
|
|
|
| -Typer::Typer(Isolate* isolate, Graph* graph, MaybeHandle<Context> context)
|
| +Typer::Typer(Isolate* isolate, Graph* graph, Type::FunctionType* function_type,
|
| + MaybeHandle<Context> context)
|
| : isolate_(isolate),
|
| graph_(graph),
|
| + function_type_(function_type),
|
| context_(context),
|
| decorator_(NULL),
|
| cache_(new (graph->zone()) LazyTypeCache(isolate, graph->zone())) {
|
| @@ -641,6 +643,12 @@ Bounds Typer::Visitor::TypeIfException(Node* node) {
|
|
|
|
|
| Bounds Typer::Visitor::TypeParameter(Node* node) {
|
| + int param = OpParameter<int>(node);
|
| + Type::FunctionType* function_type = typer_->function_type();
|
| + if (function_type != nullptr && param >= 0 &&
|
| + param < static_cast<int>(function_type->Arity())) {
|
| + return Bounds(Type::None(), function_type->Parameter(param));
|
| + }
|
| return Bounds::Unbounded(zone());
|
| }
|
|
|
|
|