Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/inline.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/inline.dart b/pkg/compiler/lib/src/cps_ir/inline.dart |
| index 554e93e39239a9804a5d1b860301e0ffbc6a192c..972241e138952849eef411d0f1d7e0d3dda025be 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/inline.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/inline.dart |
| @@ -405,6 +405,14 @@ class InliningVisitor extends TrampolineRecursiveVisitor { |
| return null; |
| } |
| + if (isBlacklisted(target)) return null; |
| + |
| + if (invoke.callingConvention == CallingConvention.OneShotIntercepted) { |
|
Siggi Cherem (dart-lang)
2016/02/05 18:19:39
Is this mainly for the one-shot interceptors you i
asgerf
2016/02/09 12:19:54
Regular one-shot interceptors are inserted later i
|
| + // One-shot interceptor calls with a known target are only inserted on |
| + // uncommon code paths, so they should not be inlined. |
| + return null; |
| + } |
| + |
| Reference<Primitive> dartReceiver = invoke.dartReceiverReference; |
| TypeMask abstractReceiver = |
| dartReceiver == null ? null : abstractType(dartReceiver); |
| @@ -512,7 +520,9 @@ class InliningVisitor extends TrampolineRecursiveVisitor { |
| CpsFragment fragment, |
| Primitive dartReceiver, |
| TypeMask abstractReceiver) { |
| - Selector selector = invoke is InvokeMethod ? invoke.selector : null; |
| + if (invoke is! InvokeMethod) return dartReceiver; |
| + InvokeMethod invokeMethod = invoke; |
| + Selector selector = invokeMethod.selector; |
| if (typeSystem.isDefinitelyNum(abstractReceiver, allowNull: true)) { |
| Primitive condition = _fragment.letPrim( |
| new ApplyBuiltinOperator(BuiltinOperator.IsNotNumber, |
| @@ -520,15 +530,16 @@ class InliningVisitor extends TrampolineRecursiveVisitor { |
| invoke.sourceInformation)); |
| condition.type = typeSystem.boolType; |
| Primitive check = _fragment.letPrim( |
| - new NullCheck.guarded( |
| - condition, dartReceiver, selector, invoke.sourceInformation)); |
| + new ReceiverCheck.nullCheck(dartReceiver, selector, |
| + invoke.sourceInformation, |
| + condition: condition)); |
| check.type = abstractReceiver.nonNullable(); |
| return check; |
| } |
| Primitive check = _fragment.letPrim( |
| - new NullCheck(dartReceiver, invoke.sourceInformation, |
| - selector: selector)); |
| + new ReceiverCheck.nullCheck(dartReceiver, selector, |
| + invoke.sourceInformation)); |
| check.type = abstractReceiver.nonNullable(); |
| return check; |
| } |
| @@ -571,4 +582,16 @@ class InliningVisitor extends TrampolineRecursiveVisitor { |
| } |
| return tryInlining(node, node.target, null); |
| } |
| + |
| + bool isBlacklisted(FunctionElement target) { |
| + ClassElement enclosingClass = target.enclosingClass; |
| + if (target.isOperator && |
| + (enclosingClass == backend.helpers.jsNumberClass || |
| + enclosingClass == backend.helpers.jsDoubleClass || |
| + enclosingClass == backend.helpers.jsIntClass)) { |
| + // These should be handled by operator specialization. |
| + return true; |
| + } |
| + return false; |
| + } |
| } |