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

Unified Diff: dart/lib/compiler/implementation/ssa/nodes.dart

Issue 10511008: Support overriding fields with fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 6 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: dart/lib/compiler/implementation/ssa/nodes.dart
diff --git a/dart/lib/compiler/implementation/ssa/nodes.dart b/dart/lib/compiler/implementation/ssa/nodes.dart
index 9c603f3b51823f30c33f1f8e4e0c3d769e0e125e..b84ddb4dcd280e92c5810067b2ffa8633000041c 100644
--- a/dart/lib/compiler/implementation/ssa/nodes.dart
+++ b/dart/lib/compiler/implementation/ssa/nodes.dart
@@ -1221,16 +1221,23 @@ class HInvokeInterceptor extends HInvokeStatic {
}
}
-class HFieldGet extends HInstruction {
- // TODO(ngeoffray): Should [name] be an element?
- final SourceString name;
+abstract class HFieldAccess extends HInstruction {
+ final Element element;
+
+ HFieldAccess(this.element, List<HInstruction> inputs) : super(inputs);
+
+ bool isFromActivation() => element === null;
+}
+
+class HFieldGet extends HFieldAccess {
final bool isFinalOrConst;
- HFieldGet(this.name, HInstruction receiver, [this.isFinalOrConst = false])
- : super(<HInstruction>[receiver]);
+
+ HFieldGet(Element element, HInstruction receiver,
+ [this.isFinalOrConst = false])
+ : super(element, <HInstruction>[receiver]);
HFieldGet.fromActivation(receiver) : this(null, receiver);
HInstruction get receiver() => inputs.length == 1 ? inputs[0] : null;
- bool isFromActivation() => name === null;
accept(HVisitor visitor) => visitor.visitFieldGet(this);
@@ -1245,20 +1252,18 @@ class HFieldGet extends HInstruction {
int typeCode() => 27;
bool typeEquals(other) => other is HFieldGet;
- bool dataEquals(HFieldGet other) => name == other.name;
+ bool dataEquals(HFieldGet other) => element == other.element;
}
-class HFieldSet extends HInstruction {
- final SourceString name;
- HFieldSet(this.name, HInstruction receiver, HInstruction value)
- : super(<HInstruction>[receiver, value]);
+class HFieldSet extends HFieldAccess {
+ HFieldSet(Element element, HInstruction receiver, HInstruction value)
+ : super(element, <HInstruction>[receiver, value]);
HFieldSet.fromActivation(receiver, value)
: this(null, receiver, value);
HInstruction get receiver() => inputs.length == 2 ? inputs[0] : null;
HInstruction get value() => inputs.length == 2 ? inputs[1] : inputs[0];
accept(HVisitor visitor) => visitor.visitFieldSet(this);
- bool isFromActivation() => name === null;
void prepareGvn() {
// TODO(ngeoffray): implement more fine grain side effects.
« no previous file with comments | « dart/lib/compiler/implementation/ssa/codegen.dart ('k') | dart/lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698