Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v22.x] Revert "v8: enable maglev on supported architectures" #54384

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1644,8 +1641,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
8 changes: 8 additions & 0 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,14 @@ static int32_t FastInternalModuleStat(
const FastOneByteString& input,
// NOLINTNEXTLINE(runtime/references) This is V8 api.
FastApiCallbackOptions& options) {
// This needs a HandleScope which needs an isolate.
Isolate* isolate = Isolate::TryGetCurrent();
if (!isolate) {
options.fallback = true;
return -1;
}

HandleScope scope(isolate);
Environment* env = Environment::GetCurrent(recv->GetCreationContextChecked());

auto path = std::filesystem::path(input.data, input.data + input.length);
Expand Down
Loading