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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_mask_system.dart

Issue 1474713002: dart2js cps: Clean up and avoid processing unreachable code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/gvn.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_mask_system.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
index 58d7330cc754175d428d52499d86a7e1c60d0ad0..ed2157241846a385c363cb7c161c306732ced791 100644
--- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -16,6 +16,7 @@ import '../types/constants.dart' show computeTypeMask;
import '../universe/selector.dart' show Selector;
import '../universe/call_structure.dart' show CallStructure;
import '../world.dart' show World;
+import '../closure.dart' show ClosureFieldElement, BoxLocal, TypeVariableLocal;
enum AbstractBool {
True, False, Maybe, Nothing
@@ -181,6 +182,14 @@ class TypeMaskSystem {
}
TypeMask getFieldType(FieldElement field) {
+ if (field is ClosureFieldElement) {
+ // The type inference does not report types for all closure fields.
+ // Box fields are never null.
+ if (field.local is BoxLocal) return nonNullType;
+ // Closure fields for type variables contain the internal representation
+ // of the type (which can be null), not the Type object.
+ if (field.local is TypeVariableLocal) return dynamicType;
+ }
return inferrer.getGuaranteedTypeOfElement(field);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/gvn.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698