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

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

Issue 1642493002: Add type info to JSArray. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: array changes Created 4 years, 11 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 63b7528d0711955e8457fc49d0e0b6d417b1e67b..2b4d3011163dacab55b80c6e8c29af5ae84148b6 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -13,6 +13,8 @@ import '../universe/selector.dart' show Selector;
import '../cps_ir/builtin_operator.dart';
export '../cps_ir/builtin_operator.dart';
+import '../cps_ir/cps_ir_nodes.dart' show TypeExpressionKind;
+export '../cps_ir/cps_ir_nodes.dart' show TypeExpressionKind;
// These imports are only used for the JavaScript specific nodes. If we want to
// support more than one native backend, we should probably create better
@@ -114,7 +116,8 @@ class Variable extends Node {
assert(host != null);
}
- String toString() => element == null ? 'Variable' : element.toString();
+ String toString() =>
+ element == null ? 'Variable.${hashCode}' : element.toString();
}
/// Read the value of a variable.
@@ -669,7 +672,7 @@ class CreateBox extends Expression {
class CreateInstance extends Expression {
ClassElement classElement;
List<Expression> arguments;
- List<Expression> typeInformation;
+ Expression typeInformation;
SourceInformation sourceInformation;
CreateInstance(this.classElement, this.arguments,
@@ -902,10 +905,11 @@ class ForeignStatement extends ForeignCode implements Statement {
/// are replaced by the values in [arguments].
/// (See documentation on the TypeExpression CPS node for more details.)
class TypeExpression extends Expression {
+ final TypeExpressionKind kind;
final DartType dartType;
final List<Expression> arguments;
- TypeExpression(this.dartType, this.arguments);
+ TypeExpression(this.kind, this.dartType, this.arguments);
accept(ExpressionVisitor visitor) {
return visitor.visitTypeExpression(this);
@@ -1216,7 +1220,7 @@ abstract class RecursiveVisitor implements StatementVisitor, ExpressionVisitor {
visitCreateInstance(CreateInstance node) {
node.arguments.forEach(visitExpression);
- node.typeInformation.forEach(visitExpression);
+ if (node.typeInformation != null) visitExpression(node.typeInformation);
}
visitReifyRuntimeType(ReifyRuntimeType node) {
@@ -1457,7 +1461,9 @@ class RecursiveTransformer extends Transformer {
visitCreateInstance(CreateInstance node) {
_replaceExpressions(node.arguments);
- _replaceExpressions(node.typeInformation);
+ if (node.typeInformation != null) {
+ node.typeInformation = visitExpression(node.typeInformation);
+ }
return node;
}

Powered by Google App Engine
This is Rietveld 408576698