Skip to content

Commit 9b0d257

Browse files
committed
build: enable Maglev for riscv64
V8's Maglev compiler has supported riscv64 since V8 14.0 (with full source files in deps/v8/src/maglev/riscv/), but Node.js never wired it up: - configure.py excluded riscv64 from maglev_enabled_architectures - tools/v8_gypfiles/v8.gyp lacked GN-scraper conditions for riscv64 Maglev sources in both the v8_internal_headers and v8_base_without_compiler blocks This adds riscv64 to both, following the same pattern used for s390x in #60863 and matching V8's own BUILD.gn which already lists riscv64 alongside arm, arm64, x64, s390x, and ppc64 as Maglev-enabled architectures. Refs: nodejs/build#4099 Signed-off-by: Jamie Magee <jamie.magee@gmail.com>
1 parent 12249cc commit 9b0d257

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
valid_mips_float_abi = ('soft', 'hard')
5656
valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu')
5757
icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text(encoding='utf-8'))
58-
maglev_enabled_architectures = ('x64', 'arm', 'arm64', 's390x')
58+
maglev_enabled_architectures = ('x64', 'arm', 'arm64', 's390x', 'riscv64')
5959

6060
# builtins may be removed later if they have been disabled by options
6161
shareable_builtins = {'undici/undici': 'deps/undici/undici.js',

tools/v8_gypfiles/v8.gyp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,11 @@
716716
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_maglev.*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
717717
],
718718
}],
719+
['v8_target_arch=="riscv64"', {
720+
'sources': [
721+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_maglev.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
722+
],
723+
}],
719724
],
720725
}],
721726
['v8_enable_webassembly==1', {
@@ -1185,6 +1190,11 @@
11851190
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_maglev.*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
11861191
],
11871192
}],
1193+
['v8_target_arch=="riscv64"', {
1194+
'sources': [
1195+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_maglev.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
1196+
],
1197+
}],
11881198
],
11891199
}],
11901200
['v8_enable_webassembly==1', {

0 commit comments

Comments
 (0)