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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart

Issue 1388473003: dart2js cps_ir: Use interceptors for is-checks. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/tree_ir/tree_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index ddaf34ddef5ba9362866db110393ff39be81d8fe..95bc497b11d0ca69c825c3c941a8e32bb2371a4f 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -742,6 +742,22 @@ class SetField extends Expression {
accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
}
+
+/// Read the type test property from [object]. The value is truthy/fasly rather
+/// than bool. [object] must not be `null`.
+class GetTypeTestProperty extends Expression {
+ Expression object;
+ DartType dartType;
+
+ GetTypeTestProperty(this.object, this.dartType);
+
+ accept(ExpressionVisitor visitor) =>
+ visitor.visitGetTypeTestProperty(this);
+ accept1(ExpressionVisitor1 visitor, arg) =>
+ visitor.visitGetTypeTestProperty(this, arg);
+}
+
+
/// Read the value of a field, possibly provoking its initializer to evaluate,
/// or tear off a static method.
class GetStatic extends Expression {
@@ -975,6 +991,7 @@ abstract class ExpressionVisitor<E> {
E visitSetField(SetField node);
E visitGetStatic(GetStatic node);
E visitSetStatic(SetStatic node);
+ E visitGetTypeTestProperty(GetTypeTestProperty node);
E visitCreateBox(CreateBox node);
E visitCreateInstance(CreateInstance node);
E visitReifyRuntimeType(ReifyRuntimeType node);
@@ -1012,6 +1029,7 @@ abstract class ExpressionVisitor1<E, A> {
E visitSetField(SetField node, A arg);
E visitGetStatic(GetStatic node, A arg);
E visitSetStatic(SetStatic node, A arg);
+ E visitGetTypeTestProperty(GetTypeTestProperty node, A arg);
E visitCreateBox(CreateBox node, A arg);
E visitCreateInstance(CreateInstance node, A arg);
E visitReifyRuntimeType(ReifyRuntimeType node, A arg);
@@ -1206,6 +1224,10 @@ abstract class RecursiveVisitor implements StatementVisitor, ExpressionVisitor {
visitExpression(node.value);
}
+ visitGetTypeTestProperty(GetTypeTestProperty node) {
+ visitExpression(node.object);
+ }
+
visitCreateBox(CreateBox node) {
}
@@ -1451,6 +1473,11 @@ class RecursiveTransformer extends Transformer {
return node;
}
+ visitGetTypeTestProperty(GetTypeTestProperty node) {
+ node.object = visitExpression(node.object);
+ return node;
+ }
+
visitCreateBox(CreateBox node) => node;
visitCreateInstance(CreateInstance node) {

Powered by Google App Engine
This is Rietveld 408576698