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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1160763002: dart2js cps: 'is'-check directly against type variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase + status Created 5 years, 7 months 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index c133788a1f9a2fa81d5a5ebb791b7f7702173bc7..6379605fcfafc158db3b7d58e526114ac8585bb8 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -383,7 +383,14 @@ class CodeGenerator extends tree_ir.StatementVisitor
return buildStaticHelperInvocation(
glue.getCheckSubtype(),
- [value, isT, typeArgumentArray, asT]);
+ <js.Expression>[value, isT, typeArgumentArray, asT]);
+ } else if (type is TypeVariableType) {
+ glue.registerIsCheck(type, registry);
+ // The only type argument is the type held in the type variable.
+ js.Expression typeValue = typeArguments.single;
+ return buildStaticHelperInvocation(
+ glue.getCheckSubtypeOfRuntime(),
+ <js.Expression>[value, typeValue]);
}
return giveup(node, 'type check unimplemented for $type.');
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698