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

Unified 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: Update test expectations. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart b/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
index 98893f8630bc428eeee63f59cefd720693a1d612..b5482ce8f005103df3fa437f79ba5d47594fd8fb 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/js_tree_builder.dart
@@ -78,4 +78,24 @@ class JsTreeBuilder extends Builder {
return new CreateInvocationMirror(node.selector,
node.arguments.map(getVariableUse).toList(growable: false));
}
+
+ Statement visitForeignCode(cps_ir.ForeignCode node) {
+ if (node.codeTemplate.isExpression) {
+ Expression foreignCode = new ForeignExpression(
+ node.codeTemplate,
+ node.type,
+ node.arguments.map(getVariableUse).toList(growable: false),
+ node.nativeBehavior,
+ node.dependency);
+ return continueWithExpression(node.continuation, foreignCode);
+ } else {
+ assert(node.continuation == null);
+ return new ForeignStatement(
+ node.codeTemplate,
+ node.type,
+ node.arguments.map(getVariableUse).toList(growable: false),
+ node.nativeBehavior,
+ node.dependency);
+ }
+ }
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698