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

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

Issue 2978263003: Add nonboxed closure class fields. (Closed)
Patch Set: . Created 3 years, 5 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/js_model/closure_visitors.dart ('k') | no next file » | 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 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/names.dart' show Identifiers;
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 ..isMixinApplication = false 680 ..isMixinApplication = false
681 ..thisType = 681 ..thisType =
682 closureData.rawType = new InterfaceType(cls, const/*<DartType>*/ []) 682 closureData.rawType = new InterfaceType(cls, const/*<DartType>*/ [])
683 ..supertype = supertype 683 ..supertype = supertype
684 ..interfaces = const <InterfaceType>[]; 684 ..interfaces = const <InterfaceType>[];
685 var setBuilder = 685 var setBuilder =
686 new _KernelOrderedTypeSetBuilder((this as KernelToElementMapBase), cls); 686 new _KernelOrderedTypeSetBuilder((this as KernelToElementMapBase), cls);
687 _classData.add(closureData); 687 _classData.add(closureData);
688 closureData.orderedTypeSet = setBuilder.createOrderedTypeSet( 688 closureData.orderedTypeSet = setBuilder.createOrderedTypeSet(
689 closureData.supertype, const Link<InterfaceType>()); 689 closureData.supertype, const Link<InterfaceType>());
690
691 cls.forEachCapturedVariable((Local local, JField field) {
692 field.setClosureMemberIndex = _memberData.length;
693 // TODO(efortuna): Uncomment this line after Johnni's added in his CL
694 // about Class/MemberDefinition.
695 //_memberData.add(field);
696 });
690 // TODO(efortuna): Does getMetadata get called in ClassData for this object? 697 // TODO(efortuna): Does getMetadata get called in ClassData for this object?
691 } 698 }
692 699
693 ClassEntity _getClass(ir.Class node, [ClassEnv classEnv]) { 700 ClassEntity _getClass(ir.Class node, [ClassEnv classEnv]) {
694 return _classMap.putIfAbsent(node, () { 701 return _classMap.putIfAbsent(node, () {
695 KLibrary library = _getLibrary(node.enclosingLibrary); 702 KLibrary library = _getLibrary(node.enclosingLibrary);
696 if (classEnv == null) { 703 if (classEnv == null) {
697 classEnv = _libraryEnvs[library.libraryIndex].lookupClass(node.name); 704 classEnv = _libraryEnvs[library.libraryIndex].lookupClass(node.name);
698 } 705 }
699 _classEnvs.add(classEnv); 706 _classEnvs.add(classEnv);
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 if (data.constructorBody != null) { 2013 if (data.constructorBody != null) {
2007 f(data.constructorBody); 2014 f(data.constructorBody);
2008 } 2015 }
2009 }); 2016 });
2010 } 2017 }
2011 2018
2012 String getDeferredUri(ir.LibraryDependency node) { 2019 String getDeferredUri(ir.LibraryDependency node) {
2013 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); 2020 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri');
2014 } 2021 }
2015 } 2022 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure_visitors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698