Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2329403003: More features handled in kernel impact. (Closed)
Patch Set: Fix analyze_test_test. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 94b9ad4caea10a0c166ec31a3df24caebb8fa2ad..583a67a015e0b7e3412011c7fad711751ec2647f 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -5,6 +5,7 @@
import 'package:kernel/ast.dart' as ir;
import '../common.dart';
+import '../common/names.dart';
import '../compiler.dart';
import '../constants/values.dart';
import '../dart_types.dart';
@@ -97,15 +98,25 @@ class KernelAstAdapter {
return new CallStructure(argumentCount, namedArguments);
}
+ Name getName(ir.Name name) {
+ return new Name(
+ name.name, name.isPrivate ? getElement(name.library) : null);
+ }
+
// TODO(het): Create the selector directly from the invocation
Selector getSelector(ir.MethodInvocation invocation) {
- SelectorKind kind = Elements.isOperatorName(invocation.name.name)
- ? SelectorKind.OPERATOR
- : SelectorKind.CALL;
+ Name name = getName(invocation.name);
+ SelectorKind kind;
+ if (Elements.isOperatorName(invocation.name.name)) {
+ if (name == Names.INDEX_NAME || name == Names.INDEX_SET_NAME) {
+ kind = SelectorKind.INDEX;
+ } else {
+ kind = SelectorKind.OPERATOR;
+ }
+ } else {
+ kind = SelectorKind.CALL;
+ }
- ir.Name irName = invocation.name;
- Name name = new Name(
- irName.name, irName.isPrivate ? getElement(irName.library) : null);
CallStructure callStructure = getCallStructure(invocation.arguments);
return new Selector(kind, name, callStructure);
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698