| 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 d93f05154e3baff2b274c9ff9ab737d14b9abd1f..c85af372c1d3d572a896b598a8b9a57493478012 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -1610,6 +1610,19 @@ class TransformingVisitor extends LeafVisitor {
|
| Continuation cont = node.continuation.definition;
|
| Primitive arg(int n) => node.arguments[n].definition;
|
| AbstractValue argType(int n) => getValue(arg(n));
|
| +
|
| + bool replaceWithBinary(BuiltinOperator operator,
|
| + Primitive left,
|
| + Primitive right) {
|
| + Primitive prim =
|
| + new ApplyBuiltinOperator(operator, <Primitive>[left, right],
|
| + node.sourceInformation);
|
| + LetPrim let = makeLetPrimInvoke(prim, cont);
|
| + replaceSubtree(node, let);
|
| + push(let);
|
| + return true; // So returning early is more convenient.
|
| + }
|
| +
|
| if (node.target.library.isInternalLibrary) {
|
| switch(node.target.name) {
|
| case InternalMethod.Stringify:
|
| @@ -1622,6 +1635,14 @@ class TransformingVisitor extends LeafVisitor {
|
| }
|
| break;
|
| }
|
| + } else if (node.target.library.isDartCore) {
|
| + switch(node.target.name) {
|
| + case CorelibMethod.Identical:
|
| + if (node.arguments.length == 2) {
|
| + return replaceWithBinary(BuiltinOperator.Identical, arg(0), arg(1));
|
| + }
|
| + break;
|
| + }
|
| }
|
| return false;
|
| }
|
| @@ -2511,6 +2532,11 @@ abstract class InternalMethod {
|
| static const String Stringify = 'S';
|
| }
|
|
|
| +/// Enum-like class with the names of dart:core methods we care about.
|
| +abstract class CorelibMethod {
|
| + static const String Identical = 'identical';
|
| +}
|
| +
|
| /// Suggested name for a synthesized loop index.
|
| class LoopIndexEntity extends Entity {
|
| String get name => 'i';
|
|
|