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

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

Issue 1525163002: dart2js cps: Use oneshot interceptors and 'instanceof' expressions. (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
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (node.target.name.isEmpty) { 404 if (node.target.name.isEmpty) {
405 callName = '${className}'; 405 callName = '${className}';
406 } else { 406 } else {
407 callName = '${className}.${node.target.name}'; 407 callName = '${className}.${node.target.name}';
408 } 408 }
409 String args = formatArguments(node); 409 String args = formatArguments(node);
410 String keyword = node.constant != null ? 'const' : 'new'; 410 String keyword = node.constant != null ? 'const' : 'new';
411 return "$keyword $callName($args)"; 411 return "$keyword $callName($args)";
412 } 412 }
413 413
414 String visitOneShotInterceptor(OneShotInterceptor node) {
415 String name = node.selector.name;
416 String args = formatArguments(node);
417 return "oneshot $name($args)";
418 }
419
414 String visitLiteralList(LiteralList node) { 420 String visitLiteralList(LiteralList node) {
415 String values = node.values.map(visitExpression).join(', '); 421 String values = node.values.map(visitExpression).join(', ');
416 return "list [$values]"; 422 return "list [$values]";
417 } 423 }
418 424
419 String visitLiteralMap(LiteralMap node) { 425 String visitLiteralMap(LiteralMap node) {
420 List<String> entries = new List<String>(); 426 List<String> entries = new List<String>();
421 node.entries.forEach((LiteralMapEntry entry) { 427 node.entries.forEach((LiteralMapEntry entry) {
422 String key = visitExpression(entry.key); 428 String key = visitExpression(entry.key);
423 String value = visitExpression(entry.value); 429 String value = visitExpression(entry.value);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 String prefix = v.element == null ? 'v' : '${v.element.name}_'; 626 String prefix = v.element == null ? 'v' : '${v.element.name}_';
621 while (name == null || _usedNames.contains(name)) { 627 while (name == null || _usedNames.contains(name)) {
622 name = "$prefix${_counter++}"; 628 name = "$prefix${_counter++}";
623 } 629 }
624 _names[v] = name; 630 _names[v] = name;
625 _usedNames.add(name); 631 _usedNames.add(name);
626 } 632 }
627 return name; 633 return name;
628 } 634 }
629 } 635 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698