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 <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60808}
This commit is contained in:
Jaroslav Sevcik 2019-04-12 11:34:03 +02:00 committed by Commit Bot
parent 48efe388d8
commit d1e849ef00
2 changed files with 5 additions and 6 deletions

View File

@ -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);
}

View File

@ -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,