| Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
|
| index 965822ea6c0c54cf5ca4370ebb5b6f15ecb59839..f1f7953b31ec098d928e1b9f4e819b9ed0ddde4f 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
|
| @@ -2176,7 +2176,9 @@ class CodeEmitterTask extends CompilerTask {
|
| if (!knownSubtype) {
|
| registerDynamicFunctionTypeCheck(functionType);
|
| hasDynamicFunctionTypeCheck = true;
|
| - } else {
|
| + } else if (!backend.rti.isSimpleFunctionType(functionType)) {
|
| + // Simple function types are always checked using predicates and should
|
| + // not provoke generation of signatures.
|
| neededPredicates++;
|
| }
|
| });
|
| @@ -2188,7 +2190,10 @@ class CodeEmitterTask extends CompilerTask {
|
| }
|
| functionTypeChecks.forEach((FunctionType functionType, bool knownSubtype) {
|
| if (knownSubtype) {
|
| - if (alwaysUseSignature) {
|
| + if (backend.rti.isSimpleFunctionType(functionType)) {
|
| + // Simple function types are always checked using predicates.
|
| + emitIsFunctionTypeTest(functionType);
|
| + } else if (alwaysUseSignature) {
|
| registerDynamicFunctionTypeCheck(functionType);
|
| } else {
|
| emitIsFunctionTypeTest(functionType);
|
|
|