Commit 077e49a1 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[turbofan] Remove duplicated optimization limit.

Before this change we had essentially two optimization limits, one hard
limit in the TurboFan pipeline (128KiB), and a soft limit in the runtime
profiler (60KiB). The hard limit was only relevant to --always-opt and
other internal test infrastructure, and the soft limit was always
enforced on regular JavaScript, but didn't properly disable further
optimization for the function (so for example --trace-opt would
continuesly report attempts to optimize the function).

Now with this change we only have the hard limit, set to 60KiB, in the
TurboFan pipeline and use that consistently.

Bug: v8:8598
Change-Id: I9e2ae7cb67de4a2256d3a7b9c3aee3dab60c2ec1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1538127
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60436}
parent ceb0bea5
......@@ -95,8 +95,8 @@ 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 128K bytes.
const int kMaxBytecodeSizeForTurbofan = 128 * 1024;
// to 60KiB bytes.
const int kMaxBytecodeSizeForTurbofan = 60 * KB;
class PipelineData {
public:
......
......@@ -36,9 +36,6 @@ static const int kOSRBytecodeSizeAllowancePerTick = 48;
// the very first time it is seen on the stack.
static const int kMaxBytecodeSizeForEarlyOpt = 90;
// Certain functions are simply too big to be worth optimizing.
static const int kMaxBytecodeSizeForOpt = 60 * KB;
#define OPTIMIZATION_REASON_LIST(V) \
V(DoNotOptimize, "do not optimize") \
V(HotAndStable, "hot and stable") \
......@@ -188,10 +185,6 @@ bool RuntimeProfiler::MaybeOSR(JSFunction function, InterpretedFrame* frame) {
OptimizationReason RuntimeProfiler::ShouldOptimize(JSFunction function,
BytecodeArray bytecode) {
int ticks = function->feedback_vector()->profiler_ticks();
if (bytecode->length() > kMaxBytecodeSizeForOpt) {
return OptimizationReason::kDoNotOptimize;
}
int ticks_for_optimization =
kProfilerTicksBeforeOptimization +
(bytecode->length() / kBytecodeSizeAllowancePerTick);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment