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

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

Issue 10905305: Patch refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Replaced includeInjectedMembers by implementation Created 8 years, 3 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
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 2a7a0df55f57b35ee89db14945dd962833e78b2a..13495a2df44933a309f47041deb3cb46d79b5c35 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -313,13 +313,13 @@ class Compiler implements DiagnosticListener {
void enableIsolateSupport(LibraryElement element) {
// TODO(ahe): Move this method to Enqueuer.
- isolateLibrary = element;
- enqueuer.resolution.addToWorkList(element.find(START_ROOT_ISOLATE));
+ isolateLibrary = element.patch;
+ enqueuer.resolution.addToWorkList(isolateLibrary.find(START_ROOT_ISOLATE));
enqueuer.resolution.addToWorkList(
- element.find(const SourceString('_currentIsolate')));
+ isolateLibrary.find(const SourceString('_currentIsolate')));
enqueuer.resolution.addToWorkList(
- element.find(const SourceString('_callInIsolate')));
- enqueuer.codegen.addToWorkList(element.find(START_ROOT_ISOLATE));
+ isolateLibrary.find(const SourceString('_callInIsolate')));
+ enqueuer.codegen.addToWorkList(isolateLibrary.find(START_ROOT_ISOLATE));
}
bool hasIsolateSupport() => isolateLibrary !== null;
@@ -422,7 +422,6 @@ class Compiler implements DiagnosticListener {
internalError("Cannot patch non-existing member '"
"${patchElement.name.slowToString()}'.");
}
- original.addMember(clonePatch(patchElement, original), this);
} else {
patchMember(originalElement, patchElement);
}
@@ -497,6 +496,7 @@ class Compiler implements DiagnosticListener {
}
// Don't just assign the patch field. This also updates the cachedNode.
element.setPatch(patchElement);
+ patchElement.origin = element;
}
/**
@@ -862,14 +862,6 @@ class Compiler implements DiagnosticListener {
}
Token position = element.position();
Uri uri = element.getCompilationUnit().script.uri;
-
- // TODO(ager,johnniwinther): The patch support should be
- // reworked to allow us to get rid of this.
- if (element.isPatched) {
- position = element.patch.position();
- uri = element.patch.getCompilationUnit().script.uri;
- }
-
return (position === null)
? new SourceSpan(uri, 0, 0)
: spanFromTokens(position, position, uri);

Powered by Google App Engine
This is Rietveld 408576698