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

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

Issue 1185633003: cps-ir: Support foreign code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Status file updates. Created 5 years, 6 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { 364 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) {
365 String args = node.arguments.map(formatReference).join(', '); 365 String args = node.arguments.map(formatReference).join(', ');
366 return "CreateInvocationMirror(${node.selector.name}, $args)"; 366 return "CreateInvocationMirror(${node.selector.name}, $args)";
367 } 367 }
368 368
369 visitTypeTest(cps_ir.TypeTest node) { 369 visitTypeTest(cps_ir.TypeTest node) {
370 String value = formatReference(node.value); 370 String value = formatReference(node.value);
371 String args = node.typeArguments.map(formatReference).join(', '); 371 String args = node.typeArguments.map(formatReference).join(', ');
372 return "TypeTest ($value ${node.type} ($args))"; 372 return "TypeTest ($value ${node.type} ($args))";
373 } 373 }
374
375 @override
376 visitForeignCode(cps_ir.ForeignCode node) {
Kevin Millikin (Google) 2015/06/16 11:23:10 Ixpressions get printed on a line by themselves by
karlklose 2015/06/18 09:38:15 Done.
377 String arguments = node.arguments.map(formatReference).join(', ');
378 String continuation = formatReference(node.continuation);
379 return "ForeignCode ${node.type} ${node.codeTemplate} $arguments "
380 "$continuation";
381 }
374 } 382 }
375 383
376 /** 384 /**
377 * Invents (and remembers) names for Continuations, Parameters, etc. 385 * Invents (and remembers) names for Continuations, Parameters, etc.
378 * The names must match the conventions used by IR Hydra, e.g. 386 * The names must match the conventions used by IR Hydra, e.g.
379 * Continuations and Functions must have names of form B### since they 387 * Continuations and Functions must have names of form B### since they
380 * are visualized as basic blocks. 388 * are visualized as basic blocks.
381 */ 389 */
382 class Names { 390 class Names {
383 final Map<Object, String> names = {}; 391 final Map<Object, String> names = {};
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 558
551 // Primitives and conditions are not visited when searching for blocks. 559 // Primitives and conditions are not visited when searching for blocks.
552 unexpectedNode(cps_ir.Node node) { 560 unexpectedNode(cps_ir.Node node) {
553 throw "The IR tracer's block collector reached an unexpected IR " 561 throw "The IR tracer's block collector reached an unexpected IR "
554 "instruction: $node"; 562 "instruction: $node";
555 } 563 }
556 564
557 visitLiteralList(cps_ir.LiteralList node) { 565 visitLiteralList(cps_ir.LiteralList node) {
558 unexpectedNode(node); 566 unexpectedNode(node);
559 } 567 }
568
560 visitLiteralMap(cps_ir.LiteralMap node) { 569 visitLiteralMap(cps_ir.LiteralMap node) {
561 unexpectedNode(node); 570 unexpectedNode(node);
562 } 571 }
572
563 visitConstant(cps_ir.Constant node) { 573 visitConstant(cps_ir.Constant node) {
564 unexpectedNode(node); 574 unexpectedNode(node);
565 } 575 }
576
577
566 visitCreateFunction(cps_ir.CreateFunction node) { 578 visitCreateFunction(cps_ir.CreateFunction node) {
567 unexpectedNode(node); 579 unexpectedNode(node);
568 } 580 }
581
569 visitGetMutableVariable(cps_ir.GetMutableVariable node) { 582 visitGetMutableVariable(cps_ir.GetMutableVariable node) {
570 unexpectedNode(node); 583 unexpectedNode(node);
571 } 584 }
585
572 visitParameter(cps_ir.Parameter node) { 586 visitParameter(cps_ir.Parameter node) {
573 unexpectedNode(node); 587 unexpectedNode(node);
574 } 588 }
589
575 visitMutableVariable(cps_ir.MutableVariable node) { 590 visitMutableVariable(cps_ir.MutableVariable node) {
576 unexpectedNode(node); 591 unexpectedNode(node);
577 } 592 }
593
578 visitGetField(cps_ir.GetField node) { 594 visitGetField(cps_ir.GetField node) {
579 unexpectedNode(node); 595 unexpectedNode(node);
580 } 596 }
597
581 visitGetStatic(cps_ir.GetStatic node) { 598 visitGetStatic(cps_ir.GetStatic node) {
582 unexpectedNode(node); 599 unexpectedNode(node);
583 } 600 }
601
584 visitCreateBox(cps_ir.CreateBox node) { 602 visitCreateBox(cps_ir.CreateBox node) {
585 unexpectedNode(node); 603 unexpectedNode(node);
586 } 604 }
605
587 visitCreateInstance(cps_ir.CreateInstance node) { 606 visitCreateInstance(cps_ir.CreateInstance node) {
588 unexpectedNode(node); 607 unexpectedNode(node);
589 } 608 }
609
590 visitIsTrue(cps_ir.IsTrue node) { 610 visitIsTrue(cps_ir.IsTrue node) {
591 unexpectedNode(node); 611 unexpectedNode(node);
592 } 612 }
613
593 visitIdentical(cps_ir.Identical node) { 614 visitIdentical(cps_ir.Identical node) {
594 unexpectedNode(node); 615 unexpectedNode(node);
595 } 616 }
617
596 visitInterceptor(cps_ir.Interceptor node) { 618 visitInterceptor(cps_ir.Interceptor node) {
597 unexpectedNode(node); 619 unexpectedNode(node);
598 } 620 }
599 621
600 visitReadTypeVariable(cps_ir.ReadTypeVariable node) { 622 visitReadTypeVariable(cps_ir.ReadTypeVariable node) {
601 unexpectedNode(node); 623 unexpectedNode(node);
602 } 624 }
603 625
604 visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { 626 visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) {
605 unexpectedNode(node); 627 unexpectedNode(node);
606 } 628 }
607 629
608 visitTypeExpression(cps_ir.TypeExpression node) { 630 visitTypeExpression(cps_ir.TypeExpression node) {
609 unexpectedNode(node); 631 unexpectedNode(node);
610 } 632 }
611 633
612 visitNonTailThrow(cps_ir.NonTailThrow node) { 634 visitNonTailThrow(cps_ir.NonTailThrow node) {
613 unexpectedNode(node); 635 unexpectedNode(node);
614 } 636 }
615 637
616 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { 638 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) {
617 unexpectedNode(node); 639 unexpectedNode(node);
618 } 640 }
619 641
620 visitTypeTest(cps_ir.TypeTest node) { 642 visitTypeTest(cps_ir.TypeTest node) {
621 unexpectedNode(node); 643 unexpectedNode(node);
622 } 644 }
645
646 @override
647 visitForeignCode(cps_ir.ForeignCode node) {
648 unexpectedNode(node);
Kevin Millikin (Google) 2015/06/16 11:23:10 addEdgeToContinuation(node.continuation);
karlklose 2015/06/18 09:38:14 Done.
649 }
623 } 650 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698