Skip to content

Commit a0e8074

Browse files
DadaIsCrazyV8 LUCI CQ
authored andcommitted
[turboshaft] Add skeleton for graph builder from Maglev
Bug: v8:12783 Change-Id: Ic6b8da5c6d1e7c0fa92285953eb3b29c9b0fed5c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5134813 Commit-Queue: Darius Mercadier <[email protected]> Reviewed-by: Nico Hartmann <[email protected]> Reviewed-by: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/heads/main@{#91837}
1 parent 9fb9240 commit a0e8074

21 files changed

Lines changed: 685 additions & 271 deletions

BUILD.bazel

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,8 @@ filegroup(
32283228
"src/compiler/turboshaft/machine-lowering-phase.cc",
32293229
"src/compiler/turboshaft/machine-lowering-phase.h",
32303230
"src/compiler/turboshaft/machine-lowering-reducer-inl.h",
3231+
"src/compiler/turboshaft/maglev-graph-building-phase.cc",
3232+
"src/compiler/turboshaft/maglev-graph-building-phase.h",
32313233
"src/compiler/turboshaft/machine-optimization-reducer.h",
32323234
"src/compiler/turboshaft/memory-optimization-reducer.cc",
32333235
"src/compiler/turboshaft/memory-optimization-reducer.h",
@@ -3505,6 +3507,32 @@ filegroup(
35053507
"src/builtins/builtins-wasm-gen.h",
35063508
],
35073509
"//conditions:default": [],
3510+
}) + select({
3511+
# Turboshaft's Maglev graph builder needs some Maglev files. We only
3512+
# include them explicitely when Maglev is disabled.
3513+
":enable_maglev": [],
3514+
"//conditions:default": [
3515+
"src/maglev/maglev-basic-block.h",
3516+
"src/maglev/maglev-code-gen-state.h",
3517+
"src/maglev/maglev-compilation-info.cc",
3518+
"src/maglev/maglev-compilation-info.h",
3519+
"src/maglev/maglev-compilation-unit.cc",
3520+
"src/maglev/maglev-compilation-unit.h",
3521+
"src/maglev/maglev-graph-builder.cc",
3522+
"src/maglev/maglev-graph-builder.h",
3523+
"src/maglev/maglev-graph.h",
3524+
"src/maglev/maglev-graph-labeller.h",
3525+
"src/maglev/maglev-graph-printer.cc",
3526+
"src/maglev/maglev-graph-printer.h",
3527+
"src/maglev/maglev-graph-processor.h",
3528+
"src/maglev/maglev-graph-verifier.h",
3529+
"src/maglev/maglev-interpreter-frame-state.cc",
3530+
"src/maglev/maglev-interpreter-frame-state.h",
3531+
"src/maglev/maglev-ir.cc",
3532+
"src/maglev/maglev-ir.h",
3533+
"src/maglev/maglev-ir-inl.h",
3534+
"src/maglev/maglev-register-frame-array.h",
3535+
],
35083536
}),
35093537
)
35103538

BUILD.gn

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,6 +3412,7 @@ v8_header_set("v8_internal_headers") {
34123412
"src/compiler/turboshaft/machine-lowering-phase.h",
34133413
"src/compiler/turboshaft/machine-lowering-reducer-inl.h",
34143414
"src/compiler/turboshaft/machine-optimization-reducer.h",
3415+
"src/compiler/turboshaft/maglev-graph-building-phase.h",
34153416
"src/compiler/turboshaft/memory-optimization-reducer.h",
34163417
"src/compiler/turboshaft/operation-matcher.h",
34173418
"src/compiler/turboshaft/operations.h",
@@ -5033,6 +5034,7 @@ v8_source_set("v8_turboshaft") {
50335034
"src/compiler/turboshaft/loop-unrolling-phase.cc",
50345035
"src/compiler/turboshaft/loop-unrolling-reducer.cc",
50355036
"src/compiler/turboshaft/machine-lowering-phase.cc",
5037+
"src/compiler/turboshaft/maglev-graph-building-phase.cc",
50365038
"src/compiler/turboshaft/memory-optimization-reducer.cc",
50375039
"src/compiler/turboshaft/operations.cc",
50385040
"src/compiler/turboshaft/optimize-phase.cc",
@@ -5054,6 +5056,18 @@ v8_source_set("v8_turboshaft") {
50545056
"src/compiler/turboshaft/utils.cc",
50555057
]
50565058

5059+
if (!v8_enable_maglev) {
5060+
# When Maglev is not enabled, Turboshaft still needs Maglev's graph builder.
5061+
sources += [
5062+
"src/maglev/maglev-compilation-info.cc",
5063+
"src/maglev/maglev-compilation-unit.cc",
5064+
"src/maglev/maglev-graph-builder.cc",
5065+
"src/maglev/maglev-graph-printer.cc",
5066+
"src/maglev/maglev-interpreter-frame-state.cc",
5067+
"src/maglev/maglev-ir.cc",
5068+
]
5069+
}
5070+
50575071
public_deps = [
50585072
":generate_bytecode_builtins_list",
50595073
":run_torque",

src/codegen/ia32/assembler-ia32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace internal {
5555

5656
class SafepointTableBuilder;
5757

58-
enum Condition {
58+
enum Condition : int {
5959
overflow = 0,
6060
no_overflow = 1,
6161
below = 2,

0 commit comments

Comments
 (0)