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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart

Issue 1161683002: dart2js cps: 'is' checks on types with type arguments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Status file 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/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 5d35709be049738cc1846c3c18ad755f235fe7ee..32c50efa80aa2997b8452e47fe2fbadf88d1b4fe 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -402,17 +402,22 @@ class InvokeConstructor extends Expression implements Invoke {
// But then we need to special-case for is-checks with an erroneous .type as
// these will throw.
class TypeOperator extends Expression {
- Reference<Primitive> receiver;
+ Reference<Primitive> value;
final DartType type;
+ /// Type arguments to [type]. Since [type] may reference type variables in the
+ /// enclosing class, these are not constant.
+ final List<Reference<Primitive>> typeArguments;
final Reference<Continuation> continuation;
// TODO(johnniwinther): Use `Operator` class to encapsule the operator type.
final bool isTypeTest;
- TypeOperator(Primitive receiver,
+ TypeOperator(Primitive value,
this.type,
+ List<Primitive> typeArguments,
Continuation cont,
{bool this.isTypeTest})
- : this.receiver = new Reference<Primitive>(receiver),
+ : this.value = new Reference<Primitive>(value),
+ this.typeArguments = _referenceList(typeArguments),
this.continuation = new Reference<Continuation>(cont) {
assert(isTypeTest != null);
}
@@ -1244,7 +1249,8 @@ class RecursiveVisitor implements Visitor {
visitTypeOperator(TypeOperator node) {
processTypeOperator(node);
processReference(node.continuation);
- processReference(node.receiver);
+ processReference(node.value);
+ node.typeArguments.forEach(processReference);
}
processSetMutableVariable(SetMutableVariable node) {}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698