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

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: Rebased Created 4 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
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 b3668c1287622b29ca54347879f56699d815f334..ea67b79ccd138eba4156679067aef7293e527f2b 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -180,12 +180,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;
}
@@ -348,7 +358,7 @@ class DeferredLoadTask extends CompilerTask {
treeElements.forEachConstantNode(
(ast.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);
}
@@ -926,7 +936,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:');
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/serialization/equivalence.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698