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

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

Issue 10353014: Start implementing checked mode and tools support for using it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 2139
2140 HType get guaranteedType() => HType.BOOLEAN; 2140 HType get guaranteedType() => HType.BOOLEAN;
2141 2141
2142 accept(HVisitor visitor) => visitor.visitIs(this); 2142 accept(HVisitor visitor) => visitor.visitIs(this);
2143 2143
2144 toString() => "$expression is $typeExpression"; 2144 toString() => "$expression is $typeExpression";
2145 } 2145 }
2146 2146
2147 class HTypeConversion extends HInstruction { 2147 class HTypeConversion extends HInstruction {
2148 HType type; 2148 HType type;
2149 final bool checked;
2149 2150
2150 HTypeConversion(HType this.type, HInstruction input) 2151 HTypeConversion(HType this.type,
2151 : super(<HInstruction>[input]); 2152 HInstruction input,
2153 [bool this.checked = false])
2154 : super(<HInstruction>[input]) {
2155 sourceElement = input.sourceElement;
2156 }
2152 2157
2153 HType get guaranteedType() => type; 2158 HType get guaranteedType() => type;
2154 2159
2155 void prepareGvn() {
2156 assert(!hasSideEffects());
2157 setUseGvn();
2158 }
2159
2160 accept(HVisitor visitor) => visitor.visitTypeConversion(this); 2160 accept(HVisitor visitor) => visitor.visitTypeConversion(this);
2161 int typeCode() => 27;
2162 bool typeEquals(other) => other is HTypeConversion;
2163 bool dataEquals(HTypeConversion other) => type == other.type;
2164 } 2161 }
2165 2162
2166 /** 2163 /**
2167 * Information about a syntactic-like structure that can be attached 2164 * Information about a syntactic-like structure that can be attached
2168 * to a [HBasicBlock]. 2165 * to a [HBasicBlock].
2169 */ 2166 */
2170 interface HBlockInformation { 2167 interface HBlockInformation {
2171 HBasicBlock get start(); 2168 HBasicBlock get start();
2172 HBasicBlock get end(); 2169 HBasicBlock get end();
2173 bool accept(HBlockInformationVisitor visitor); 2170 bool accept(HBlockInformationVisitor visitor);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 this.finallyBlock, 2405 this.finallyBlock,
2409 this.joinBlock); 2406 this.joinBlock);
2410 2407
2411 HBasicBlock get start() => body.start; 2408 HBasicBlock get start() => body.start;
2412 HBasicBlock get end() => 2409 HBasicBlock get end() =>
2413 finallyBlock === null ? catchBlock.end : finallyBlock.end; 2410 finallyBlock === null ? catchBlock.end : finallyBlock.end;
2414 2411
2415 bool accept(HStatementInformationVisitor visitor) => 2412 bool accept(HStatementInformationVisitor visitor) =>
2416 visitor.visitTryInfo(this); 2413 visitor.visitTryInfo(this);
2417 } 2414 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen_helpers.dart ('k') | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698