| Index: lib/compiler/implementation/ssa/codegen.dart
|
| diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
|
| index 8784c2b9ffda835e34308f2dc83adf128a451fe9..b71c0cced783bcd4be268484cce8999409fa933a 100644
|
| --- a/lib/compiler/implementation/ssa/codegen.dart
|
| +++ b/lib/compiler/implementation/ssa/codegen.dart
|
| @@ -1386,6 +1386,14 @@ class SsaCodeGenerator implements HVisitor {
|
| endExpression(JSPrecedence.EQUALITY_PRECEDENCE);
|
| }
|
|
|
| + void checkImmutableArray(HInstruction input) {
|
| + beginExpression(JSPrecedence.PREFIX_PRECEDENCE);
|
| + buffer.add('!!');
|
| + use(input, JSPrecedence.MEMBER_PRECEDENCE);
|
| + buffer.add('.immutable\$list');
|
| + endExpression(JSPrecedence.PREFIX_PRECEDENCE);
|
| + }
|
| +
|
| void checkNull(HInstruction input) {
|
| beginExpression(JSPrecedence.EQUALITY_PRECEDENCE);
|
| use(input, JSPrecedence.EQUALITY_PRECEDENCE);
|
| @@ -1571,6 +1579,15 @@ class SsaOptimizedCodeGenerator extends SsaCodeGenerator {
|
| checkString(input, '!==');
|
| buffer.add(') ');
|
| bailout(node, 'Not a string');
|
| + } else if (node.isMutableArray()) {
|
| + buffer.add('if (');
|
| + checkObject(input, '!==');
|
| + buffer.add('||');
|
| + checkArray(input, '!==');
|
| + buffer.add('||');
|
| + checkImmutableArray(input);
|
| + buffer.add(') ');
|
| + bailout(node, 'Not a mutable array');
|
| } else if (node.isArray()) {
|
| buffer.add('if (');
|
| checkObject(input, '!==');
|
|
|