Skip to content

Commit e3e8ea5

Browse files
camillobruniV8 LUCI CQ
authored andcommitted
[flags] Rename --opt to --turbofan
To be consistent with the all the other tiers and avoid confusion, we rename --opt to ---turbofan, and --always-opt to --always-turbofan. Change-Id: Ie23dc8282b3fb4cf2fbf73b6c3d5264de5d09718 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3610431 Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Camillo Bruni <[email protected]> Reviewed-by: Jakob Linke <[email protected]> Cr-Commit-Position: refs/heads/main@{#80336}
1 parent 1242b69 commit e3e8ea5

482 files changed

Lines changed: 816 additions & 803 deletions

File tree

Some content is hidden

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

BUILD.gn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ config("toolchain") {
14761476

14771477
# For code that is hot during mksnapshot. In fast-mksnapshot builds, we
14781478
# optimize some files even in debug builds to speed up mksnapshot times.
1479-
config("always_optimize") {
1479+
config("always_turbofanimize") {
14801480
configs = [ ":internal_config" ]
14811481

14821482
# TODO(crbug.com/621335) Rework this so that we don't have the confusion
@@ -4043,7 +4043,7 @@ v8_source_set("v8_compiler_opt") {
40434043
if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
40444044
# The :no_optimize config is added to v8_add_configs in v8.gni.
40454045
remove_configs = [ "//build/config/compiler:no_optimize" ]
4046-
configs = [ ":always_optimize" ]
4046+
configs = [ ":always_turbofanimize" ]
40474047
} else {
40484048
# Without this else branch, gn fails to generate build files for non-debug
40494049
# builds (because we try to remove a config that is not present).
@@ -5106,7 +5106,7 @@ v8_source_set("torque_base") {
51065106
if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
51075107
# The :no_optimize config is added to v8_add_configs in v8.gni.
51085108
remove_configs += [ "//build/config/compiler:no_optimize" ]
5109-
configs += [ ":always_optimize" ]
5109+
configs += [ ":always_turbofanimize" ]
51105110
}
51115111
}
51125112

src/codegen/compiler.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class CompilerTracer : public AllStatic {
201201
if (!FLAG_trace_opt) return;
202202
CodeTracer::Scope scope(isolate->GetCodeTracer());
203203
PrintTracePrefix(scope, "optimizing", function, code_kind);
204-
PrintF(scope.file(), " because --always-opt");
204+
PrintF(scope.file(), " because --always-turbofan");
205205
PrintTraceSuffix(scope);
206206
}
207207

@@ -211,7 +211,8 @@ class CompilerTracer : public AllStatic {
211211
CodeTracer::Scope scope(isolate->GetCodeTracer());
212212
PrintF(scope.file(), "[marking ");
213213
function->ShortPrint(scope.file());
214-
PrintF(scope.file(), " for optimized recompilation because --always-opt");
214+
PrintF(scope.file(),
215+
" for optimized recompilation because --always-turbofan");
215216
PrintF(scope.file(), "]\n");
216217
}
217218

@@ -1060,7 +1061,7 @@ bool ShouldOptimize(CodeKind code_kind, Handle<SharedFunctionInfo> shared) {
10601061
DCHECK(CodeKindIsOptimizedJSFunction(code_kind));
10611062
switch (code_kind) {
10621063
case CodeKind::TURBOFAN:
1063-
return FLAG_opt && shared->PassesFilter(FLAG_turbo_filter);
1064+
return FLAG_turbofan && shared->PassesFilter(FLAG_turbo_filter);
10641065
case CodeKind::MAGLEV:
10651066
return FLAG_maglev && shared->PassesFilter(FLAG_maglev_filter);
10661067
default:
@@ -2067,11 +2068,11 @@ bool Compiler::Compile(Isolate* isolate, Handle<JSFunction> function,
20672068
// immediately after a flush would be better.
20682069
JSFunction::InitializeFeedbackCell(function, is_compiled_scope, true);
20692070

2070-
// Optimize now if --always-opt is enabled.
2071+
// Optimize now if --always-turbofan is enabled.
20712072
#if V8_ENABLE_WEBASSEMBLY
2072-
if (FLAG_always_opt && !function->shared().HasAsmWasmData()) {
2073+
if (FLAG_always_turbofan && !function->shared().HasAsmWasmData()) {
20732074
#else
2074-
if (FLAG_always_opt) {
2075+
if (FLAG_always_turbofan) {
20752076
#endif // V8_ENABLE_WEBASSEMBLY
20762077
CompilerTracer::TraceOptimizeForAlwaysOpt(isolate, function,
20772078
CodeKindForTopTier());
@@ -3484,7 +3485,7 @@ void Compiler::PostInstantiation(Handle<JSFunction> function) {
34843485
}
34853486
}
34863487

3487-
if (FLAG_always_opt && shared->allows_lazy_compilation() &&
3488+
if (FLAG_always_turbofan && shared->allows_lazy_compilation() &&
34883489
!shared->optimization_disabled() &&
34893490
!function->HasAvailableOptimizedCode()) {
34903491
CompilerTracer::TraceMarkForAlwaysOpt(isolate, function);

src/compiler/js-intrinsic-lowering.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Reduction JSIntrinsicLowering::ReduceIsJSReceiver(Node* node) {
279279
}
280280

281281
Reduction JSIntrinsicLowering::ReduceTurbofanStaticAssert(Node* node) {
282-
if (FLAG_always_opt) {
282+
if (FLAG_always_turbofan) {
283283
// Ignore static asserts, as we most likely won't have enough information
284284
RelaxEffectsAndControls(node);
285285
} else {

src/compiler/pipeline.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl(
11691169
return AbortOptimization(BailoutReason::kFunctionTooBig);
11701170
}
11711171

1172-
if (!FLAG_always_opt) {
1172+
if (!FLAG_always_turbofan) {
11731173
compilation_info()->set_bailout_on_uninitialized();
11741174
}
11751175
if (FLAG_turbo_loop_peeling) {

src/d8/d8.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4491,7 +4491,7 @@ void PreProcessUnicodeFilenameArg(char* argv[], int i) {
44914491

44924492
bool Shell::SetOptions(int argc, char* argv[]) {
44934493
bool logfile_per_isolate = false;
4494-
bool no_always_opt = false;
4494+
bool no_always_turbofan = false;
44954495
options.d8_path = argv[0];
44964496
for (int i = 0; i < argc; i++) {
44974497
if (strcmp(argv[i], "--") == 0) {
@@ -4514,9 +4514,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
45144514
strcmp(argv[i], "--no-stress-opt") == 0) {
45154515
options.stress_opt = false;
45164516
argv[i] = nullptr;
4517-
} else if (strcmp(argv[i], "--noalways-opt") == 0 ||
4518-
strcmp(argv[i], "--no-always-opt") == 0) {
4519-
no_always_opt = true;
4517+
} else if (strcmp(argv[i], "--noalways-turbofan") == 0 ||
4518+
strcmp(argv[i], "--no-always-turbofan") == 0) {
4519+
no_always_turbofan = true;
45204520
} else if (strcmp(argv[i], "--fuzzing") == 0 ||
45214521
strcmp(argv[i], "--no-abort-on-contradictory-flags") == 0 ||
45224522
strcmp(argv[i], "--noabort-on-contradictory-flags") == 0) {
@@ -4722,8 +4722,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
47224722
}
47234723
}
47244724

4725-
if (options.stress_opt && no_always_opt && check_d8_flag_contradictions) {
4726-
FATAL("Flag --no-always-opt is incompatible with --stress-opt.");
4725+
if (options.stress_opt && no_always_turbofan &&
4726+
check_d8_flag_contradictions) {
4727+
FATAL("Flag --no-always-turbofan is incompatible with --stress-opt.");
47274728
}
47284729

47294730
const char* usage =
@@ -5271,15 +5272,15 @@ class D8Testing {
52715272
*/
52725273
static void PrepareStressRun(int run) {
52735274
static const char* kLazyOptimizations =
5274-
"--prepare-always-opt "
5275+
"--prepare-always-turbofan "
52755276
"--max-inlined-bytecode-size=999999 "
52765277
"--max-inlined-bytecode-size-cumulative=999999 "
5277-
"--noalways-opt";
5278+
"--noalways-turbofan";
52785279

52795280
if (run == 0) {
52805281
V8::SetFlagsFromString(kLazyOptimizations);
52815282
} else if (run == GetStressRuns() - 1) {
5282-
i::FLAG_always_opt = true;
5283+
i::FLAG_always_turbofan = true;
52835284
}
52845285
}
52855286

src/execution/isolate.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4380,7 +4380,7 @@ CodeTracer* Isolate::GetCodeTracer() {
43804380

43814381
bool Isolate::use_optimizer() {
43824382
// TODO(v8:7700): Update this predicate for a world with multiple tiers.
4383-
return (FLAG_opt || FLAG_maglev) && !serializer_enabled_ &&
4383+
return (FLAG_turbofan || FLAG_maglev) && !serializer_enabled_ &&
43844384
CpuFeatures::SupportsOptimizer() && !is_precise_count_code_coverage();
43854385
}
43864386

src/flags/flag-definitions.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ DEFINE_BOOL(jitless, V8_LITE_BOOL,
537537
"Disable runtime allocation of executable memory.")
538538

539539
// Jitless V8 has a few implications:
540-
DEFINE_NEG_IMPLICATION(jitless, opt)
540+
DEFINE_NEG_IMPLICATION(jitless, turbofan)
541541
// Field type tracking is only used by TurboFan.
542542
DEFINE_NEG_IMPLICATION(jitless, track_field_types)
543543
// Regexps are interpreted.
@@ -787,7 +787,8 @@ DEFINE_INT(deopt_every_n_times, 0,
787787
DEFINE_BOOL(print_deopt_stress, false, "print number of possible deopt points")
788788

789789
// Flags for TurboFan.
790-
DEFINE_BOOL(opt, true, "use adaptive optimizations")
790+
DEFINE_BOOL(turbofan, true, "use adaptive optimizations")
791+
791792
DEFINE_BOOL(turbo_sp_frame_access, false,
792793
"use stack pointer-relative access to frame wherever possible")
793794
DEFINE_BOOL(
@@ -1563,10 +1564,10 @@ DEFINE_BOOL(trace_deopt_verbose, false, "extra verbose deoptimization tracing")
15631564
DEFINE_IMPLICATION(trace_deopt_verbose, trace_deopt)
15641565
DEFINE_BOOL(trace_file_names, false,
15651566
"include file names in trace-opt/trace-deopt output")
1566-
DEFINE_BOOL(always_opt, false, "always try to optimize functions")
1567-
DEFINE_IMPLICATION(always_opt, opt)
1567+
DEFINE_BOOL(always_turbofan, false, "always try to optimize functions")
1568+
DEFINE_IMPLICATION(always_turbofan, turbofan)
15681569
DEFINE_BOOL(always_osr, false, "always try to OSR functions")
1569-
DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
1570+
DEFINE_BOOL(prepare_always_turbofan, false, "prepare for turning on always opt")
15701571

15711572
DEFINE_BOOL(trace_serializer, false, "print code serializer trace")
15721573
#ifdef DEBUG

src/interpreter/bytecode-flags.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ uint8_t CreateObjectLiteralFlags::Encode(int runtime_flags,
3131

3232
// static
3333
uint8_t CreateClosureFlags::Encode(bool pretenure, bool is_function_scope,
34-
bool might_always_opt) {
34+
bool might_always_turbofan) {
3535
uint8_t result = PretenuredBit::encode(pretenure);
36-
if (!might_always_opt && !pretenure && is_function_scope) {
36+
if (!might_always_turbofan && !pretenure && is_function_scope) {
3737
result |= FastNewClosureBit::encode(true);
3838
}
3939
return result;

src/interpreter/bytecode-flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CreateClosureFlags {
4545
using FastNewClosureBit = PretenuredBit::Next<bool, 1>;
4646

4747
static uint8_t Encode(bool pretenure, bool is_function_scope,
48-
bool might_always_opt);
48+
bool might_always_turbofan);
4949

5050
private:
5151
DISALLOW_IMPLICIT_CONSTRUCTORS(CreateClosureFlags);

src/interpreter/bytecode-generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
25202520
DCHECK_EQ(expr->scope()->outer_scope(), current_scope());
25212521
uint8_t flags = CreateClosureFlags::Encode(
25222522
expr->pretenure(), closure_scope()->is_function_scope(),
2523-
info()->flags().might_always_opt());
2523+
info()->flags().might_always_turbofan());
25242524
size_t entry = builder()->AllocateDeferredConstantPoolEntry();
25252525
builder()->CreateClosure(entry, GetCachedCreateClosureSlot(expr), flags);
25262526
function_literals_.push_back(std::make_pair(expr, entry));

0 commit comments

Comments
 (0)