OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../compiler.dart'; | 7 import '../compiler.dart'; |
8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
9 import '../diagnostics/invariant.dart'; | 9 import '../diagnostics/invariant.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 int argumentCount = invocation.arguments.positional.length + | 93 int argumentCount = invocation.arguments.positional.length + |
94 invocation.arguments.named.length; | 94 invocation.arguments.named.length; |
95 List<String> namedArguments = | 95 List<String> namedArguments = |
96 invocation.arguments.named.map((e) => e.name).toList(); | 96 invocation.arguments.named.map((e) => e.name).toList(); |
97 CallStructure callStructure = | 97 CallStructure callStructure = |
98 new CallStructure(argumentCount, namedArguments); | 98 new CallStructure(argumentCount, namedArguments); |
99 | 99 |
100 return new Selector(kind, name, callStructure); | 100 return new Selector(kind, name, callStructure); |
101 } | 101 } |
102 | 102 |
103 TypeMask typeOfInvocation(ir.MethodInvocation invocation) { | 103 TypeMask getTypeMask(ir.MethodInvocation invocation) { |
104 return _compiler.globalInference.results | 104 return _elements.getTypeMask(getNode(invocation)); |
105 .typeOfSend(getNode(invocation), _elements); | |
106 } | 105 } |
107 | 106 |
108 TypeMask selectorTypeOf(ir.MethodInvocation invocation) { | 107 TypeMask selectorTypeOf(ir.MethodInvocation invocation) { |
109 return TypeMaskFactory.inferredTypeForSelector( | 108 return TypeMaskFactory.inferredTypeForSelector( |
110 getSelector(invocation), typeOfInvocation(invocation), _compiler); | 109 getSelector(invocation), getTypeMask(invocation), _compiler); |
111 } | 110 } |
112 | 111 |
113 bool isIntercepted(ir.MethodInvocation invocation) { | 112 bool isIntercepted(ir.MethodInvocation invocation) { |
114 return _backend.isInterceptedSelector(getSelector(invocation)); | 113 return _backend.isInterceptedSelector(getSelector(invocation)); |
115 } | 114 } |
116 } | 115 } |
OLD | NEW |