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

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

Issue 1474713002: dart2js cps: Clean up and avoid processing unreachable code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years 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 | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | tests/language/language_dart2js.status » ('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) 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 10
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 457 }
458 458
459 String visitNot(Not node) { 459 String visitNot(Not node) {
460 String operand = visitExpression(node.operand); 460 String operand = visitExpression(node.operand);
461 if (usesInfixNotation(node.operand)) { 461 if (usesInfixNotation(node.operand)) {
462 operand = '($operand)'; 462 operand = '($operand)';
463 } 463 }
464 return '!$operand'; 464 return '!$operand';
465 } 465 }
466 466
467 String visitFunctionExpression(FunctionExpression node) {
468 return "function ${node.definition.element.name}";
469 }
470
471 String visitGetField(GetField node) { 467 String visitGetField(GetField node) {
472 String object = visitExpression(node.object); 468 String object = visitExpression(node.object);
473 String field = node.field.name; 469 String field = node.field.name;
474 if (usesInfixNotation(node.object)) { 470 if (usesInfixNotation(node.object)) {
475 object = '($object)'; 471 object = '($object)';
476 } 472 }
477 return '$object.$field'; 473 return '$object.$field';
478 } 474 }
479 475
480 String visitSetField(SetField node) { 476 String visitSetField(SetField node) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 String prefix = v.element == null ? 'v' : '${v.element.name}_'; 610 String prefix = v.element == null ? 'v' : '${v.element.name}_';
615 while (name == null || _usedNames.contains(name)) { 611 while (name == null || _usedNames.contains(name)) {
616 name = "$prefix${_counter++}"; 612 name = "$prefix${_counter++}";
617 } 613 }
618 _names[v] = name; 614 _names[v] = name;
619 _usedNames.add(name); 615 _usedNames.add(name);
620 } 616 }
621 return name; 617 return name;
622 } 618 }
623 } 619 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698