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

Side by Side Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1371193004: Add bool value types to type inference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
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 OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 } 1299 }
1300 1300
1301 void visitIf(HIf instruction) { 1301 void visitIf(HIf instruction) {
1302 HInstruction condition = instruction.condition; 1302 HInstruction condition = instruction.condition;
1303 if (condition.isConstant()) { 1303 if (condition.isConstant()) {
1304 if (condition.isConstantTrue()) { 1304 if (condition.isConstantTrue()) {
1305 markBlockLive(instruction.thenBlock); 1305 markBlockLive(instruction.thenBlock);
1306 } else { 1306 } else {
1307 markBlockLive(instruction.elseBlock); 1307 markBlockLive(instruction.elseBlock);
1308 } 1308 }
1309 } else if (condition.isValue()) {
1310 ValueTypeMask valueType = condition.instructionType;
sra1 2015/09/29 01:02:05 I don't think we should it like this. We should r
Harry Terkelsen 2015/09/29 01:09:53 I wanted to do this but I didn't know how to conve
Harry Terkelsen 2015/09/29 01:16:34 Oops, replied before fully reading your comment. I
1311 if (valueType.value == true) {
1312 markBlockLive(instruction.thenBlock);
1313 } else {
1314 markBlockLive(instruction.elseBlock);
1315 }
1309 } else { 1316 } else {
1310 visitControlFlow(instruction); 1317 visitControlFlow(instruction);
1311 } 1318 }
1312 } 1319 }
1313 1320
1314 void visitSwitch(HSwitch node) { 1321 void visitSwitch(HSwitch node) {
1315 if (node.expression.isInteger(compiler)) { 1322 if (node.expression.isInteger(compiler)) {
1316 Range switchRange = ranges[node.expression]; 1323 Range switchRange = ranges[node.expression];
1317 if (switchRange != null && 1324 if (switchRange != null &&
1318 switchRange.lower is IntValue && 1325 switchRange.lower is IntValue &&
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 2359
2353 keyedValues.forEach((receiver, values) { 2360 keyedValues.forEach((receiver, values) {
2354 result.keyedValues[receiver] = 2361 result.keyedValues[receiver] =
2355 new Map<HInstruction, HInstruction>.from(values); 2362 new Map<HInstruction, HInstruction>.from(values);
2356 }); 2363 });
2357 2364
2358 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2365 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2359 return result; 2366 return result;
2360 } 2367 }
2361 } 2368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698