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

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

Issue 1305863010: dart2js cps: Store the TypeMask for each primitive in a field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Print type in CPS IR tracer Created 5 years, 3 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 | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d93de7b50d0fc73853e52e866bf4cfdc9468c2a9..11bab5926a8ec61582249bc294cb1298599705d1 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -161,7 +161,7 @@ class EffectiveUseIterable extends IterableBase<Reference<Primitive>> {
/// The subclass describes how to compute the value.
///
/// All primitives except [Parameter] must be bound by a [LetPrim].
-abstract class Primitive extends Definition<Primitive> {
+abstract class Primitive extends Variable<Primitive> {
/// The [VariableElement] or [ParameterElement] from which the primitive
/// binding originated.
Entity hint;
@@ -484,14 +484,14 @@ class InvokeMethodDirectly extends CallExpression {
/// Note that [InvokeConstructor] does it itself allocate an object.
/// The invoked constructor will do that using [CreateInstance].
class InvokeConstructor extends CallExpression {
- final DartType type;
+ final DartType dartType;
final ConstructorElement target;
final List<Reference<Primitive>> arguments;
final Reference<Continuation> continuation;
final Selector selector;
final SourceInformation sourceInformation;
- InvokeConstructor(this.type,
+ InvokeConstructor(this.dartType,
this.target,
this.selector,
List<Primitive> args,
@@ -512,9 +512,9 @@ class InvokeConstructor extends CallExpression {
/// to the same primitive).
class Refinement extends Primitive {
Reference<Primitive> value;
- final TypeMask type;
+ final TypeMask refineType;
Kevin Millikin (Google) 2015/09/09 10:12:47 refineType sounds like a verb. How about refinedT
asgerf 2015/09/09 13:08:10 My issue with "refinedType" is that it sounds like
- Refinement(Primitive value, this.type)
+ Refinement(Primitive value, this.refineType)
: value = new Reference<Primitive>(value);
bool get isSafeForElimination => true;
@@ -534,7 +534,7 @@ class Refinement extends Primitive {
/// to simplify code generation for type tests.
class TypeTest extends Primitive {
Reference<Primitive> value;
- final DartType type;
+ final DartType dartType;
/// If [type] is an [InterfaceType], this holds the internal representation of
/// the type arguments to [type]. Since these may reference type variables
@@ -550,7 +550,7 @@ class TypeTest extends Primitive {
final List<Reference<Primitive>> typeArguments;
TypeTest(Primitive value,
- this.type,
+ this.dartType,
List<Primitive> typeArguments)
: this.value = new Reference<Primitive>(value),
this.typeArguments = _referenceList(typeArguments);
@@ -573,14 +573,14 @@ class TypeTest extends Primitive {
/// continuation parameter without needing flow-sensitive analysis.
class TypeCast extends CallExpression {
Reference<Primitive> value;
- final DartType type;
+ final DartType dartType;
/// See the corresponding field on [TypeTest].
final List<Reference<Primitive>> typeArguments;
final Reference<Continuation> continuation;
TypeCast(Primitive value,
- this.type,
+ this.dartType,
List<Primitive> typeArguments,
Continuation cont)
: this.value = new Reference<Primitive>(value),
@@ -1036,10 +1036,10 @@ class Constant extends Primitive {
class LiteralList extends Primitive {
/// The List type being created; this is not the type argument.
- final InterfaceType type;
+ final InterfaceType dartType;
final List<Reference<Primitive>> values;
- LiteralList(this.type, List<Primitive> values)
+ LiteralList(this.dartType, List<Primitive> values)
: this.values = _referenceList(values);
accept(Visitor visitor) => visitor.visitLiteralList(this);
@@ -1058,10 +1058,10 @@ class LiteralMapEntry {
}
class LiteralMap extends Primitive {
- final InterfaceType type;
+ final InterfaceType dartType;
final List<LiteralMapEntry> entries;
- LiteralMap(this.type, this.entries);
+ LiteralMap(this.dartType, this.entries);
accept(Visitor visitor) => visitor.visitLiteralMap(this);
@@ -1135,8 +1135,16 @@ class Continuation extends Definition<Continuation> implements InteriorNode {
accept(Visitor visitor) => visitor.visitContinuation(this);
}
+/// Common interface for [Primitive] and [MutableVariable].
+abstract class Variable<T extends Variable<T>> extends Definition<T> {
+ /// Type of value held in the variable.
+ ///
+ /// Is `null` until initialized by type propagation.
+ TypeMask type;
+}
+
/// Identifies a mutable variable.
-class MutableVariable extends Definition {
+class MutableVariable extends Variable<MutableVariable> {
Entity hint;
MutableVariable(this.hint);
« no previous file with comments | « no previous file | 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