Skip to content

Commit 7e39b87

Browse files
authored
deps,lib,tools: remove jitless and lite modes
Signed-off-by: Paolo Insogna <paolo@cowtech.it> PR-URL: #66459 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent f4d2742 commit 7e39b87

20 files changed

Lines changed: 142 additions & 98 deletions

‎BUILDING.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ and libc version. The table below lists the support tier for each supported
9898
combination. A list of [supported compile toolchains](#supported-toolchains) is
9999
also supplied for tier 1 platforms.
100100

101+
Node.js requires WebAssembly for built-in functionality, including `fetch()` and
102+
TypeScript support. JIT-less execution and V8 lite mode are not supported.
103+
101104
**For production applications, run Node.js on supported platforms only (Tier 1 or 2).**
102105

103106
Node.js does not support a platform version if a vendor has expired support

‎configure.py‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,14 +1224,6 @@
12241224
default=False,
12251225
help='compile V8 with debug checks and runtime debugging features enabled')
12261226

1227-
parser.add_argument('--v8-lite-mode',
1228-
action='store_true',
1229-
dest='v8_lite_mode',
1230-
default=False,
1231-
help='compile V8 in lite mode for constrained environments (lowers V8 '+
1232-
'memory footprint, but also implies no just-in-time compilation ' +
1233-
'support, thus much slower execution)')
1234-
12351227
parser.add_argument('--v8-enable-object-print',
12361228
action='store_true',
12371229
dest='v8_enable_object_print',
@@ -1318,6 +1310,10 @@
13181310

13191311
(options, args) = parser.parse_known_args()
13201312

1313+
# Reject the removed option before forwarding unknown arguments to GYP.
1314+
if any(arg.split('=', 1)[0] == '--v8-lite-mode' for arg in args):
1315+
parser.error('--v8-lite-mode is no longer supported; Node.js requires WebAssembly')
1316+
13211317
# Expand ~ in the install prefix now, it gets written to multiple files.
13221318
options.prefix = str(Path(options.prefix or '').expanduser())
13231319

@@ -2231,9 +2227,8 @@ def configure_library(lib, output, pkgname=None):
22312227
def configure_v8(o, configs):
22322228
set_configuration_variable(configs, 'v8_enable_v8_checks', release=0, debug=1)
22332229

2234-
o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1
2230+
o['variables']['v8_enable_webassembly'] = 1
22352231
o['variables']['v8_enable_javascript_promise_hooks'] = 1
2236-
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
22372232
is_gdbjit_supported_arch = (
22382233
'x64' in o['variables']['target_arch'] or
22392234
'ia32' in o['variables']['target_arch'] or

‎doc/api/cli.md‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,19 +2196,6 @@ added: v0.7.7
21962196

21972197
Opens the REPL even if stdin does not appear to be a terminal.
21982198

2199-
### `--jitless`
2200-
2201-
<!-- YAML
2202-
added: v12.0.0
2203-
-->
2204-
2205-
> Stability: 1 - Experimental. This flag is inherited from V8 and is subject to
2206-
> change upstream.
2207-
2208-
Disable [runtime allocation of executable memory][jitless]. This may be
2209-
required on some platforms for security reasons. It can also reduce attack
2210-
surface on other platforms, but the performance impact may be severe.
2211-
22122199
### `--localstorage-file=file`
22132200

22142201
<!-- YAML
@@ -4411,7 +4398,6 @@ V8 options that are allowed are:
44114398
* `--enable-etw-stack-walking`
44124399
* `--expose-gc`
44134400
* `--interpreted-frames-native-stack`
4414-
* `--jitless`
44154401
* `--max-heap-size`
44164402
* `--max-old-space-size`
44174403
* `--max-semi-space-size`
@@ -4782,8 +4768,6 @@ documented here:
47824768

47834769
### `--interpreted-frames-native-stack`
47844770

4785-
### `--jitless`
4786-
47874771
### `--max-heap-size`
47884772

47894773
Specifies the maximum heap size (in megabytes) for the process.
@@ -4976,7 +4960,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
49764960
[environment_variables]: #environment-variables-1
49774961
[filtering tests by name]: test.md#filtering-tests-by-name
49784962
[global setup and teardown]: test.md#global-setup-and-teardown
4979-
[jitless]: https://v8.dev/blog/jitless
49804963
[libuv threadpool documentation]: https://docs.libuv.org/en/latest/threadpool.html
49814964
[module compile cache]: module.md#module-compile-cache
49824965
[preloading asynchronous module customization hooks]: module.md#registration-of-asynchronous-customization-hooks

‎doc/api/errors.md‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3645,14 +3645,6 @@ The WASI instance has already started.
36453645

36463646
The WASI instance has not been started.
36473647

3648-
<a id="ERR_WEBASSEMBLY_NOT_SUPPORTED"></a>
3649-
3650-
### `ERR_WEBASSEMBLY_NOT_SUPPORTED`
3651-
3652-
A feature requiring WebAssembly was used, but WebAssembly is not supported or
3653-
has been disabled in the current environment (for example, when running with
3654-
`--jitless`).
3655-
36563648
<a id="ERR_WEBASSEMBLY_RESPONSE"></a>
36573649

36583650
### `ERR_WEBASSEMBLY_RESPONSE`
@@ -4488,6 +4480,18 @@ The linker function returned a module for which linking has failed.
44884480

44894481
The module must be successfully linked before instantiation.
44904482

4483+
<a id="ERR_WEBASSEMBLY_NOT_SUPPORTED"></a>
4484+
4485+
### `ERR_WEBASSEMBLY_NOT_SUPPORTED`
4486+
4487+
<!-- YAML
4488+
removed: REPLACEME
4489+
-->
4490+
4491+
A feature requiring WebAssembly was used in an environment where WebAssembly
4492+
was unavailable. Node.js now requires WebAssembly and no longer supports
4493+
JIT-less execution.
4494+
44914495
<a id="ERR_WORKER_UNSUPPORTED_EXTENSION"></a>
44924496

44934497
### `ERR_WORKER_UNSUPPORTED_EXTENSION`

‎doc/node.1‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,11 +1175,6 @@ See V8 Inspector integration for Node.js for further explanation on Node.js debu
11751175
.It Fl i , Fl -interactive
11761176
Opens the REPL even if stdin does not appear to be a terminal.
11771177
.
1178-
.It Fl -jitless
1179-
Disable runtime allocation of executable memory. This may be
1180-
required on some platforms for security reasons. It can also reduce attack
1181-
surface on other platforms, but the performance impact may be severe.
1182-
.
11831178
.It Fl -localstorage-file Ns = Ns Ar file
11841179
The file used to store \fBlocalStorage\fR data. If the file does not exist, it is
11851180
created the first time \fBlocalStorage\fR is accessed. The same file may be shared
@@ -2528,8 +2523,6 @@ V8 options that are allowed are:
25282523
.It
25292524
\fB--interpreted-frames-native-stack\fR
25302525
.It
2531-
\fB--jitless\fR
2532-
.It
25332526
\fB--max-heap-size\fR
25342527
.It
25352528
\fB--max-old-space-size\fR

‎lib/eslint.config_partial.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ export default [
298298
name: 'URLSearchParams',
299299
message: "Use `const { URLSearchParams } = require('internal/url');` instead of the global.",
300300
},
301-
// WebAssembly is not available in primordials because it can be
302-
// disabled with --jitless CLI flag.
301+
// WebAssembly is unavailable during snapshot building and must be
302+
// accessed lazily at runtime.
303303
{
304304
name: 'WebAssembly',
305305
message: 'Use `const { WebAssembly } = globalThis;` instead of the global.',

‎lib/internal/errors.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,9 +1981,6 @@ E('ERR_VM_MODULE_NOT_MODULE',
19811981
'Provided module is not an instance of Module', Error);
19821982
E('ERR_VM_MODULE_STATUS', 'Module status %s', Error);
19831983
E('ERR_WASI_ALREADY_STARTED', 'WASI instance has already started', Error);
1984-
E('ERR_WEBASSEMBLY_NOT_SUPPORTED',
1985-
'WebAssembly is not supported in this environment, but is required for %s',
1986-
Error);
19871984
E('ERR_WEBASSEMBLY_RESPONSE', 'WebAssembly response %s', TypeError);
19881985
E('ERR_WORKER_HANDLE_NOT_TRANSFERABLE',
19891986
'%s cannot be transferred in its current state; it must be a freshly ' +

‎lib/internal/freeze_intrinsics.js‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,16 @@ module.exports = function() {
363363
ArrayPrototypePush(intrinsics, SharedArrayBuffer);
364364
}
365365

366-
if (typeof WebAssembly !== 'undefined') {
367-
ArrayPrototypePush(intrinsicPrototypes,
368-
WebAssembly.Module.prototype,
369-
WebAssembly.Instance.prototype,
370-
WebAssembly.Table.prototype,
371-
WebAssembly.Memory.prototype,
372-
WebAssembly.CompileError.prototype,
373-
WebAssembly.LinkError.prototype,
374-
WebAssembly.RuntimeError.prototype,
375-
);
376-
ArrayPrototypePush(intrinsics, WebAssembly);
377-
}
366+
ArrayPrototypePush(intrinsicPrototypes,
367+
WebAssembly.Module.prototype,
368+
WebAssembly.Instance.prototype,
369+
WebAssembly.Table.prototype,
370+
WebAssembly.Memory.prototype,
371+
WebAssembly.CompileError.prototype,
372+
WebAssembly.LinkError.prototype,
373+
WebAssembly.RuntimeError.prototype,
374+
);
375+
ArrayPrototypePush(intrinsics, WebAssembly);
378376

379377
if (typeof Intl !== 'undefined') {
380378
ArrayPrototypePush(intrinsicPrototypes,

‎lib/internal/util.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,13 @@ const {
4545
SymbolPrototypeGetDescription,
4646
SymbolReplace,
4747
SymbolSplit,
48-
globalThis,
4948
} = primordials;
5049

5150
const {
5251
codes: {
5352
ERR_NO_CRYPTO,
5453
ERR_NO_TYPESCRIPT,
5554
ERR_UNKNOWN_SIGNAL,
56-
ERR_WEBASSEMBLY_NOT_SUPPORTED,
5755
},
5856
isErrorStackTraceLimitWritable,
5957
overrideStackTrace,
@@ -245,8 +243,6 @@ function assertCrypto() {
245243
function assertTypeScript() {
246244
if (noTypeScript)
247245
throw new ERR_NO_TYPESCRIPT();
248-
if (globalThis.WebAssembly === undefined)
249-
throw new ERR_WEBASSEMBLY_NOT_SUPPORTED('TypeScript');
250246
}
251247

252248
/**

‎src/node.cc‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#include "node_version.h"
4949
#include "permission/env_permission.h"
5050

51+
#if defined(V8_JITLESS) || defined(V8_LITE_MODE)
52+
#error Node.js does not support interpreter-only V8 builds.
53+
#endif
54+
5155
#if HAVE_OPENSSL
5256
#include "ncrypto.h"
5357
#if OPENSSL_VERSION_MAJOR >= 3
@@ -1108,6 +1112,12 @@ static ExitCode InitializeNodeWithArgsInternal(
11081112

11091113
allow_env_sources.Finish();
11101114

1115+
// Node.js requires WebAssembly for built-in functionality. Override these
1116+
// modes after all option sources, before V8 applies their implications.
1117+
// Explicitly allow overriding even when contradiction checks are enabled.
1118+
V8::SetFlagsFromString("--allow-overwriting-for-next-flag --no-lite-mode "
1119+
"--allow-overwriting-for-next-flag --no-jitless");
1120+
11111121
// Every option source has now been parsed, so cross-source option
11121122
// constraints can finally be validated.
11131123
CheckGlobalBenchOptions(errors);

0 commit comments

Comments
 (0)