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

Side by Side Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2718513002: Void is not required to be `null` anymore. (Closed)
Patch Set: Fix more places in the VM. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../closure.dart'; 5 import '../closure.dart';
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/backend_api.dart' show BackendClasses; 7 import '../common/backend_api.dart' show BackendClasses;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 1333
1334 HInstruction convertType(ClosedWorld closedWorld, DartType type, int kind) { 1334 HInstruction convertType(ClosedWorld closedWorld, DartType type, int kind) {
1335 if (type == null) return this; 1335 if (type == null) return this;
1336 type = type.unaliased; 1336 type = type.unaliased;
1337 // Only the builder knows how to create [HTypeConversion] 1337 // Only the builder knows how to create [HTypeConversion]
1338 // instructions with generics. It has the generic type context 1338 // instructions with generics. It has the generic type context
1339 // available. 1339 // available.
1340 assert(!type.isTypeVariable); 1340 assert(!type.isTypeVariable);
1341 assert(type.treatAsRaw || type.isFunctionType); 1341 assert(type.treatAsRaw || type.isFunctionType);
1342 if (type.isDynamic) return this; 1342 if (type.isDynamic) return this;
1343 if (type.isVoid) return this;
1343 if (type == closedWorld.commonElements.objectType) return this; 1344 if (type == closedWorld.commonElements.objectType) return this;
1344 if (type.isVoid || type.isFunctionType || type.isMalformed) { 1345 if (type.isFunctionType || type.isMalformed) {
1345 return new HTypeConversion( 1346 return new HTypeConversion(
1346 type, kind, closedWorld.commonMasks.dynamicType, this); 1347 type, kind, closedWorld.commonMasks.dynamicType, this);
1347 } 1348 }
1348 assert(type.isInterfaceType); 1349 assert(type.isInterfaceType);
1349 if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) { 1350 if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) {
1350 // Boolean conversion checks work on non-nullable booleans. 1351 // Boolean conversion checks work on non-nullable booleans.
1351 return new HTypeConversion( 1352 return new HTypeConversion(
1352 type, kind, closedWorld.commonMasks.boolType, this); 1353 type, kind, closedWorld.commonMasks.boolType, this);
1353 } else if (kind == HTypeConversion.CHECKED_MODE_CHECK && !type.treatAsRaw) { 1354 } else if (kind == HTypeConversion.CHECKED_MODE_CHECK && !type.treatAsRaw) {
1354 throw 'creating compound check to $type (this = ${this})'; 1355 throw 'creating compound check to $type (this = ${this})';
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 3381
3381 String get kindAsString { 3382 String get kindAsString {
3382 switch (kind) { 3383 switch (kind) {
3383 case TypeInfoExpressionKind.COMPLETE: 3384 case TypeInfoExpressionKind.COMPLETE:
3384 return 'COMPLETE'; 3385 return 'COMPLETE';
3385 case TypeInfoExpressionKind.INSTANCE: 3386 case TypeInfoExpressionKind.INSTANCE:
3386 return 'INSTANCE'; 3387 return 'INSTANCE';
3387 } 3388 }
3388 } 3389 }
3389 } 3390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698