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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 256453004: Avoid inlining constants that are used via a deferred import. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 6 years, 7 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/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 786fc5fa56c5b7adca866dcd5084286e3b958b41..fcef11087ef166cf634fd3dad454dd22fc521211 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -2996,7 +2996,16 @@ class SsaBuilder extends ResolvedVisitor {
value = backend.constants.getConstantForVariable(element);
}
if (value != null) {
- HConstant instruction = graph.addConstant(value, compiler);
+ HConstant instruction;
+ // Constants that are referred via a deferred prefix should be referred
+ // by reference.
+ PrefixElement prefix = compiler.deferredLoadTask
+ .deferredPrefixElement(send, elements);
+ if (prefix != null) {
+ instruction = graph.addDeferredConstant(value, prefix, compiler);
+ } else {
+ instruction = graph.addConstant(value, compiler);
+ }
stack.add(instruction);
// The inferrer may have found a better type than the constant
// handler in the case of lists, because the constant handler

Powered by Google App Engine
This is Rietveld 408576698