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

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

Issue 10452032: Merge functionality of HExactType into HBoundedType and fix computation of unions and intersections. (Closed) Base URL: https://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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 static HType mapConstantTypeToSsaType(Constant constant) { 150 static HType mapConstantTypeToSsaType(Constant constant) {
151 if (constant.isNull()) return HType.NULL; 151 if (constant.isNull()) return HType.NULL;
152 if (constant.isBool()) return HType.BOOLEAN; 152 if (constant.isBool()) return HType.BOOLEAN;
153 if (constant.isInt()) return HType.INTEGER; 153 if (constant.isInt()) return HType.INTEGER;
154 if (constant.isDouble()) return HType.DOUBLE; 154 if (constant.isDouble()) return HType.DOUBLE;
155 if (constant.isString()) return HType.STRING; 155 if (constant.isString()) return HType.STRING;
156 if (constant.isList()) return HType.READABLE_ARRAY; 156 if (constant.isList()) return HType.READABLE_ARRAY;
157 ObjectConstant objectConstant = constant; 157 ObjectConstant objectConstant = constant;
158 return new HExactType(objectConstant.type); 158 return new HBoundedType.exact(objectConstant.type);
159 } 159 }
160 160
161 HConstant addConstant(Constant constant) { 161 HConstant addConstant(Constant constant) {
162 HConstant result = constants[constant]; 162 HConstant result = constants[constant];
163 if (result === null) { 163 if (result === null) {
164 HType type = mapConstantTypeToSsaType(constant); 164 HType type = mapConstantTypeToSsaType(constant);
165 result = new HConstant.internal(constant, type); 165 result = new HConstant.internal(constant, type);
166 entry.addAtExit(result); 166 entry.addAtExit(result);
167 constants[constant] = result; 167 constants[constant] = result;
168 } 168 }
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 this.catchBlock, 2467 this.catchBlock,
2468 this.finallyBlock); 2468 this.finallyBlock);
2469 2469
2470 HBasicBlock get start() => body.start; 2470 HBasicBlock get start() => body.start;
2471 HBasicBlock get end() => 2471 HBasicBlock get end() =>
2472 finallyBlock === null ? catchBlock.end : finallyBlock.end; 2472 finallyBlock === null ? catchBlock.end : finallyBlock.end;
2473 2473
2474 bool accept(HStatementInformationVisitor visitor) => 2474 bool accept(HStatementInformationVisitor visitor) =>
2475 visitor.visitTryInfo(this); 2475 visitor.visitTryInfo(this);
2476 } 2476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698