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

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

Issue 1608953002: dart2js: Turn the CPS inlining cache into a general compilation cache. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « pkg/compiler/lib/src/cps_ir/inline.dart ('k') | no next file » | 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 e89c4aee4f063038e50bcb970e9a47ba21df64c1..c0f7243a1483e6eebbb3aadd7f81325bc3c3d470 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -141,8 +141,10 @@ class CpsFunctionCompiler implements FunctionCompiler {
}
cps.FunctionDefinition compileToCpsIr(AstElement element) {
- cps.FunctionDefinition cpsFunction =
- cpsBuilderTask.buildNode(element, typeSystem);
+ cps.FunctionDefinition cpsFunction = inliner.cache.getUnoptimized(element);
+ if (cpsFunction != null) return cpsFunction;
+
+ cpsFunction = cpsBuilderTask.buildNode(element, typeSystem);
if (cpsFunction == null) {
if (cpsBuilderTask.bailoutMessage == null) {
giveUp('unable to build cps definition of $element');
@@ -157,6 +159,11 @@ class CpsFunctionCompiler implements FunctionCompiler {
// insert fewer getInterceptor calls.
applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
applyCpsPass(new UnsugarVisitor(glue), cpsFunction);
+ applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
+ applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+ applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
+
+ inliner.cache.putUnoptimized(element, cpsFunction);
return cpsFunction;
}
@@ -208,9 +215,6 @@ class CpsFunctionCompiler implements FunctionCompiler {
void optimizeCpsBeforeInlining(cps.FunctionDefinition cpsFunction) {
cpsOptimizationTask.measure(() {
- applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
- applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
- applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
applyCpsPass(new TypePropagator(this), cpsFunction);
applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
applyCpsPass(new ShrinkingReducer(), cpsFunction);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/inline.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698