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

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

Issue 1785633002: Make source information mandatory for building send-like node in CPS (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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/tree_ir/tree_ir_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5e0925458374e3f5df9a8d04c85d89f32b66e9d0..6600305a04c5456c2f021e4783f9b3cf52f4d697 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -56,6 +56,8 @@ abstract class Node {
abstract class Expression extends Node {
accept(ExpressionVisitor v);
accept1(ExpressionVisitor1 v, arg);
+
+ SourceInformation get sourceInformation => null;
}
abstract class Statement extends Node {
@@ -123,9 +125,10 @@ class Variable extends Node {
/// Read the value of a variable.
class VariableUse extends Expression {
Variable variable;
+ SourceInformation sourceInformation;
/// Creates a use of [variable] and updates its `readCount`.
- VariableUse(this.variable) {
+ VariableUse(this.variable, {this.sourceInformation}) {
variable.readCount++;
}
@@ -138,8 +141,9 @@ class VariableUse extends Expression {
class Assign extends Expression {
Variable variable;
Expression value;
+ SourceInformation sourceInformation;
- Assign(this.variable, this.value) {
+ Assign(this.variable, this.value, {this.sourceInformation}) {
variable.writeCount++;
}
@@ -693,8 +697,13 @@ class GetField extends Expression {
Expression object;
Element field;
bool objectIsNotNull;
+ SourceInformation sourceInformation;
- GetField(this.object, this.field, {this.objectIsNotNull: false});
+ GetField(
+ this.object,
+ this.field,
+ this.sourceInformation,
+ {this.objectIsNotNull: false});
accept(ExpressionVisitor visitor) => visitor.visitGetField(this);
accept1(ExpressionVisitor1 visitor, arg) => visitor.visitGetField(this, arg);
@@ -704,12 +713,18 @@ class SetField extends Expression {
Expression object;
Element field;
Expression value;
+ SourceInformation sourceInformation;
/// If non-null, this is a compound assignment to the field, using the given
/// operator. The operator must be a compoundable operator.
BuiltinOperator compound;
- SetField(this.object, this.field, this.value, {this.compound});
+ SetField(
+ this.object,
+ this.field,
+ this.value,
+ this.sourceInformation,
+ {this.compound});
accept(ExpressionVisitor visitor) => visitor.visitSetField(this);
accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
@@ -857,9 +872,16 @@ class ForeignCode extends Node {
final native.NativeBehavior nativeBehavior;
final List<bool> nullableArguments; // One 'bit' per argument.
final Element dependency;
+ final SourceInformation sourceInformation;
- ForeignCode(this.codeTemplate, this.type, this.arguments, this.nativeBehavior,
- this.nullableArguments, this.dependency) {
+ ForeignCode(
+ this.codeTemplate,
+ this.type,
+ this.arguments,
+ this.nativeBehavior,
+ this.nullableArguments,
+ this.dependency,
+ this.sourceInformation) {
assert(arguments.length == nullableArguments.length);
}
}
@@ -869,9 +891,10 @@ class ForeignExpression extends ForeignCode implements Expression {
js.Template codeTemplate, types.TypeMask type,
List<Expression> arguments, native.NativeBehavior nativeBehavior,
List<bool> nullableArguments,
- Element dependency)
+ Element dependency,
+ SourceInformation sourceInformation)
: super(codeTemplate, type, arguments, nativeBehavior, nullableArguments,
- dependency);
+ dependency, sourceInformation);
accept(ExpressionVisitor visitor) {
return visitor.visitForeignExpression(this);
@@ -887,9 +910,10 @@ class ForeignStatement extends ForeignCode implements Statement {
js.Template codeTemplate, types.TypeMask type,
List<Expression> arguments, native.NativeBehavior nativeBehavior,
List<bool> nullableArguments,
- Element dependency)
+ Element dependency,
+ SourceInformation sourceInformation)
: super(codeTemplate, type, arguments, nativeBehavior, nullableArguments,
- dependency);
+ dependency, sourceInformation);
accept(StatementVisitor visitor) {
return visitor.visitForeignStatement(this);
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698