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

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

Issue 11569006: Make sure a constant that was used before but removed from the graph gets inserted back in the grap… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBailoutTarget(HBailoutTarget node); 9 R visitBailoutTarget(HBailoutTarget node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return new HBoundedType.exact(objectConstant.type); 173 return new HBoundedType.exact(objectConstant.type);
174 } 174 }
175 175
176 HConstant addConstant(Constant constant) { 176 HConstant addConstant(Constant constant) {
177 HConstant result = constants[constant]; 177 HConstant result = constants[constant];
178 if (result == null) { 178 if (result == null) {
179 HType type = mapConstantTypeToSsaType(constant); 179 HType type = mapConstantTypeToSsaType(constant);
180 result = new HConstant.internal(constant, type); 180 result = new HConstant.internal(constant, type);
181 entry.addAtExit(result); 181 entry.addAtExit(result);
182 constants[constant] = result; 182 constants[constant] = result;
183 } else if (result.block == null) {
184 // The constant was not used anymore.
185 entry.addAtExit(result);
183 } 186 }
184 return result; 187 return result;
185 } 188 }
186 189
187 HConstant addConstantInt(int i, ConstantSystem constantSystem) { 190 HConstant addConstantInt(int i, ConstantSystem constantSystem) {
188 return addConstant(constantSystem.createInt(i)); 191 return addConstant(constantSystem.createInt(i));
189 } 192 }
190 193
191 HConstant addConstantDouble(double d, ConstantSystem constantSystem) { 194 HConstant addConstantDouble(double d, ConstantSystem constantSystem) {
192 return addConstant(constantSystem.createDouble(d)); 195 return addConstant(constantSystem.createDouble(d));
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2942 HBasicBlock get start => expression.start; 2945 HBasicBlock get start => expression.start;
2943 HBasicBlock get end { 2946 HBasicBlock get end {
2944 // We don't create a switch block if there are no cases. 2947 // We don't create a switch block if there are no cases.
2945 assert(!statements.isEmpty); 2948 assert(!statements.isEmpty);
2946 return statements.last.end; 2949 return statements.last.end;
2947 } 2950 }
2948 2951
2949 bool accept(HStatementInformationVisitor visitor) => 2952 bool accept(HStatementInformationVisitor visitor) =>
2950 visitor.visitSwitchInfo(this); 2953 visitor.visitSwitchInfo(this);
2951 } 2954 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698