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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 1881013002: Expand ResolvedAst to handle synthetic constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + fix test, cps and compilation units for injected members. Created 4 years, 8 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: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 1b01849c9558a21ac442383036edcd05909a46f6..92e78a69e864bae5a75b7f80fd8a5e6be3573a78 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1063,7 +1063,7 @@ abstract class Compiler implements LibraryLoaderListener, IdGenerator {
return const WorldImpact();
}
WorldImpact worldImpact = analyzeElement(element);
- backend.onElementResolved(element, element.resolvedAst.elements);
+ backend.onElementResolved(element);
world.registerProcessedElement(element);
return worldImpact;
}
@@ -1895,6 +1895,8 @@ class _CompilerResolution implements Resolution {
@override
bool hasResolvedAst(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
return element is AstElement &&
hasBeenResolved(element) &&
element.hasResolvedAst;
@@ -1902,6 +1904,8 @@ class _CompilerResolution implements Resolution {
@override
ResolvedAst getResolvedAst(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
if (hasResolvedAst(element)) {
AstElement astElement = element;
return astElement.resolvedAst;
@@ -1911,14 +1915,17 @@ class _CompilerResolution implements Resolution {
return null;
}
-
@override
bool hasResolutionImpact(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
return _resolutionImpactCache.containsKey(element);
}
@override
ResolutionImpact getResolutionImpact(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
ResolutionImpact resolutionImpact = _resolutionImpactCache[element];
assert(invariant(element, resolutionImpact != null,
message: "ResolutionImpact not available for $element."));
@@ -1927,6 +1934,8 @@ class _CompilerResolution implements Resolution {
@override
WorldImpact getWorldImpact(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
WorldImpact worldImpact = _worldImpactCache[element];
assert(invariant(element, worldImpact != null,
message: "WorldImpact not computed for $element."));
@@ -1935,6 +1944,8 @@ class _CompilerResolution implements Resolution {
@override
WorldImpact computeWorldImpact(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
return _worldImpactCache.putIfAbsent(element, () {
assert(compiler.parser != null);
Node tree = compiler.parser.parse(element);
@@ -1963,6 +1974,8 @@ class _CompilerResolution implements Resolution {
@override
void uncacheWorldImpact(Element element) {
+ assert(invariant(element, element.isDeclaration,
+ message: "Element $element must be the declaration."));
if (retainCachesForTesting) return;
if (compiler.serialization.isDeserialized(element)) return;
assert(invariant(element, _worldImpactCache[element] != null,
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698