Skip to content

Commit 7779ff0

Browse files
victorgomesV8 LUCI CQ
authored andcommitted
[flag] Remove --always-turbofan
Bug: 431974094 Change-Id: Ia86d64cf626db0977299f8ec105f86ee4f385e7c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6781181 Reviewed-by: Marja Hölttä <[email protected]> Auto-Submit: Victor Gomes <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/heads/main@{#101612}
1 parent abadc63 commit 7779ff0

46 files changed

Lines changed: 116 additions & 416 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/codegen/compiler.cc

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,34 +3059,6 @@ bool Compiler::Compile(Isolate* isolate, DirectHandle<JSFunction> function,
30593059

30603060
function->UpdateCode(isolate, *code);
30613061

3062-
// Optimize now if --always-turbofan is enabled.
3063-
#if V8_ENABLE_WEBASSEMBLY
3064-
if (v8_flags.always_turbofan && !function->shared()->HasAsmWasmData()) {
3065-
#else
3066-
if (v8_flags.always_turbofan) {
3067-
#endif // V8_ENABLE_WEBASSEMBLY
3068-
DCHECK(!function->tiering_in_progress());
3069-
CompilerTracer::TraceOptimizeForAlwaysOpt(isolate, function,
3070-
CodeKindForTopTier());
3071-
3072-
const CodeKind code_kind = CodeKindForTopTier();
3073-
const ConcurrencyMode concurrency_mode = ConcurrencyMode::kSynchronous;
3074-
3075-
if (v8_flags.stress_concurrent_inlining &&
3076-
isolate->concurrent_recompilation_enabled() &&
3077-
isolate->node_observer() == nullptr) {
3078-
SpawnDuplicateConcurrentJobForStressTesting(isolate, function,
3079-
concurrency_mode, code_kind);
3080-
}
3081-
3082-
DirectHandle<Code> maybe_code;
3083-
if (GetOrCompileOptimized(isolate, function, concurrency_mode, code_kind)
3084-
.ToHandle(&maybe_code)) {
3085-
code = maybe_code;
3086-
function->UpdateOptimizedCode(isolate, *code);
3087-
}
3088-
}
3089-
30903062
// Install a feedback vector if necessary.
30913063
if (code->kind() == CodeKind::BASELINE) {
30923064
JSFunction::EnsureFeedbackVector(isolate, function, is_compiled_scope);
@@ -3247,13 +3219,8 @@ void Compiler::CompileOptimized(Isolate* isolate,
32473219
DCHECK_IMPLIES(function->IsTieringRequestedOrInProgress() &&
32483220
!function->IsLoggingRequested(isolate),
32493221
function->tiering_in_progress());
3250-
if (!v8_flags.always_turbofan) {
3251-
// Before a maglev optimization job is started we might have to compile
3252-
// bytecode. This can trigger a turbofan compilation if always_turbofan is
3253-
// set. Therefore we need to skip this dcheck in that case.
3254-
DCHECK_IMPLIES(!tiering_was_in_progress && function->tiering_in_progress(),
3255-
function->ChecksTieringState(isolate));
3256-
}
3222+
DCHECK_IMPLIES(!tiering_was_in_progress && function->tiering_in_progress(),
3223+
function->ChecksTieringState(isolate));
32573224
DCHECK_IMPLIES(!tiering_was_in_progress && function->tiering_in_progress(),
32583225
IsConcurrent(mode));
32593226
#endif // DEBUG
@@ -4603,15 +4570,6 @@ void Compiler::PostInstantiation(Isolate* isolate,
46034570
}
46044571
}
46054572
#endif // !V8_ENABLE_LEAPTIERING
4606-
4607-
if (v8_flags.always_turbofan && shared->allows_lazy_compilation() &&
4608-
!shared->optimization_disabled(CodeKind::TURBOFAN_JS) &&
4609-
!function->HasAvailableOptimizedCode(isolate)) {
4610-
CompilerTracer::TraceMarkForAlwaysOpt(isolate, function);
4611-
JSFunction::EnsureFeedbackVector(isolate, function, is_compiled_scope);
4612-
function->RequestOptimization(isolate, CodeKind::TURBOFAN_JS,
4613-
ConcurrencyMode::kSynchronous);
4614-
}
46154573
}
46164574

46174575
if (shared->is_toplevel() || shared->is_wrapped()) {

src/compiler/js-intrinsic-lowering.cc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,11 @@ Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) {
264264
}
265265

266266
Reduction JSIntrinsicLowering::ReduceTurbofanStaticAssert(Node* node) {
267-
if (v8_flags.always_turbofan) {
268-
// Ignore static asserts, as we most likely won't have enough information
269-
RelaxEffectsAndControls(node);
270-
} else {
271-
Node* value = NodeProperties::GetValueInput(node, 0);
272-
Node* effect = NodeProperties::GetEffectInput(node);
273-
Node* assert = graph()->NewNode(
274-
common()->StaticAssert("%TurbofanStaticAssert"), value, effect);
275-
ReplaceWithValue(node, node, assert, nullptr);
276-
}
267+
Node* value = NodeProperties::GetValueInput(node, 0);
268+
Node* effect = NodeProperties::GetEffectInput(node);
269+
Node* assert = graph()->NewNode(
270+
common()->StaticAssert("%TurbofanStaticAssert"), value, effect);
271+
ReplaceWithValue(node, node, assert, nullptr);
277272
return Changed(jsgraph_->UndefinedConstant());
278273
}
279274

src/compiler/pipeline.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,9 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl(
707707
v8_flags.max_optimized_bytecode_size) {
708708
return AbortOptimization(BailoutReason::kFunctionTooBig);
709709
}
710-
711-
if (!v8_flags.always_turbofan) {
712-
compilation_info()->set_bailout_on_uninitialized();
713-
}
710+
// TODO(victorgomes): We can remove this compilation option. This should
711+
// always be true.
712+
compilation_info()->set_bailout_on_uninitialized();
714713
if (v8_flags.turbo_loop_peeling) {
715714
compilation_info()->set_loop_peeling();
716715
}

src/flags/flag-definitions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,8 +2722,6 @@ DEFINE_BOOL(trace_deopt_verbose, false, "extra verbose deoptimization tracing")
27222722
DEFINE_IMPLICATION(trace_deopt_verbose, trace_deopt)
27232723
DEFINE_BOOL(trace_file_names, false,
27242724
"include file names in trace-opt/trace-deopt output")
2725-
DEFINE_BOOL(always_turbofan, false, "always try to optimize functions")
2726-
DEFINE_IMPLICATION(always_turbofan, turbofan)
27272725
DEFINE_BOOL(always_osr, false, "always try to OSR functions")
27282726

27292727
DEFINE_BOOL(trace_serializer, false, "print code serializer trace")

src/flags/flags.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,10 +1113,6 @@ void FlagList::ResolveContradictionsWhenFuzzing() {
11131113
CONTRADICTION(always_osr_from_maglev, lite_mode),
11141114
CONTRADICTION(always_osr_from_maglev, turbofan),
11151115
CONTRADICTION(always_osr_from_maglev, turboshaft),
1116-
CONTRADICTION(always_turbofan, disable_optimizing_compilers),
1117-
CONTRADICTION(always_turbofan, jitless),
1118-
CONTRADICTION(always_turbofan, lite_mode),
1119-
CONTRADICTION(always_turbofan, turboshaft),
11201116
CONTRADICTION(assert_types, stress_concurrent_inlining),
11211117
CONTRADICTION(assert_types, stress_concurrent_inlining_attach_code),
11221118
CONTRADICTION(disable_optimizing_compilers, maglev_future),

src/interpreter/bytecode-flags-and-tokens.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ uint8_t CreateObjectLiteralFlags::Encode(int runtime_flags,
2929
}
3030

3131
// static
32-
uint8_t CreateClosureFlags::Encode(bool pretenure, bool is_function_scope,
33-
bool might_always_turbofan) {
32+
uint8_t CreateClosureFlags::Encode(bool pretenure, bool is_function_scope) {
3433
uint8_t result = PretenuredBit::encode(pretenure);
35-
if (!might_always_turbofan && !pretenure && is_function_scope) {
34+
if (!pretenure && is_function_scope) {
3635
result |= FastNewClosureBit::encode(true);
3736
}
3837
return result;

src/interpreter/bytecode-flags-and-tokens.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ class CreateClosureFlags {
4444
using PretenuredBit = base::BitField8<bool, 0, 1>;
4545
using FastNewClosureBit = PretenuredBit::Next<bool, 1>;
4646

47-
static uint8_t Encode(bool pretenure, bool is_function_scope,
48-
bool might_always_turbofan);
47+
static uint8_t Encode(bool pretenure, bool is_function_scope);
4948

5049
private:
5150
DISALLOW_IMPLICIT_CONSTRUCTORS(CreateClosureFlags);

src/interpreter/bytecode-generator.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,8 +3283,7 @@ void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
32833283
expr->function_literal_id());
32843284
DCHECK_EQ(expr->scope()->outer_scope(), current_scope());
32853285
uint8_t flags = CreateClosureFlags::Encode(
3286-
expr->pretenure(), closure_scope()->is_function_scope(),
3287-
info()->flags().might_always_turbofan());
3286+
expr->pretenure(), closure_scope()->is_function_scope());
32883287
size_t entry = builder()->AllocateDeferredConstantPoolEntry();
32893288
builder()->CreateClosure(entry, GetCachedCreateClosureSlot(expr), flags);
32903289
function_literals_.push_back(std::make_pair(expr, entry));
@@ -3844,7 +3843,7 @@ void BytecodeGenerator::VisitNativeFunctionLiteral(
38443843
// kDontAdaptArgumentsSentinel as their parameter count.
38453844
int index = feedback_spec()->AddCreateClosureParameterCount(
38463845
kDontAdaptArgumentsSentinel);
3847-
uint8_t flags = CreateClosureFlags::Encode(false, false, false);
3846+
uint8_t flags = CreateClosureFlags::Encode(false, false);
38483847
builder()->CreateClosure(entry, index, flags);
38493848
native_function_literals_.push_back(std::make_pair(expr, entry));
38503849
}

src/objects/js-function.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void JSFunction::InitializeFeedbackCell(
760760
}
761761

762762
const bool needs_feedback_vector =
763-
!v8_flags.lazy_feedback_allocation || v8_flags.always_turbofan ||
763+
!v8_flags.lazy_feedback_allocation ||
764764
// We also need a feedback vector for certain log events, collecting type
765765
// profile and more precise code coverage.
766766
v8_flags.log_function_events ||

src/parsing/parse-info.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ UnoptimizedCompileFlags::UnoptimizedCompileFlags(Isolate* isolate,
3030
parsing_while_debugging_(ParsingWhileDebugging::kNo) {
3131
set_coverage_enabled(!isolate->is_best_effort_code_coverage());
3232
set_block_coverage_enabled(isolate->is_block_code_coverage());
33-
set_might_always_turbofan(v8_flags.always_turbofan);
3433
set_allow_natives_syntax(v8_flags.allow_natives_syntax);
3534
set_allow_lazy_compile(true);
3635
set_collect_source_positions(!v8_flags.enable_lazy_source_positions ||

0 commit comments

Comments
 (0)