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

Unified Diff: lib/compiler/implementation/js_backend/backend.dart

Issue 10854140: Fix type inference for self-recursive functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add method for retreiving generated code for dart2js tests Created 8 years, 4 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/enqueue.dart ('k') | tests/compiler/dart2js/call_site_type_inferer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/js_backend/backend.dart
diff --git a/lib/compiler/implementation/js_backend/backend.dart b/lib/compiler/implementation/js_backend/backend.dart
index 3984bc0de12611a125c84003c06dbdb63b1f8810..b5772286e187d8cca43c5a40c6ee60d831599e3b 100644
--- a/lib/compiler/implementation/js_backend/backend.dart
+++ b/lib/compiler/implementation/js_backend/backend.dart
@@ -31,6 +31,8 @@ class JavaScriptBackend extends Backend {
final Map<SourceString, Map<Selector, InvocationInfo>> invocationInfo;
+ final List<Element> invalidateAfterCodegen;
+
List<CompilerTask> get tasks() {
return <CompilerTask>[builder, optimizer, generator, emitter];
}
@@ -41,6 +43,7 @@ class JavaScriptBackend extends Backend {
fieldConstructorSetters = new Map<Element, Map<Element, HType>>(),
fieldSettersType = new Map<Element, Map<Element, HType>>(),
invocationInfo = new Map<SourceString, Map<Selector, InvocationInfo>>(),
+ invalidateAfterCodegen = new List<Element>(),
super(compiler) {
builder = new SsaBuilderTask(this);
optimizer = new SsaOptimizerTask(this);
@@ -58,7 +61,7 @@ class JavaScriptBackend extends Backend {
}
}
- CodeBuffer codegen(WorkItem work) {
+ void codegen(WorkItem work) {
HGraph graph = builder.build(work);
optimizer.optimize(work, graph);
if (work.allowSpeculativeOptimization
@@ -68,7 +71,11 @@ class JavaScriptBackend extends Backend {
optimizer.prepareForSpeculativeOptimizations(work, graph);
optimizer.optimize(work, graph);
}
- return generator.generateMethod(work, graph);
+ CodeBuffer codeBuffer = generator.generateMethod(work, graph);
+ compiler.codegenWorld.addGeneratedCode(work, codeBuffer);
+ invalidateAfterCodegen.forEach(
+ compiler.enqueuer.codegen.eagerRecompile);
+ invalidateAfterCodegen.clear();
}
void processNativeClasses(Enqueuer world,
@@ -209,8 +216,7 @@ class JavaScriptBackend extends Backend {
// have been compiled under the now invalidated assumptions.
if (typesChanged && info.compiledFunctions.length != 0) {
if (compiler.phase == Compiler.PHASE_COMPILING) {
- info.compiledFunctions.forEach(
- compiler.enqueuer.codegen.eagerRecompile);
+ info.compiledFunctions.forEach(invalidateAfterCodegen.add);
info.compiledFunctions.clear();
}
}
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | tests/compiler/dart2js/call_site_type_inferer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698