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

Unified Diff: runtime/vm/redundancy_elimination.cc

Issue 2256983002: Temporary fix for OOM in precompilation with very large methods. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/redundancy_elimination.cc
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc
index 32fe07be391a6001033337bcfd889b56779c177e..f7bc9b77c655b6f49491380f6c4680d4f592d191 100644
--- a/runtime/vm/redundancy_elimination.cc
+++ b/runtime/vm/redundancy_elimination.cc
@@ -1549,6 +1549,15 @@ class LoadOptimizer : public ValueObject {
FlowGraphPrinter::PrintGraph("Before LoadOptimizer", graph);
}
+ // For now, bail out for large functions to avoid OOM situations.
+ // TODO(fschneider): Fix the memory consumption issue.
+ intptr_t function_length =
+ graph->function().end_token_pos().Pos() -
+ graph->function().token_pos().Pos();
+ if (function_length >= FLAG_huge_method_cutoff_in_tokens) {
+ return false;
+ }
+
DirectChainedHashMap<PointerKeyValueTrait<Place> > map;
AliasedSet* aliased_set = NumberPlaces(graph, &map, kOptimizeLoads);
if ((aliased_set != NULL) && !aliased_set->IsEmpty()) {
@@ -2514,6 +2523,15 @@ class StoreOptimizer : public LivenessAnalysis {
FlowGraphPrinter::PrintGraph("Before StoreOptimizer", graph);
}
+ // For now, bail out for large functions to avoid OOM situations.
+ // TODO(fschneider): Fix the memory consumption issue.
+ intptr_t function_length =
+ graph->function().end_token_pos().Pos() -
+ graph->function().token_pos().Pos();
+ if (function_length >= FLAG_huge_method_cutoff_in_tokens) {
+ return;
+ }
+
DirectChainedHashMap<PointerKeyValueTrait<Place> > map;
AliasedSet* aliased_set = NumberPlaces(graph, &map, kOptimizeStores);
if ((aliased_set != NULL) && !aliased_set->IsEmpty()) {
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698