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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 716823002: Set up a stub pipline for using the new cps-based ir to generate js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move IrEnabled to compiler 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/optimize.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler {
8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer;
11
12 SsaFunctionCompiler(JavaScriptBackend backend)
13 : generator = new SsaCodeGeneratorTask(backend),
14 builder = new SsaBuilderTask(backend),
15 optimizer = new SsaOptimizerTask(backend);
16
17 /// Generates JavaScript code for `work.element`.
18 /// Using the ssa builder, optimizer and codegenerator.
19 js.Fun compile(CodegenWorkItem work) {
20 HGraph graph = builder.build(work);
21 optimizer.optimize(work, graph);
22 return generator.generateCode(work, graph);
23 }
24
25 Iterable<CompilerTask> get tasks {
26 return <CompilerTask>[builder, optimizer, generator];
27 }
28 }
29
7 /// A synthetic local variable only used with the SSA graph. 30 /// A synthetic local variable only used with the SSA graph.
8 /// 31 ///
9 /// For instance used for holding return value of function or the exception of a 32 /// For instance used for holding return value of function or the exception of a
10 /// try-catch statement. 33 /// try-catch statement.
11 class SyntheticLocal extends Local { 34 class SyntheticLocal extends Local {
12 final String name; 35 final String name;
13 final ExecutableElement executableContext; 36 final ExecutableElement executableContext;
14 37
15 SyntheticLocal(this.name, this.executableContext); 38 SyntheticLocal(this.name, this.executableContext);
16 } 39 }
(...skipping 6552 matching lines...) Expand 10 before | Expand all | Expand 10 after
6569 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6592 if (unaliased is TypedefType) throw 'unable to unalias $type';
6570 unaliased.accept(this, builder); 6593 unaliased.accept(this, builder);
6571 } 6594 }
6572 6595
6573 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6596 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6574 JavaScriptBackend backend = builder.compiler.backend; 6597 JavaScriptBackend backend = builder.compiler.backend;
6575 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6598 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6576 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 6599 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
6577 } 6600 }
6578 } 6601 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698