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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.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/value_range_analyzer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
index f8dcf42c09fe92fafc134aed095959b6c5cd3339..f58002930542c2b2d5ecb7d53e5696386a7f60cf 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
@@ -670,9 +670,15 @@ class SsaValueRangeAnalyzer extends HBaseVisitor implements OptimizationPhase {
return range;
}
- Range visitConstant(HConstant constant) {
- if (!constant.isInteger(compiler)) return info.newUnboundRange();
- NumConstant constantNum = constant.constant;
+ Range visitConstant(HConstant hConstant) {
+ if (!hConstant.isInteger(compiler)) return info.newUnboundRange();
+ Constant constant = hConstant.constant;
+ NumConstant constantNum;
+ if (constant is DeferredConstant) {
+ constantNum = constant.referenced;
+ } else {
+ constantNum = constant;
+ }
if (constantNum.isMinusZero) constantNum = new IntConstant(0);
Value value = info.newIntValue(constantNum.value);
return info.newNormalizedRange(value, value);

Powered by Google App Engine
This is Rietveld 408576698