From 5243e3240c8b516ac411c8e691cd891b3d02ff11 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 14 Aug 2024 21:57:30 +0200 Subject: [PATCH] Revert "v8: enable maglev on supported architectures" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1a5acd0638579e687dde128cc6d4effe3ab070d1. Reason to revert: we have seen several crashes/unexpected JS behaviors with maglev on v22 (which ships V8 v12.4). The bugs lie in the codegen so it would be difficult for users to work around them or even figure out where the bugs are coming from. Some bugs are fixed in the upstream while some others probably remain. As v22 will get stuck with V8 v12.4 as LTS, it will be increasingly difficult to backport patches for them even if the bugs are fixed. So disable it by default on v22 to reduce the churn and troubles for users. PR-URL: https://github.com/nodejs/node/pull/54384 Refs: https://github.com/nodejs/node/issues/52797 Reviewed-By: Richard Lau Reviewed-By: Rafael Gonzaga Reviewed-By: Chengzhong Wu Reviewed-By: Yagiz Nizipli Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- configure.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/configure.py b/configure.py index fe0a9f829fc673..a51288a1590e45 100755 --- a/configure.py +++ b/configure.py @@ -56,7 +56,6 @@ valid_mips_float_abi = ('soft', 'hard') valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu') icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text(encoding='utf-8')) -maglev_enabled_architectures = ('x64', 'arm', 'arm64') shareable_builtins = {'cjs_module_lexer/lexer': 'deps/cjs-module-lexer/lexer.js', 'cjs_module_lexer/dist/lexer': 'deps/cjs-module-lexer/dist/lexer.js', @@ -934,13 +933,11 @@ help='Enable V8 transparent hugepage support. This feature is only '+ 'available on Linux platform.') -maglev_enabled_by_default_help = f"(Maglev is enabled by default on {','.join(maglev_enabled_architectures)})" - -parser.add_argument('--v8-disable-maglev', +parser.add_argument('--v8-enable-maglev', action='store_true', - dest='v8_disable_maglev', + dest='v8_enable_maglev', default=None, - help=f"Disable V8's Maglev compiler. {maglev_enabled_by_default_help}") + help='Enable V8 Maglev compiler. Not available on all platforms.') parser.add_argument('--v8-enable-short-builtin-calls', action='store_true', @@ -1643,8 +1640,7 @@ def configure_v8(o, configs): o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks. o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1 - o['variables']['v8_enable_maglev'] = B(not options.v8_disable_maglev and - o['variables']['target_arch'] in maglev_enabled_architectures) + o['variables']['v8_enable_maglev'] = 1 if options.v8_enable_maglev else 0 o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_sandbox'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0