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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_adapter.dart

Issue 2666553002: Add KernelWorldBuilder and KElement model. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/kernel/elements.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart'; 8 import '../common/names.dart';
9 import '../core_types.dart'; 9 import '../core_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 List<String> namedArguments = arguments.named.map((e) => e.name).toList(); 133 List<String> namedArguments = arguments.named.map((e) => e.name).toList();
134 return new CallStructure(argumentCount, namedArguments); 134 return new CallStructure(argumentCount, namedArguments);
135 } 135 }
136 136
137 @override 137 @override
138 Selector getSelector(ir.Expression node) { 138 Selector getSelector(ir.Expression node) {
139 if (node is ir.PropertyGet) return getGetterSelector(node); 139 if (node is ir.PropertyGet) return getGetterSelector(node);
140 if (node is ir.PropertySet) return getSetterSelector(node); 140 if (node is ir.PropertySet) return getSetterSelector(node);
141 if (node is ir.InvocationExpression) return getInvocationSelector(node); 141 if (node is ir.InvocationExpression) return getInvocationSelector(node);
142 throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE, 142 throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE,
143 "Can only get the selector for a property get or an invocation: ${node}" ); 143 "Can only get the selector for a property get or an invocation: "
144 "${node}");
144 } 145 }
145 146
146 Selector getInvocationSelector(ir.InvocationExpression invocation) { 147 Selector getInvocationSelector(ir.InvocationExpression invocation) {
147 Name name = getName(invocation.name); 148 Name name = getName(invocation.name);
148 SelectorKind kind; 149 SelectorKind kind;
149 if (Elements.isOperatorName(invocation.name.name)) { 150 if (Elements.isOperatorName(invocation.name.name)) {
150 if (name == Names.INDEX_NAME || name == Names.INDEX_SET_NAME) { 151 if (name == Names.INDEX_NAME || name == Names.INDEX_SET_NAME) {
151 kind = SelectorKind.INDEX; 152 kind = SelectorKind.INDEX;
152 } else { 153 } else {
153 kind = SelectorKind.OPERATOR; 154 kind = SelectorKind.OPERATOR;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 String visitStringConcatenation(ir.StringConcatenation node) { 368 String visitStringConcatenation(ir.StringConcatenation node) {
368 StringBuffer sb = new StringBuffer(); 369 StringBuffer sb = new StringBuffer();
369 for (ir.Expression expression in node.expressions) { 370 for (ir.Expression expression in node.expressions) {
370 String value = expression.accept(this); 371 String value = expression.accept(this);
371 if (value == null) return null; 372 if (value == null) return null;
372 sb.write(value); 373 sb.write(value);
373 } 374 }
374 return sb.toString(); 375 return sb.toString();
375 } 376 }
376 } 377 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/kernel/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698