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

Side by Side Diff: pkg/kernel/lib/binary/limited_ast_to_binary.dart

Issue 2965503005: [kernel] Fix front_end after previous commit (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 | « no previous file | 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 import 'package:kernel/ast.dart'; 5 import 'package:kernel/ast.dart';
6 import 'package:kernel/binary/ast_to_binary.dart'; 6 import 'package:kernel/binary/ast_to_binary.dart';
7 7
8 /// Writes libraries that satisfy the [predicate]. 8 /// Writes libraries that satisfy the [predicate].
9 /// 9 ///
10 /// Only the referenced subset of canonical names is indexed and written, 10 /// Only the referenced subset of canonical names is indexed and written,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void writeLibraries(Program program) { 55 void writeLibraries(Program program) {
56 var librariesToWrite = program.libraries.where(predicate).toList(); 56 var librariesToWrite = program.libraries.where(predicate).toList();
57 writeList(librariesToWrite, writeNode); 57 writeList(librariesToWrite, writeNode);
58 } 58 }
59 59
60 @override 60 @override
61 void writeNode(Node node) { 61 void writeNode(Node node) {
62 if (node is Library && !predicate(node)) return; 62 if (node is Library && !predicate(node)) return;
63 node.accept(this); 63 node.accept(this);
64 } 64 }
65
66 @override
67 void writeProgramIndex(Program program, List<Library> libraries) {
68 var librariesToWrite = libraries.where(predicate).toList();
69 super.writeProgramIndex(program, librariesToWrite);
70 }
65 } 71 }
66 72
67 /// Extension of [StringIndexer] that also indexes canonical names of 73 /// Extension of [StringIndexer] that also indexes canonical names of
68 /// referenced classes and members. 74 /// referenced classes and members.
69 class ReferencesStringIndexer extends StringIndexer { 75 class ReferencesStringIndexer extends StringIndexer {
70 final List<CanonicalName> referencedNames = <CanonicalName>[]; 76 final List<CanonicalName> referencedNames = <CanonicalName>[];
71 77
72 @override 78 @override
73 defaultMemberReference(Member node) { 79 defaultMemberReference(Member node) {
74 _handleReferencedName(node.canonicalName); 80 _handleReferencedName(node.canonicalName);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 122 }
117 123
118 void _handleReferencedName(CanonicalName name) { 124 void _handleReferencedName(CanonicalName name) {
119 if (name == null || name.parent == null) return; 125 if (name == null || name.parent == null) return;
120 _handleReferencedName(name.parent); 126 _handleReferencedName(name.parent);
121 referencedNames.add(name); 127 referencedNames.add(name);
122 name.index = -1; 128 name.index = -1;
123 put(name.name); 129 put(name.name);
124 } 130 }
125 } 131 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698