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

Side by Side Diff: pkg/kernel/lib/transformations/closure/info.dart

Issue 2938773003: Add transformLibraries for closure conversion (Closed)
Patch Set: Merge-in lastest changes in master (f71e6fd49b) Created 3 years, 6 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 | « no previous file | pkg/kernel/lib/transformations/closure/mock.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) 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 library kernel.transformations.closure.info; 5 library kernel.transformations.closure.info;
6 6
7 import '../../ast.dart' 7 import '../../ast.dart'
8 show 8 show
9 Class, 9 Class,
10 Constructor, 10 Constructor,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 FunctionNode currentMemberFunction; 58 FunctionNode currentMemberFunction;
59 59
60 bool get isOuterMostContext { 60 bool get isOuterMostContext {
61 return currentFunction == null || currentMemberFunction == currentFunction; 61 return currentFunction == null || currentMemberFunction == currentFunction;
62 } 62 }
63 63
64 /// Maps the names of all instance methods that may be torn off (aka 64 /// Maps the names of all instance methods that may be torn off (aka
65 /// implicitly closurized) to `${name.name}#get`. 65 /// implicitly closurized) to `${name.name}#get`.
66 Map<Name, Name> get tearOffGetterNames { 66 Map<Name, Name> get tearOffGetterNames {
67 Map<Name, Name> result = <Name, Name>{}; 67 // TODO(dmitryas): Add support for tear-offs. When added, uncomment this.
68 for (Name name in declaredInstanceMethodNames) { 68 //
69 if (invokedGetters.contains(name)) { 69 // Map<Name, Name> result = <Name, Name>{};
70 result[name] = new Name("${name.name}#get", name.library); 70 // for (Name name in declaredInstanceMethodNames) {
71 } 71 // if (invokedGetters.contains(name)) {
72 } 72 // result[name] = new Name("${name.name}#get", name.library);
73 return result; 73 // }
74 // }
75 // return result;
76 //
77 // Currently an empty map is returned, so no tear-offs supporting functions
78 // and getters are generated, and no property-get targets are renamed.
79 return <Name, Name>{};
74 } 80 }
75 81
76 void beginMember(Member member, [FunctionNode function]) { 82 void beginMember(Member member, [FunctionNode function]) {
77 currentMemberLocalNames.clear(); 83 currentMemberLocalNames.clear();
78 if (function != null) { 84 if (function != null) {
79 localNames[function] = computeUniqueLocalName(member.name.name); 85 localNames[function] = computeUniqueLocalName(member.name.name);
80 } 86 }
81 currentMember = member; 87 currentMember = member;
82 currentMemberFunction = function; 88 currentMemberFunction = function;
83 } 89 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 thisAccess.putIfAbsent( 203 thisAccess.putIfAbsent(
198 currentMemberFunction, () => new VariableDeclaration("#self")); 204 currentMemberFunction, () => new VariableDeclaration("#self"));
199 } 205 }
200 } 206 }
201 207
202 visitPropertyGet(PropertyGet node) { 208 visitPropertyGet(PropertyGet node) {
203 invokedGetters.add(node.name); 209 invokedGetters.add(node.name);
204 super.visitPropertyGet(node); 210 super.visitPropertyGet(node);
205 } 211 }
206 } 212 }
OLDNEW
« no previous file with comments | « no previous file | pkg/kernel/lib/transformations/closure/mock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698