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

Unified Diff: sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 221873002: Compute frontend/backend specific constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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: sdk/lib/_internal/compiler/implementation/deferred_load.dart
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index 298c7204bec55f56319c2b2e547f2051b9386842..939506ce3f25f8ba19d30ce4ca882c9d486746b9 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -292,7 +292,11 @@ class DeferredLoadTask extends CompilerTask {
if (dependency.isStatement()) continue;
elementDependencies.add(dependency);
}
- constantDependencies.addAll(elements.allConstants);
+ elements.forEachConstantNode((Node n, _) {
+ // Explicitly depend on the backend constants.
+ constantDependencies.add(
+ compiler.backend.constantHandler.getConstantForNode(n, elements));
floitsch 2014/04/02 16:50:02 Introduce backend getter in this class?
Johnni Winther 2014/04/07 11:42:27 Done.
+ });
elementDependencies.addAll(elements.otherDependencies);
}
@@ -305,9 +309,11 @@ class DeferredLoadTask extends CompilerTask {
Set<Constant> constants) {
element = element.implementation;
for (MetadataAnnotation metadata in element.metadata) {
- if (metadata.value != null) {
- constants.add(metadata.value);
- elements.add(metadata.value.computeType(compiler).element);
+ Constant constant =
+ compiler.backend.constantHandler.getConstantForMetadata(metadata);
+ if (constant != null) {
+ constants.add(constant);
+ elements.add(constant.computeType(compiler).element);
}
}
if (element.isClass()) {
@@ -419,15 +425,19 @@ class DeferredLoadTask extends CompilerTask {
// TODO(sigurdm): The metadata should go to the right output unit.
// For now they all go to the main output unit.
for (MetadataAnnotation metadata in library.metadata) {
- if (metadata.value != null) {
- _mapDependencies(metadata.value.computeType(compiler).element,
+ Constant constant =
+ compiler.backend.constantHandler.getConstantForMetadata(metadata);
+ if (constant != null) {
+ _mapDependencies(constant.computeType(compiler).element,
_fakeMainImport);
}
}
for (LibraryTag tag in library.tags) {
for (MetadataAnnotation metadata in tag.metadata) {
- if (metadata.value != null) {
- _mapDependencies(metadata.value.computeType(compiler).element,
+ Constant constant = compiler.backend.constantHandler
+ .getConstantForMetadata(metadata);
+ if (constant != null) {
+ _mapDependencies(constant.computeType(compiler).element,
_fakeMainImport);
}
}
@@ -576,8 +586,7 @@ class DeferredLoadTask extends CompilerTask {
for (MetadataAnnotation metadata in metadatas) {
metadata.ensureResolved(compiler);
Element element = metadata.value.computeType(compiler).element;
- if (metadata.value.computeType(compiler).element ==
- deferredLibraryClass) {
+ if (element == deferredLibraryClass) {
ConstructedConstant constant = metadata.value;
StringConstant s = constant.fields[0];
result = s.value.slowToString();

Powered by Google App Engine
This is Rietveld 408576698