From 993c2b45be8446a13b63c81848e6166a2380866b Mon Sep 17 00:00:00 2001 From: Tobias Tebbi Date: Tue, 31 Jan 2023 17:21:31 +0100 Subject: [PATCH] [turboshaft] refactor assemblers/reducers to enable IDE autocomplete Bug: v8:12783 Change-Id: I237f470cea6be265475fec6c4301f3bf60bcb118 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4208931 Auto-Submit: Tobias Tebbi Reviewed-by: Nico Hartmann Commit-Queue: Nico Hartmann Cr-Commit-Position: refs/heads/main@{#85586} --- src/compiler/turboshaft/assembler.h | 54 +++++++++++-------- .../turboshaft/assert-types-reducer.h | 3 +- .../turboshaft/branch-elimination-reducer.h | 3 +- .../dead-code-elimination-reducer.h | 3 +- src/compiler/turboshaft/graph-builder.cc | 20 +++---- src/compiler/turboshaft/graph.h | 4 +- .../turboshaft/late-escape-analysis-reducer.h | 2 +- .../turboshaft/machine-lowering-reducer.h | 5 +- src/compiler/turboshaft/memory-optimization.h | 3 +- src/compiler/turboshaft/optimization-phase.h | 13 ++--- .../turboshaft/select-lowering-reducer.h | 2 +- .../turboshaft/type-inference-reducer.h | 3 +- .../turboshaft/typed-optimizations-reducer.h | 3 +- .../turboshaft/uniform-reducer-adapter.h | 2 +- .../turboshaft/value-numbering-reducer.h | 3 +- src/compiler/turboshaft/variable-reducer.h | 2 +- 16 files changed, 72 insertions(+), 53 deletions(-) diff --git a/src/compiler/turboshaft/assembler.h b/src/compiler/turboshaft/assembler.h index 3bc4d5cffc..14b2e2eaf2 100644 --- a/src/compiler/turboshaft/assembler.h +++ b/src/compiler/turboshaft/assembler.h @@ -52,16 +52,32 @@ class ReducerStack using FirstReducer>::FirstReducer; }; -template -class ReducerStack { +template +class ReducerStack> { public: - using AssemblerType = Assembler; - Assembler& Asm() { return *static_cast(this); } + using AssemblerType = Assembler; + using ReducerList = Reducers; + Assembler& Asm() { + return *static_cast*>(this); + } +}; + +template +struct reducer_stack_type {}; +template