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

Unified Diff: lib/compiler/implementation/scanner/class_element_parser.dart

Issue 10855262: Make patching of classes lazy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/class_element_parser.dart
diff --git a/lib/compiler/implementation/scanner/class_element_parser.dart b/lib/compiler/implementation/scanner/class_element_parser.dart
index 02f6eaab530429b9ea26a40f8ea34c8083672ed1..4b9045c4b0b4632c73ade4086debb531ee423ac6 100644
--- a/lib/compiler/implementation/scanner/class_element_parser.dart
+++ b/lib/compiler/implementation/scanner/class_element_parser.dart
@@ -22,12 +22,20 @@ class PartialClassElement extends ClassElement {
ClassNode parseNode(DiagnosticListener diagnosticListener) {
if (cachedNode != null) return cachedNode;
+ // TODO(ahe): Measure these tasks.
MemberListener listener = new MemberListener(diagnosticListener, this);
Parser parser = new ClassElementParser(listener);
Token token = parser.parseTopLevelDeclaration(beginToken);
assert(token === endToken.next);
cachedNode = listener.popNode();
assert(listener.nodes.isEmpty());
+ if (isPatched) {
+ // TODO(lrn): Perhaps extract functionality so it doesn't need compiler.
+ Compiler compiler = diagnosticListener;
+ ClassNode patchNode = compiler.patchParser.parsePatchClassNode(patch);
+ Link<Element> patches = patch.localMembers;
+ compiler.applyContainerPatch(this, patches);
+ }
return cachedNode;
}
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698