Skip to content

Commit

Permalink
Revert "v8: enable maglev on supported architectures"
Browse files Browse the repository at this point in the history
This reverts commit 1a5acd0.

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: #54384
Refs: #52797
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
joyeecheung authored and RafaelGSS committed Sep 6, 2024
1 parent 5c9599a commit 5243e32
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5243e32

Please sign in to comment.