Chromium Code Reviews| Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| index 25632dbe81dcafb8e007316bd38b0eee8576e816..3e5635ae1858b5409349425bc1f9942be32a1673 100644 |
| --- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| +++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart |
| @@ -6,6 +6,8 @@ library compiler.src.inferrer.type_graph_nodes; |
| import 'dart:collection' show IterableBase; |
| +import 'package:kernel/ast.dart' as ir; |
| + |
| import '../common.dart'; |
| import '../common/names.dart' show Identifiers; |
| import '../constants/values.dart'; |
| @@ -382,12 +384,13 @@ abstract class MemberTypeInformation extends ElementTypeInformation |
| * to enable counting the global number of call sites of [element]. |
| * |
| * A call site is either an AST [ast.Node], an [Element] (see uses of |
| - * [synthesizeForwardingCall] in [SimpleTypeInferrerVisitor]). |
| + * [synthesizeForwardingCall] in [SimpleTypeInferrerVisitor]) or an IR |
| + * [ir.Node]. |
| * |
| * The global information is summarized in [cleanup], after which [_callers] |
| * is set to `null`. |
| */ |
| - Map<MemberEntity, Setlet<Spannable>> _callers; |
| + Map<MemberEntity, Setlet<Object>> _callers; |
| MemberTypeInformation._internal(this._member) : super._internal(null) { |
| assert(_checkMember(_member)); |
| @@ -401,12 +404,12 @@ abstract class MemberTypeInformation extends ElementTypeInformation |
| String get debugName => '$member'; |
| - void addCall(MemberEntity caller, Spannable node) { |
| - _callers ??= <MemberEntity, Setlet<Spannable>>{}; |
| + void addCall(MemberEntity caller, Object node) { |
| + _callers ??= <MemberEntity, Setlet<Object>>{}; |
| _callers.putIfAbsent(caller, () => new Setlet()).add(node); |
| } |
| - void removeCall(MemberEntity caller, node) { |
| + void removeCall(MemberEntity caller, Object node) { |
| if (_callers == null) return; |
| Setlet calls = _callers[caller]; |
| if (calls == null) return; |
| @@ -831,7 +834,7 @@ bool validCallType(CallType callType, Object call) { |
| case CallType.complex: |
|
Siggi Cherem (dart-lang)
2017/09/05 19:20:39
because of the desugaring, I'm guessing complex is
Johnni Winther
2017/09/07 08:08:52
Yes, I expect so.
|
| return call is ast.SendSet; |
| case CallType.access: |
| - return call is ast.Send; |
| + return call is ast.Send || call is ir.Node; |
| case CallType.forIn: |
| return call is ast.ForIn; |
| } |
| @@ -863,7 +866,8 @@ abstract class CallSiteTypeInformation extends TypeInformation |
| assert(_checkCaller(caller)); |
| // [_call] is either an AST node or a constructor element in case of a |
| // a forwarding constructor _call. |
| - assert(_call is ast.Node || _call is ConstructorElement); |
| + assert( |
| + _call is ast.Node || _call is ConstructorElement || _call is ir.Node); |
| } |
| bool _checkCaller(MemberEntity caller) { |