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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.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 js_tree_ir_builder; 5 library js_tree_ir_builder;
6 6
7 import '../../tree_ir/tree_ir_builder.dart' show Builder; 7 import '../../tree_ir/tree_ir_builder.dart' show Builder;
8 import 'glue.dart' show Glue; 8 import 'glue.dart' show Glue;
9 import '../../dart2jslib.dart' show Selector, InternalErrorFunction; 9 import '../../dart2jslib.dart' show Selector, InternalErrorFunction;
10 import '../../elements/elements.dart'; 10 import '../../elements/elements.dart';
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return new CreateInstance( 71 return new CreateInstance(
72 node.classElement, 72 node.classElement,
73 node.arguments.map(getVariableUse).toList(growable: false), 73 node.arguments.map(getVariableUse).toList(growable: false),
74 node.typeInformation.map(getVariableUse).toList(growable: false)); 74 node.typeInformation.map(getVariableUse).toList(growable: false));
75 } 75 }
76 76
77 Expression visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { 77 Expression visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) {
78 return new CreateInvocationMirror(node.selector, 78 return new CreateInvocationMirror(node.selector,
79 node.arguments.map(getVariableUse).toList(growable: false)); 79 node.arguments.map(getVariableUse).toList(growable: false));
80 } 80 }
81
82 Statement visitForeignCode(cps_ir.ForeignCode node) {
83 if (node.codeTemplate.isExpression) {
84 Expression foreignCode = new ForeignExpression(
85 node.codeTemplate,
86 node.type,
87 node.arguments.map(getVariableUse).toList(growable: false),
88 node.nativeBehavior,
89 node.dependency);
90 return continueWithExpression(node.continuation, foreignCode);
91 } else {
92 return new ForeignStatement(
93 node.codeTemplate,
94 node.type,
95 node.arguments.map(getVariableUse).toList(growable: false),
96 node.nativeBehavior,
97 node.dependency);
Kevin Millikin (Google) 2015/06/16 11:23:10 You should translate node.continuation in all case
Kevin Millikin (Google) 2015/06/16 11:23:10 We discussed this offline: 1. We should make a di
karlklose 2015/06/18 09:38:15 Acknowledged.
98 }
99 }
81 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698