| Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| index 19e8c87d6a79f8d57f733e12d32ac049aa7c36ae..aa26e319231398246ef0cd811da339ff54222879 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -1388,6 +1388,28 @@ class TransformingVisitor extends DeepRecursiveVisitor {
|
| assert(node.hasNoUses);
|
| return cps;
|
|
|
| + case 'isEmpty':
|
| + if (!node.selector.isGetter) return null;
|
| + CpsFragment cps = new CpsFragment(node.sourceInformation);
|
| + Primitive length = cps.letPrim(new GetLength(receiver));
|
| + Constant zero = cps.makeZero();
|
| + ApplyBuiltinOperator op = cps.applyBuiltin(BuiltinOperator.StrictEq,
|
| + [length, zero]);
|
| + node.replaceUsesWith(op);
|
| + op.hint = node.hint;
|
| + return cps;
|
| +
|
| + case 'isNotEmpty':
|
| + if (!node.selector.isGetter) return null;
|
| + CpsFragment cps = new CpsFragment(node.sourceInformation);
|
| + Primitive length = cps.letPrim(new GetLength(receiver));
|
| + Constant zero = cps.makeZero();
|
| + ApplyBuiltinOperator op = cps.applyBuiltin(BuiltinOperator.StrictNeq,
|
| + [length, zero]);
|
| + node.replaceUsesWith(op);
|
| + op.hint = node.hint;
|
| + return cps;
|
| +
|
| default:
|
| return null;
|
| }
|
|
|