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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart

Issue 1253333002: dart2js cps: Support async/await by rewriting the JavaScript AST. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add issue number to status file. Created 5 years, 4 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
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 dart2js.ir_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import 'cps_ir_nodes.dart' as cps_ir hide Function; 8 import 'cps_ir_nodes.dart' as cps_ir hide Function;
9 import '../tracer.dart'; 9 import '../tracer.dart';
10 10
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 String index = formatReference(node.index); 375 String index = formatReference(node.index);
376 return 'GetIndex $object $index'; 376 return 'GetIndex $object $index';
377 } 377 }
378 378
379 visitSetIndex(cps_ir.SetIndex node) { 379 visitSetIndex(cps_ir.SetIndex node) {
380 String object = formatReference(node.object); 380 String object = formatReference(node.object);
381 String index = formatReference(node.index); 381 String index = formatReference(node.index);
382 String value = formatReference(node.value); 382 String value = formatReference(node.value);
383 return 'SetIndex $object $index $value'; 383 return 'SetIndex $object $index $value';
384 } 384 }
385
386 @override
387 visitAwait(cps_ir.Await node) {
388 String value = formatReference(node.input);
389 String continuation = formatReference(node.continuation);
390 return 'Await $value $continuation';
391 }
385 } 392 }
386 393
387 /** 394 /**
388 * Invents (and remembers) names for Continuations, Parameters, etc. 395 * Invents (and remembers) names for Continuations, Parameters, etc.
389 * The names must match the conventions used by IR Hydra, e.g. 396 * The names must match the conventions used by IR Hydra, e.g.
390 * Continuations and Functions must have names of form B### since they 397 * Continuations and Functions must have names of form B### since they
391 * are visualized as basic blocks. 398 * are visualized as basic blocks.
392 */ 399 */
393 class Names { 400 class Names {
394 final Map<Object, String> names = {}; 401 final Map<Object, String> names = {};
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 } 653 }
647 654
648 visitSetStatic(cps_ir.SetStatic node) { 655 visitSetStatic(cps_ir.SetStatic node) {
649 unexpectedNode(node); 656 unexpectedNode(node);
650 } 657 }
651 658
652 @override 659 @override
653 visitForeignCode(cps_ir.ForeignCode node) { 660 visitForeignCode(cps_ir.ForeignCode node) {
654 addEdgeToContinuation(node.continuation); 661 addEdgeToContinuation(node.continuation);
655 } 662 }
663
664 @override
665 visitAwait(cps_ir.Await node) {
666 unexpectedNode(node);
667 }
656 } 668 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698