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

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

Issue 10392024: Add a "Label" Node around an Identifier that is being used as a label. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Only use Label nodes for label introductions. Include the colon. 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) 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 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 VariableDefinitions variableDefinitions = node.declaredIdentifier; 2808 VariableDefinitions variableDefinitions = node.declaredIdentifier;
2809 variable = elements[variableDefinitions.definitions.nodes.head]; 2809 variable = elements[variableDefinitions.definitions.nodes.head];
2810 } 2810 }
2811 localsHandler.updateLocal(variable, pop()); 2811 localsHandler.updateLocal(variable, pop());
2812 2812
2813 visit(node.body); 2813 visit(node.body);
2814 } 2814 }
2815 handleLoop(node, buildInitializer, buildCondition, () {}, buildBody); 2815 handleLoop(node, buildInitializer, buildCondition, () {}, buildBody);
2816 } 2816 }
2817 2817
2818 visitLabel(Label node) {
2819 // We visit labels in different roles depending on whether it's a
2820 // label introduction or a label reference, so it's handled by the
2821 // containing statement.
2822 unreachable();
ahe 2012/05/10 11:52:30 I really don't like using this method. You have a
Lasse Reichstein Nielsen 2012/05/10 12:14:20 True, also the comment is no longer valid. Using i
2823 }
2824
2818 visitLabeledStatement(LabeledStatement node) { 2825 visitLabeledStatement(LabeledStatement node) {
2819 Statement body = node.getBody(); 2826 Statement body = node.getBody();
2820 if (body is Loop || body is SwitchStatement) { 2827 if (body is Loop || body is SwitchStatement) {
2821 // Loops and switches handle their own labels. 2828 // Loops and switches handle their own labels.
2822 visit(body); 2829 visit(body);
2823 return; 2830 return;
2824 } 2831 }
2825 // Non-loop statements can only be break targets, not continue targets. 2832 // Non-loop statements can only be break targets, not continue targets.
2826 TargetElement targetElement = elements[body]; 2833 TargetElement targetElement = elements[body];
2827 if (targetElement === null || targetElement.statement !== body) { 2834 if (targetElement === null || targetElement.statement !== body) {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3316 <HInstruction>[target, input], 3323 <HInstruction>[target, input],
3317 HType.STRING)); 3324 HType.STRING));
3318 return builder.pop(); 3325 return builder.pop();
3319 } 3326 }
3320 3327
3321 HInstruction result() { 3328 HInstruction result() {
3322 flushLiterals(); 3329 flushLiterals();
3323 return prefix; 3330 return prefix;
3324 } 3331 }
3325 } 3332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698