| Index: dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
|
| index 5644edba756093572b1f14daff97913227b01679..408fc67ee520c983be724b943ab134d39edba24a 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
|
| @@ -255,33 +255,19 @@ class TypeTestEmitter extends CodeEmitterHelper {
|
| Map<FunctionType, bool> functionTypeChecks,
|
| FunctionTypeSignatureEmitter emitFunctionTypeSignature,
|
| FunctionTypeTestEmitter emitIsFunctionTypeTest) {
|
| - bool hasDynamicFunctionTypeCheck = false;
|
| - int neededPredicates = 0;
|
| functionTypeChecks.forEach((FunctionType functionType, bool knownSubtype) {
|
| if (!knownSubtype) {
|
| registerDynamicFunctionTypeCheck(functionType);
|
| - hasDynamicFunctionTypeCheck = true;
|
| - } else if (!backend.rti.isSimpleFunctionType(functionType)) {
|
| - // Simple function types are always checked using predicates and should
|
| - // not provoke generation of signatures.
|
| - neededPredicates++;
|
| }
|
| });
|
| - bool alwaysUseSignature = false;
|
| - if (hasDynamicFunctionTypeCheck ||
|
| - neededPredicates > MAX_FUNCTION_TYPE_PREDICATES) {
|
| - emitFunctionTypeSignature(method, methodType);
|
| - alwaysUseSignature = true;
|
| - }
|
| + emitFunctionTypeSignature(method, methodType);
|
| functionTypeChecks.forEach((FunctionType functionType, bool knownSubtype) {
|
| if (knownSubtype) {
|
| if (backend.rti.isSimpleFunctionType(functionType)) {
|
| // Simple function types are always checked using predicates.
|
| emitIsFunctionTypeTest(functionType);
|
| - } else if (alwaysUseSignature) {
|
| - registerDynamicFunctionTypeCheck(functionType);
|
| } else {
|
| - emitIsFunctionTypeTest(functionType);
|
| + registerDynamicFunctionTypeCheck(functionType);
|
| }
|
| }
|
| });
|
|
|