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

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

Issue 2194173002: Include constants in deferred computation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index b45d301226f580f996426d25a8b5fe5148c3078f..00d26365a2be87f557b595a821161e8f95053656 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -182,12 +182,22 @@ class DeferredLoadTask extends CompilerTask {
return _elementToOutputUnit[element];
}
+ /// Direct access to the output-unit to element relation used for testing.
+ OutputUnit getOutputUnitForElementForTesting(Element element) {
+ return _elementToOutputUnit[element];
+ }
+
/// Returns the [OutputUnit] where [constant] belongs.
OutputUnit outputUnitForConstant(ConstantValue constant) {
if (!isProgramSplit) return mainOutputUnit;
return _constantToOutputUnit[constant];
}
+ /// Direct access to the output-unit to constants map used for testing.
+ Map<ConstantValue, OutputUnit> get outputUnitForConstantsForTesting {
+ return _constantToOutputUnit;
+ }
+
bool isDeferred(Element element) {
return outputUnitForElement(element) != mainOutputUnit;
}
@@ -350,7 +360,7 @@ class DeferredLoadTask extends CompilerTask {
treeElements
.forEachConstantNode((Node node, ConstantExpression expression) {
if (compiler.serialization.isDeserialized(analyzableElement)) {
- if (!expression.isImplicit && !expression.isPotential) {
+ if (!expression.isPotential) {
// Enforce evaluation of [expression].
backend.constants.getConstantValue(expression);
}
@@ -928,7 +938,8 @@ class DeferredLoadTask extends CompilerTask {
StringBuffer sb = new StringBuffer();
for (OutputUnit outputUnit in allOutputUnits) {
- sb.write(outputUnit.name);
+ sb.write('\n-------------------------------\n');
+ sb.write('Output unit: ${outputUnit.name}');
List<String> elements = elementMap[outputUnit];
if (elements != null) {
sb.write('\n elements:');

Powered by Google App Engine
This is Rietveld 408576698