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

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: 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
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..62e636d383c7c45fd9390c24fe19c3494a3c25ec 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -384,6 +384,18 @@ class CodeGenerator extends tree_ir.StatementVisitor
return buildStaticHelperInvocation(
glue.getCheckSubtype(),
[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;
+
+ // We use the helper:
karlklose 2015/05/28 07:42:30 I am not sure these comments have much value. Mayb
asgerf 2015/05/28 08:52:55 I added the doc comments to glue and removed this
+ //
+ // checkSubtypeOfRuntime(value, runtimeType)
+ //
+ return buildStaticHelperInvocation(
+ glue.getCheckSubtypeOfRuntime(),
+ [value, typeValue]);
karlklose 2015/05/28 07:42:30 Add type arguments to list (also in line 386.)
asgerf 2015/05/28 08:52:55 Done.
}
return giveup(node, 'type check unimplemented for $type.');
}

Powered by Google App Engine
This is Rietveld 408576698