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

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

Issue 2857943002: Implement KernelNoSuchMethodResolver. (Closed)
Patch Set: Updated cf. comments Created 3 years, 7 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
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 library dart2js.kernel.element_map; 5 library dart2js.kernel.element_map;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show Identifiers;
10 import '../common/resolution.dart'; 11 import '../common/resolution.dart';
11 import '../compile_time_constants.dart'; 12 import '../compile_time_constants.dart';
12 import '../constants/constant_system.dart'; 13 import '../constants/constant_system.dart';
13 import '../constants/constructors.dart'; 14 import '../constants/constructors.dart';
14 import '../constants/evaluation.dart'; 15 import '../constants/evaluation.dart';
15 import '../constants/expressions.dart'; 16 import '../constants/expressions.dart';
16 import '../constants/values.dart'; 17 import '../constants/values.dart';
17 import '../common_elements.dart'; 18 import '../common_elements.dart';
18 import '../elements/elements.dart'; 19 import '../elements/elements.dart';
19 import '../elements/entities.dart'; 20 import '../elements/entities.dart';
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 isStatic: isStatic, 305 isStatic: isStatic,
305 isExternal: isExternal, 306 isExternal: isExternal,
306 isAbstract: isAbstract); 307 isAbstract: isAbstract);
307 break; 308 break;
308 } 309 }
309 _memberList.add(new _FunctionData(node, node.function)); 310 _memberList.add(new _FunctionData(node, node.function));
310 return function; 311 return function;
311 }); 312 });
312 } 313 }
313 314
315 /// Returns the kernel [ir.Procedure] node for the [method].
316 ir.Procedure _lookupProcedure(KFunction method) {
317 return _memberList[method.memberIndex].node;
318 }
319
314 KField _getField(ir.Field node) { 320 KField _getField(ir.Field node) {
315 return _fieldMap.putIfAbsent(node, () { 321 return _fieldMap.putIfAbsent(node, () {
316 int memberIndex = _memberList.length; 322 int memberIndex = _memberList.length;
317 KLibrary library; 323 KLibrary library;
318 KClass enclosingClass; 324 KClass enclosingClass;
319 if (node.enclosingClass != null) { 325 if (node.enclosingClass != null) {
320 enclosingClass = _getClass(node.enclosingClass); 326 enclosingClass = _getClass(node.enclosingClass);
321 library = enclosingClass.library; 327 library = enclosingClass.library;
322 } else { 328 } else {
323 library = _getLibrary(node.enclosingLibrary); 329 library = _getLibrary(node.enclosingLibrary);
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 } 1299 }
1294 1300
1295 InterfaceType getMixinTypeForClass(KClass cls) { 1301 InterfaceType getMixinTypeForClass(KClass cls) {
1296 _KClassEnv env = builder._classEnvs[cls.classIndex]; 1302 _KClassEnv env = builder._classEnvs[cls.classIndex];
1297 ir.Supertype mixedInType = env.cls.mixedInType; 1303 ir.Supertype mixedInType = env.cls.mixedInType;
1298 if (mixedInType == null) return null; 1304 if (mixedInType == null) return null;
1299 return builder.createInterfaceType( 1305 return builder.createInterfaceType(
1300 mixedInType.classNode, mixedInType.typeArguments); 1306 mixedInType.classNode, mixedInType.typeArguments);
1301 } 1307 }
1302 } 1308 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | pkg/compiler/lib/src/kernel/no_such_method_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698