| Index: runtime/vm/code_generator.cc
|
| diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
|
| index bf7508ae716eb06b1fbb7001ab68b7b245856273..47d215c5936f9cd919edee13ceaa25c8f8c21447 100644
|
| --- a/runtime/vm/code_generator.cc
|
| +++ b/runtime/vm/code_generator.cc
|
| @@ -40,6 +40,10 @@ DEFINE_FLAG(int, optimization_counter_threshold, 30000,
|
| DEFINE_FLAG(int, regexp_optimization_counter_threshold, 1000,
|
| "RegExp's usage-counter value before it is optimized, -1 means never");
|
| DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function");
|
| +// TODO(srdjan): Remove this flag once background compilation of regular
|
| +// expressions is possible.
|
| +DEFINE_FLAG(bool, regexp_opt_in_background, false,
|
| + "Optimize reg-exp functions in background");
|
| DEFINE_FLAG(int, reoptimization_counter_threshold, 4000,
|
| "Counter threshold before a function gets reoptimized.");
|
| DEFINE_FLAG(bool, stop_on_excessive_deoptimization, false,
|
| @@ -1490,7 +1494,9 @@ DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
|
| ASSERT(function.HasCode());
|
|
|
| if (CanOptimizeFunction(function, thread)) {
|
| - if (FLAG_background_compilation) {
|
| + // TODO(srdjan): Fix background compilation of regular expressions.
|
| + if (FLAG_background_compilation &&
|
| + (!function.IsIrregexpFunction() || FLAG_regexp_opt_in_background)) {
|
| if (FLAG_enable_inlining_annotations) {
|
| FATAL("Cannot enable inlining annotations and background compilation");
|
| }
|
|
|