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

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

Issue 2648443004: Implement complex switch statement (switch with continue). (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder_kernel.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 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:js_runtime/shared/embedded_names.dart'; 7 import 'package:js_runtime/shared/embedded_names.dart';
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 5351 matching lines...) Expand 10 before | Expand all | Expand 10 after
5362 */ 5362 */
5363 JumpHandler createJumpHandler(ast.Statement node, {bool isLoopJump}) { 5363 JumpHandler createJumpHandler(ast.Statement node, {bool isLoopJump}) {
5364 JumpTarget element = elements.getTargetDefinition(node); 5364 JumpTarget element = elements.getTargetDefinition(node);
5365 if (element == null || !identical(element.statement, node)) { 5365 if (element == null || !identical(element.statement, node)) {
5366 // No breaks or continues to this node. 5366 // No breaks or continues to this node.
5367 return new NullJumpHandler(reporter); 5367 return new NullJumpHandler(reporter);
5368 } 5368 }
5369 if (isLoopJump && node is ast.SwitchStatement) { 5369 if (isLoopJump && node is ast.SwitchStatement) {
5370 // Create a special jump handler for loops created for switch statements 5370 // Create a special jump handler for loops created for switch statements
5371 // with continue statements. 5371 // with continue statements.
5372 return new SwitchCaseJumpHandler(this, element, node); 5372 return new AstSwitchCaseJumpHandler(this, element, node);
5373 } 5373 }
5374 return new JumpHandler(this, element); 5374 return new JumpHandler(this, element);
5375 } 5375 }
5376 5376
5377 visitAsyncForIn(ast.AsyncForIn node) { 5377 visitAsyncForIn(ast.AsyncForIn node) {
5378 // The async-for is implemented with a StreamIterator. 5378 // The async-for is implemented with a StreamIterator.
5379 HInstruction streamIterator; 5379 HInstruction streamIterator;
5380 5380
5381 visit(node.expression); 5381 visit(node.expression);
5382 HInstruction expression = pop(); 5382 HInstruction expression = pop();
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
6772 this.oldReturnLocal, 6772 this.oldReturnLocal,
6773 this.oldReturnType, 6773 this.oldReturnType,
6774 this.oldResolvedAst, 6774 this.oldResolvedAst,
6775 this.oldStack, 6775 this.oldStack,
6776 this.oldLocalsHandler, 6776 this.oldLocalsHandler,
6777 this.inTryStatement, 6777 this.inTryStatement,
6778 this.allFunctionsCalledOnce, 6778 this.allFunctionsCalledOnce,
6779 this.oldElementInferenceResults) 6779 this.oldElementInferenceResults)
6780 : super(function); 6780 : super(function);
6781 } 6781 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698