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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/task.dart

Issue 742023002: Handle named and optional arguments in cps-ir. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix syntax Created 6 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/task.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index b43c51a8bb0c843df1835d908f136cdbb68dce75..ead9946b092b6f9ff3e4a17942d1bc9d81a7306b 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -32,7 +32,9 @@ import '../../constants/expressions.dart';
import '../../constants/values.dart';
class JsBackendTreeBuilder extends tree_builder.Builder {
- JsBackendTreeBuilder(Compiler compiler) : super(compiler);
+ final Glue glue;
+
+ JsBackendTreeBuilder(Compiler compiler, this.glue) : super(compiler);
Selector get identicalSelector {
return new Selector(SelectorKind.CALL, 'identical', null, 2);
@@ -57,7 +59,7 @@ class JsBackendTreeBuilder extends tree_builder.Builder {
tree_ir.Expression value = getVariableReference(node.value);
/// TODO(karlklose): implement the assert(v != null) check.
return new tree_ir.InvokeStatic(
- compiler.identicalFunction,
+ glue.identicalFunction,
identicalSelector,
<tree_ir.Expression>[value, constantTrue]);
}
@@ -68,6 +70,7 @@ class CspFunctionCompiler implements FunctionCompiler {
final IrBuilderTask irBuilderTask;
final ConstantSystem constantSystem;
final Compiler compiler;
+ final Glue glue;
// TODO(karlklose,sigurm): remove and update dart-doc of [compile].
final FunctionCompiler fallbackCompiler;
@@ -79,7 +82,8 @@ class CspFunctionCompiler implements FunctionCompiler {
: irBuilderTask = new IrBuilderTask(compiler),
fallbackCompiler = new ssa.SsaFunctionCompiler(backend, true),
constantSystem = backend.constantSystem,
- compiler = compiler;
+ compiler = compiler,
+ glue = new Glue(compiler);
String get name => 'CPS Ir pipeline';
@@ -157,7 +161,7 @@ class CspFunctionCompiler implements FunctionCompiler {
}
tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) {
- tree_builder.Builder builder = new JsBackendTreeBuilder(compiler);
+ tree_builder.Builder builder = new JsBackendTreeBuilder(compiler, glue);
tree_ir.FunctionDefinition treeNode = builder.build(cpsNode);
assert(treeNode != null);
traceGraph('Tree builder', treeNode);
@@ -183,7 +187,7 @@ class CspFunctionCompiler implements FunctionCompiler {
js.Fun compileToJavaScript(CodegenWorkItem work,
tree_ir.FunctionDefinition definition) {
CodeGenerator codeGen =
- new CodeGenerator(new Glue(compiler), work.registry);
+ new CodeGenerator(glue, work.registry);
karlklose 2014/11/21 10:03:20 Does it fit on one line now?
sigurdm 2014/11/21 10:09:10 Yes
codeGen.buildFunction(definition);
return buildJavaScriptFunction(work.element,
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698