Hi all!
I'm analyzing src/deoptimizer/deoptimize-reason.h as part of my own project (building a static analyzer for deoptimization patterns to write lint rules), and came across 9 values in DEOPTIMIZE_REASON_LIST/LAZY_DEOPTIMIZE_REASON_LIST that appear to be unused anywhere in current production code:
ConstTrackingLet, DeprecatedMap, Float16NotYetSupported, NaN, NoCache, NotASeqOneByteString, NotAStringWrapper, SuspendGeneratorIsDead, UnoptimizedCatch.
I didn't just check this superficially — for each one I confirmed two things:
(1) absence in the current HEAD across the full upstream repo (not just my local partial checkout), and (2) a full history search across diff content, to distinguish "never actually wired up" from "was used, then deliberately removed." 5 values (NaN, DeprecatedMap, NoCache, NotAStringWrapper, SuspendGeneratorIsDead) show zero historical triggers at all. The other 4 were genuinely implemented, but their sole trigger was removed in separate later commits (I found the specific commit for each — e.g. Float16NotYetSupported was retired once real Float16Array codegen support landed).
I already have a local patch ready (removes these 9 entries + updates the one real test consumer, test/cctest/test-cpu-profiler.cc), but before going through Gerrit — I wanted to ask whether this kind of cleanup is even of interest to the team, and if so, whether there's anything I should know upfront (e.g. reasons these might be intentionally kept as placeholders for future work, if that's the case and I'm missing context).
Separately, along the way I noticed that Maglev's lazy deopt path always reports kUnknown instead of the real reason (maglev-code-generator.cc), meaning --trace-deopt gives no information for lazy deopts on Maglev-compiled code — happy to write that up separately if it's of interest too.
Thanks!