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

Side by Side Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 9431029: Implement interface types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface HVisitor<R> { 5 interface HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBitAnd(HBitAnd node); 7 R visitBitAnd(HBitAnd node);
8 R visitBitNot(HBitNot node); 8 R visitBitNot(HBitNot node);
9 R visitBitOr(HBitOr node); 9 R visitBitOr(HBitOr node);
10 R visitBitXor(HBitXor node); 10 R visitBitXor(HBitXor node);
(...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 } 2074 }
2075 2075
2076 bool get builtin() => receiver.isArray(); 2076 bool get builtin() => receiver.isArray();
2077 HType computeType() => value.type; 2077 HType computeType() => value.type;
2078 // This instruction does not yield a new value, so it always 2078 // This instruction does not yield a new value, so it always
2079 // has the expected type (void). 2079 // has the expected type (void).
2080 bool hasExpectedType() => true; 2080 bool hasExpectedType() => true;
2081 } 2081 }
2082 2082
2083 class HIs extends HInstruction { 2083 class HIs extends HInstruction {
2084 // TODO(ahe): This should be a Type, not Element. 2084 final Type typeName;
ahe 2012/04/12 15:05:23 Thank you! The name is not optimal, if you have an
2085 final Element typeExpression;
2086 final bool nullOk; 2085 final bool nullOk;
2087 2086
2088 HIs(this.typeExpression, HInstruction expression, [nullOk = false]) 2087 HIs(this.typeName, HInstruction expression, [nullOk = false])
2089 : this.nullOk = nullOk, super(<HInstruction>[expression]); 2088 : this.nullOk = nullOk, super(<HInstruction>[expression]);
2090 2089
2091 HInstruction get expression() => inputs[0]; 2090 HInstruction get expression() => inputs[0];
2092 2091
2093 HType computeType() => HType.BOOLEAN; 2092 HType computeType() => HType.BOOLEAN;
2094 bool hasExpectedType() => true; 2093 bool hasExpectedType() => true;
2095 2094
2096 accept(HVisitor visitor) => visitor.visitIs(this); 2095 accept(HVisitor visitor) => visitor.visitIs(this);
2097 2096
2098 toString() => "$expression is $typeExpression"; 2097 toString() => "$expression is $typeName";
2099 } 2098 }
2100 2099
2101 class HIfBlockInformation { 2100 class HIfBlockInformation {
2102 final HIf branch; 2101 final HIf branch;
2103 final SubGraph thenGraph; 2102 final SubGraph thenGraph;
2104 final SubGraph elseGraph; 2103 final SubGraph elseGraph;
2105 final HBasicBlock joinBlock; 2104 final HBasicBlock joinBlock;
2106 HIfBlockInformation(this.branch, 2105 HIfBlockInformation(this.branch,
2107 this.thenGraph, 2106 this.thenGraph,
2108 this.elseGraph, 2107 this.elseGraph,
2109 this.joinBlock); 2108 this.joinBlock);
2110 } 2109 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698