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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10398044: Reverting 7667 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | lib/compiler/implementation/ssa/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
===================================================================
--- lib/compiler/implementation/ssa/builder.dart (revision 7672)
+++ lib/compiler/implementation/ssa/builder.dart (working copy)
@@ -138,21 +138,19 @@
class SsaBuilderTask extends CompilerTask {
final Interceptors interceptors;
final Map<Node, ClosureData> closureDataCache;
- final CodeEmitterTask emitter;
String get name() => 'SSA builder';
- SsaBuilderTask(JavaScriptBackend backend)
- : interceptors = new Interceptors(backend.compiler),
+ SsaBuilderTask(Compiler compiler)
+ : interceptors = new Interceptors(compiler),
closureDataCache = new HashMap<Node, ClosureData>(),
- emitter = backend.emitter,
- super(backend.compiler);
+ super(compiler);
HGraph build(WorkItem work) {
return measure(() {
FunctionElement element = work.element;
HInstruction.idCounter = 0;
- SsaBuilder builder = new SsaBuilder(this, work);
+ SsaBuilder builder = new SsaBuilder(compiler, work);
HGraph graph;
switch (element.kind) {
case ElementKind.GENERATIVE_CONSTRUCTOR:
@@ -301,7 +299,8 @@
void startFunction(FunctionElement function,
FunctionExpression node) {
- ClosureTranslator translator = new ClosureTranslator(builder);
+ ClosureTranslator translator =
+ new ClosureTranslator(builder.compiler, builder.elements);
closureData = translator.translate(node);
FunctionSignature params = function.computeSignature(builder.compiler);
@@ -768,7 +767,7 @@
}
class SsaBuilder implements Visitor {
- final SsaBuilderTask builder;
+ final Compiler compiler;
TreeElements elements;
final Interceptors interceptors;
final WorkItem work;
@@ -791,13 +790,11 @@
HBasicBlock lastOpenedBlock;
LibraryElement get currentLibrary() => work.element.getLibrary();
- Compiler get compiler() => builder.compiler;
- Emitter get emitter() => builder.emitter;
- SsaBuilder(SsaBuilderTask builder, WorkItem work)
- : this.builder = builder,
+ SsaBuilder(Compiler compiler, WorkItem work)
+ : this.compiler = compiler,
this.work = work,
- interceptors = builder.interceptors,
+ interceptors = compiler.builder.interceptors,
methodInterceptionEnabled = true,
elements = work.resolutionTree,
graph = new HGraph(),
@@ -1476,7 +1473,7 @@
}
visitFunctionExpression(FunctionExpression node) {
- ClosureData nestedClosureData = builder.closureDataCache[node];
+ ClosureData nestedClosureData = compiler.builder.closureDataCache[node];
if (nestedClosureData === null) {
// TODO(floitsch): we can only assume that the reason for not having a
// closure data here is, because the function is inside an initializer.
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | lib/compiler/implementation/ssa/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698