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

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

Issue 1203353003: dart2js cps: Fix codegen for foreign statements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('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 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 String args = node.arguments.map(formatReference).join(', '); 364 String args = node.arguments.map(formatReference).join(', ');
365 return 'ApplyBuiltinOperator $operator ($args)'; 365 return 'ApplyBuiltinOperator $operator ($args)';
366 } 366 }
367 367
368 @override 368 @override
369 visitForeignCode(cps_ir.ForeignCode node) { 369 visitForeignCode(cps_ir.ForeignCode node) {
370 String id = names.name(node); 370 String id = names.name(node);
371 String arguments = node.arguments.map(formatReference).join(', '); 371 String arguments = node.arguments.map(formatReference).join(', ');
372 String continuation = node.continuation == null ? '' 372 String continuation = node.continuation == null ? ''
373 : ' ${formatReference(node.continuation)}'; 373 : ' ${formatReference(node.continuation)}';
374 printStmt(id, "ForeignCode ${node.type} ${node.codeTemplate} $arguments" 374 printStmt(id, "ForeignCode ${node.type} ${node.codeTemplate.source} "
375 "$continuation"); 375 "$arguments $continuation");
376 } 376 }
377 } 377 }
378 378
379 /** 379 /**
380 * Invents (and remembers) names for Continuations, Parameters, etc. 380 * Invents (and remembers) names for Continuations, Parameters, etc.
381 * The names must match the conventions used by IR Hydra, e.g. 381 * The names must match the conventions used by IR Hydra, e.g.
382 * Continuations and Functions must have names of form B### since they 382 * Continuations and Functions must have names of form B### since they
383 * are visualized as basic blocks. 383 * are visualized as basic blocks.
384 */ 384 */
385 class Names { 385 class Names {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 unexpectedNode(node); 633 unexpectedNode(node);
634 } 634 }
635 635
636 @override 636 @override
637 visitForeignCode(cps_ir.ForeignCode node) { 637 visitForeignCode(cps_ir.ForeignCode node) {
638 if (node.continuation != null) { 638 if (node.continuation != null) {
639 addEdgeToContinuation(node.continuation); 639 addEdgeToContinuation(node.continuation);
640 } 640 }
641 } 641 }
642 } 642 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698