| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 16586)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -40,6 +40,8 @@
|
| "instead of showing the corresponding interface names (e.g. \"String\")");
|
| DEFINE_FLAG(bool, trace_disabling_optimized_code, false,
|
| "Trace disabling optimized code.");
|
| +DEFINE_FLAG(int, huge_method_cutoff, 20000,
|
| + "Huge method cutoff: Disables optimizations for huge methods.");
|
| DECLARE_FLAG(bool, trace_compiler);
|
| DECLARE_FLAG(bool, eliminate_type_checks);
|
| DECLARE_FLAG(bool, enable_type_checks);
|
| @@ -3456,7 +3458,8 @@
|
| bool Function::is_optimizable() const {
|
| return OptimizableBit::decode(raw_ptr()->kind_tag_) &&
|
| (script() != Script::null()) &&
|
| - !is_native();
|
| + !is_native() &&
|
| + ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff);
|
| }
|
|
|
|
|
|
|