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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes and further implementation. Created 6 years, 3 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/inferrer/type_graph_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart
index f7b6761f2f8ad31665d05170db5fa92f96a3cb74..71cc52b9f8ac9e09ab409eb5e6226df5906915f7 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart
@@ -5,6 +5,7 @@
library type_graph_inferrer;
import 'dart:collection' show Queue, IterableBase;
+import '../cps_ir/const_expression.dart';
import '../dart_types.dart' show DartType, InterfaceType, TypeKind;
import '../elements/elements.dart';
import '../tree/tree.dart' as ast show DartString, Node;
@@ -742,9 +743,10 @@ class TypeGraphInferrerEngine
if (type is! ListTypeInformation && type is! MapTypeInformation) {
// For non-container types, the constant handler does
// constant folding that could give more precise results.
- Constant value = compiler.backend.constants
+ ConstExp constant = compiler.backend.constants
.getConstantForVariable(element);
- if (value != null) {
+ if (constant != null) {
+ Constant value = constant.value;
if (value.isFunction) {
FunctionConstant functionConstant = value;
type = types.allocateClosure(node, functionConstant.element);

Powered by Google App Engine
This is Rietveld 408576698