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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart

Issue 766743002: dart2js: Remove dead code in type test emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
index e01100546b4e9cfef7702382ff912f7a78d73e7d..4421165ba728c96b39436ab788e60a600c9cf6fa 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
@@ -172,12 +172,8 @@ class TypeTestEmitter extends CodeEmitterHelper {
generated);
}
FunctionType callType = call.computeType(compiler);
- Map<FunctionType, bool> functionTypeChecks =
- getFunctionTypeChecksOn(callType);
- generateFunctionTypeTests(
- call, callType, functionTypeChecks,
- emitFunctionTypeSignature);
- }
+ emitFunctionTypeSignature(call, callType);
+ }
}
for (DartType interfaceType in cls.interfaces) {
@@ -219,52 +215,6 @@ class TypeTestEmitter extends CodeEmitterHelper {
}
}
- /**
- * Returns a mapping containing all checked function types for which [type]
- * can be a subtype. A function type is mapped to [:true:] if [type] is
- * statically known to be a subtype of it and to [:false:] if [type] might
- * be a subtype, provided with the right type arguments.
- */
- // TODO(johnniwinther): Change to return a mapping from function types to
- // a set of variable points and use this to detect statically/dynamically
- // known subtype relations.
- Map<FunctionType, bool> getFunctionTypeChecksOn(DartType type) {
- Map<FunctionType, bool> functionTypeMap = new Map<FunctionType, bool>();
- for (FunctionType functionType in checkedFunctionTypes) {
- int maybeSubtype =
- compiler.types.computeSubtypeRelation(type, functionType);
- if (maybeSubtype == Types.IS_SUBTYPE) {
- functionTypeMap[functionType] = true;
- } else if (maybeSubtype == Types.MAYBE_SUBTYPE) {
- functionTypeMap[functionType] = false;
- }
- }
- // TODO(johnniwinther): Ensure stable ordering of the keys.
- return functionTypeMap;
- }
-
- /**
- * Generates function type checks on [method] with type [methodType] against
- * the function type checks in [functionTypeChecks].
- */
- void generateFunctionTypeTests(
- Element method,
- FunctionType methodType,
- Map<FunctionType, bool> functionTypeChecks,
- FunctionTypeSignatureEmitter emitFunctionTypeSignature) {
-
- // TODO(ahe): We should be able to remove this forEach loop.
- functionTypeChecks.forEach((FunctionType functionType, bool knownSubtype) {
- registerDynamicFunctionTypeCheck(functionType);
- });
-
- emitFunctionTypeSignature(method, methodType);
- }
-
- void registerDynamicFunctionTypeCheck(FunctionType functionType) {
- // Currently unused.
- }
-
void emitRuntimeTypeSupport(CodeBuffer buffer, OutputUnit outputUnit) {
emitter.addComment('Runtime type support', buffer);
RuntimeTypes rti = backend.rti;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698