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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 85593002: Make sure the SSA codegen visit constants used in a switch through the 'visitConstant' method, to e… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 30610)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -5156,7 +5156,6 @@
HBasicBlock expressionEnd = close(switchInstruction);
LocalsHandler savedLocals = localsHandler;
- List<List<Constant>> matchExpressions = <List<Constant>>[];
List<HStatementInformation> statements = <HStatementInformation>[];
bool hasDefault = false;
Element getFallThroughErrorElement = backend.getFallThroughError();
@@ -5164,16 +5163,13 @@
new HasNextIterator<Node>(switchCases.iterator);
while (caseIterator.hasNext) {
SwitchCase switchCase = caseIterator.next();
- List<Constant> caseConstants = <Constant>[];
HBasicBlock block = graph.addNewBlock();
for (Constant constant in getConstants(switchCase)) {
- caseConstants.add(constant);
HConstant hConstant = graph.addConstant(constant, compiler);
switchInstruction.inputs.add(hConstant);
hConstant.usedBy.add(switchInstruction);
expressionEnd.addSuccessor(block);
}
- matchExpressions.add(caseConstants);
if (isDefaultCase(switchCase)) {
// An HSwitch has n inputs and n+1 successors, the last being the
@@ -5231,7 +5227,6 @@
close(new HGoto());
defaultCase.addSuccessor(joinBlock);
caseHandlers.add(savedLocals);
- matchExpressions.add(<Constant>[]);
statements.add(new HSubGraphBlockInformation(new SubGraph(
defaultCase, defaultCase)));
}
@@ -5254,7 +5249,6 @@
expressionEnd));
expressionStart.setBlockFlow(
new HSwitchBlockInformation(expressionInfo,
- matchExpressions,
statements,
jumpHandler.target,
jumpHandler.labels()),

Powered by Google App Engine
This is Rietveld 408576698