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

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

Issue 2961563003: Hopefully the last bit of restructuring between closture classes and loop boxing, etc. (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
OLDNEW
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 '../closure.dart'; 7 import '../closure.dart';
8 import '../common/tasks.dart'; 8 import '../common/tasks.dart';
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../world.dart'; 10 import '../world.dart';
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 /// combined here currently to provide a consistent interface to the rest of 86 /// combined here currently to provide a consistent interface to the rest of
87 /// the compiler until we are ready to separate these phases. 87 /// the compiler until we are ready to separate these phases.
88 @override 88 @override
89 void convertClosures(Iterable<MemberEntity> processedEntities, 89 void convertClosures(Iterable<MemberEntity> processedEntities,
90 ClosedWorldRefiner closedWorldRefiner) { 90 ClosedWorldRefiner closedWorldRefiner) {
91 // TODO(efortuna): implement. 91 // TODO(efortuna): implement.
92 } 92 }
93 93
94 /// TODO(johnniwinther,efortuna): Implement this. 94 /// TODO(johnniwinther,efortuna): Implement this.
95 @override 95 @override
96 ClosureAnalysisInfo getClosureAnalysisInfo(ir.Node node) { 96 ClosureBase getClosureBase(ir.Node node) {
97 return const ClosureAnalysisInfo(); 97 return const ClosureBase();
98 } 98 }
99 99
100 @override 100 @override
101 ScopeInfo getScopeInfo(Entity entity) { 101 ScopeInfo getScopeInfo(Entity entity) {
102 // TODO(efortuna): Specialize this function from the one below. 102 // TODO(efortuna): Specialize this function from the one below.
103 return getClosureRepresentationInfo(entity); 103 return getClosureRepresentationInfo(entity);
104 } 104 }
105 105
106 /// TODO(johnniwinther,efortuna): Implement this. 106 /// TODO(johnniwinther,efortuna): Implement this.
107 @override 107 @override
108 LoopClosureRepresentationInfo getClosureRepresentationInfoForLoop( 108 ClosureBase getClosureRepresentationInfoForLoop(ir.Node loopNode) {
109 ir.Node loopNode) { 109 return const ClosureBase();
110 return const LoopClosureRepresentationInfo();
111 } 110 }
112 111
113 @override 112 @override
114 ClosureRepresentationInfo getClosureRepresentationInfo(Entity entity) { 113 ClosureRepresentationInfo getClosureRepresentationInfo(Entity entity) {
115 return _infoMap.putIfAbsent(entity, () { 114 return _infoMap.putIfAbsent(entity, () {
116 if (entity is MemberEntity) { 115 if (entity is MemberEntity) {
117 ir.Member node = _elementMap.getMemberNode(entity); 116 ir.Member node = _elementMap.getMemberNode(entity);
118 ThisLocal thisLocal; 117 ThisLocal thisLocal;
119 if (entity.isInstanceMember) { 118 if (entity.isInstanceMember) {
120 thisLocal = new ThisLocal(entity); 119 thisLocal = new ThisLocal(entity);
(...skipping 25 matching lines...) Expand all
146 bool variableIsUsedInTryOrSync(Local variable) => 145 bool variableIsUsedInTryOrSync(Local variable) =>
147 _localsUsedInTryOrSync.contains(variable); 146 _localsUsedInTryOrSync.contains(variable);
148 147
149 String toString() { 148 String toString() {
150 StringBuffer sb = new StringBuffer(); 149 StringBuffer sb = new StringBuffer();
151 sb.write('this=$thisLocal,'); 150 sb.write('this=$thisLocal,');
152 sb.write('localsUsedInTryOrSync={${_localsUsedInTryOrSync.join(', ')}}'); 151 sb.write('localsUsedInTryOrSync={${_localsUsedInTryOrSync.join(', ')}}');
153 return sb.toString(); 152 return sb.toString();
154 } 153 }
155 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698