From d1e849ef005c63b21d654e316460f16ce9546dc9 Mon Sep 17 00:00:00 2001 From: Jaroslav Sevcik Date: Fri, 12 Apr 2019 11:34:03 +0200 Subject: [PATCH] Expose the bytecode limit for optimization as a flag Bug: v8:9119, v8:8598 Change-Id: Ia4765c19e60b58d938fe778776ee654b60631e39 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564203 Commit-Queue: Jaroslav Sevcik Reviewed-by: Benedikt Meurer Cr-Commit-Position: refs/heads/master@{#60808} --- src/compiler/pipeline.cc | 7 +------ src/flag-definitions.h | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc index 774f5aa5ee..95c066aeaf 100644 --- a/src/compiler/pipeline.cc +++ b/src/compiler/pipeline.cc @@ -94,11 +94,6 @@ namespace v8 { namespace internal { namespace compiler { -// TurboFan can only handle 2^16 control inputs. Since each control flow split -// requires at least two bytes (jump and offset), we limit the bytecode size -// to 60KiB bytes. -const int kMaxBytecodeSizeForTurbofan = 60 * KB; - class PipelineData { public: // For main entry point. @@ -924,7 +919,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl( this, TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "function", compilation_info()->shared_info()->TraceIDRef()); if (compilation_info()->bytecode_array()->length() > - kMaxBytecodeSizeForTurbofan) { + FLAG_max_optimized_bytecode_size) { return AbortOptimization(BailoutReason::kFunctionTooBig); } diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 0d52838484..a517635388 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -500,6 +500,10 @@ DEFINE_FLOAT(reserve_inline_budget_scale_factor, 1.2, "maximum cumulative size of bytecode considered for inlining") DEFINE_INT(max_inlined_bytecode_size_small, 30, "maximum size of bytecode considered for small function inlining") +DEFINE_INT(max_optimized_bytecode_size, 60 * KB, + "maximum bytecode size to " + "be considered for optimization; too high values may cause " + "the compiler to hit (release) assertions") DEFINE_FLOAT(min_inlining_frequency, 0.15, "minimum frequency for inlining") DEFINE_BOOL(polymorphic_inlining, true, "polymorphic inlining") DEFINE_BOOL(stress_inline, false,