Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2020)

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart

Issue 57773002: Repro for OOM bug in test.dart (applies to r29345). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}
});

Powered by Google App Engine
This is Rietveld 408576698