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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart

Issue 958603002: Added VariableUse expression to tree IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated docs regarding catch parameters Created 5 years, 9 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
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library tree_ir_tracer; 5 library tree_ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import '../tracer.dart'; 8 import '../tracer.dart';
9 import 'tree_ir_nodes.dart'; 9 import 'tree_ir_nodes.dart';
10 import 'optimization/optimization.dart'; 10 import 'optimization/optimization.dart';
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 String expr(Expression e) { 306 String expr(Expression e) {
307 return e.accept(new SubexpressionVisitor(names)); 307 return e.accept(new SubexpressionVisitor(names));
308 } 308 }
309 } 309 }
310 310
311 class SubexpressionVisitor extends ExpressionVisitor<String> { 311 class SubexpressionVisitor extends ExpressionVisitor<String> {
312 Names names; 312 Names names;
313 313
314 SubexpressionVisitor(this.names); 314 SubexpressionVisitor(this.names);
315 315
316 String visitVariable(Variable node) { 316 String visitVariableUse(VariableUse node) {
317 return names.varName(node); 317 return names.varName(node.variable);
318 } 318 }
319 319
320 String formatArguments(Invoke node) { 320 String formatArguments(Invoke node) {
321 List<String> args = new List<String>(); 321 List<String> args = new List<String>();
322 int positionalArgumentCount = node.selector.positionalArgumentCount; 322 int positionalArgumentCount = node.selector.positionalArgumentCount;
323 for (int i = 0; i < positionalArgumentCount; ++i) { 323 for (int i = 0; i < positionalArgumentCount; ++i) {
324 args.add(node.arguments[i].accept(this)); 324 args.add(node.arguments[i].accept(this));
325 } 325 }
326 for (int i = 0; i < node.selector.namedArgumentCount; ++i) { 326 for (int i = 0; i < node.selector.namedArgumentCount; ++i) {
327 String name = node.selector.namedArguments[i]; 327 String name = node.selector.namedArguments[i];
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 String prefix = v.element == null ? 'v' : '${v.element.name}_'; 484 String prefix = v.element == null ? 'v' : '${v.element.name}_';
485 while (name == null || _usedNames.contains(name)) { 485 while (name == null || _usedNames.contains(name)) {
486 name = "$prefix${_counter++}"; 486 name = "$prefix${_counter++}";
487 } 487 }
488 _names[v] = name; 488 _names[v] = name;
489 _usedNames.add(name); 489 _usedNames.add(name);
490 } 490 }
491 return name; 491 return name;
492 } 492 }
493 } 493 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698