-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process: split execution into main scripts
This patch splits the execution mode selection from the environment setup in `lib/internal/bootstrap/node.js`, and split the entry point of different execution mode into main scripts under `lib/internal/main`: - `check_syntax.js`: used when `-c`/`--check` which only checks the syntax of the input instead of executing it. - `eval_stdin.js`: used when `-e` is passed without value and stdin is not a TTY (e.g. something is piped). - `eval_string`: used when `-e` is passed along with a string argument - `inspect.js`: for `node inspect`/`node debug` - `print_bash_completion.js`: for `--completion-bash` - `print_help.js`: for `--help` - `prof_process.js`: for `--prof-process` - `repl.js`: for the REPL - `run_main_module.js`: used when a main module is passed - `run_third_party_main.js`: for the legacy `_third_party_main.js` support - `worker_thread.js`: for workers This makes the entry points easier to navigate and paves the way for customized v8 snapshots (that do not need to deserialize execution mode setup) and better embedder APIs. As an example, after this patch, for the most common case where Node.js executes a user module as an entry point, it essentially goes through: - `lib/internal/per_context.js` to setup the v8 Context (which is also run when setting up contexts for the `vm` module) - `lib/internal/bootstrap/loaders.js` to set up internal binding and builtin module loaders (that are separate from the loaders accessible in the user land). - `lib/internal/bootstrap/node.js`: to set up the rest of the environment, including various globals and the process object - `lib/internal/main/run_main_module.js`: which is selected from C++ to prepare execution of the user module. This patch also removes `NativeModuleLoader::CompileAndCall` and exposes `NativeModuleLoader::LookupAndCompile` directly so that we can handle syntax errors and runtime errors of bootstrap scripts differently. PR-URL: #25667 Reviewed-By: Anna Henningsen <anna@addaleax.net>
- v23.7.0
- v23.6.1
- v23.6.0
- v23.5.0
- v23.4.0
- v23.3.0
- v23.2.0
- v23.1.0
- v23.0.0
- v22.14.0
- v22.13.1
- v22.13.0
- v22.12.0
- v22.11.0
- v22.10.0
- v22.9.0
- v22.8.0
- v22.7.0
- v22.6.0
- v22.5.1
- v22.5.0
- v22.4.1
- v22.4.0
- v22.3.0
- v22.2.0
- v22.1.0
- v22.0.0
- v21.7.3
- v21.7.2
- v21.7.1
- v21.7.0
- v21.6.2
- v21.6.1
- v21.6.0
- v21.5.0
- v21.4.0
- v21.3.0
- v21.2.0
- v21.1.0
- v21.0.0
- v20.18.3
- v20.18.2
- v20.18.1
- v20.18.0
- v20.17.0
- v20.16.0
- v20.15.1
- v20.15.0
- v20.14.0
- v20.13.1
- v20.13.0
- v20.12.2
- v20.12.1
- v20.12.0
- v20.11.1
- v20.11.0
- v20.10.0
- v20.9.0
- v20.8.1
- v20.8.0
- v20.7.0
- v20.6.1
- v20.6.0
- v20.5.1
- v20.5.0
- v20.4.0
- v20.3.1
- v20.3.0
- v20.2.0
- v20.1.0
- v20.0.0
- v19.9.0
- v19.8.1
- v19.8.0
- v19.7.0
- v19.6.1
- v19.6.0
- v19.5.0
- v19.4.0
- v19.3.0
- v19.2.0
- v19.1.0
- v19.0.1
- v19.0.0
- v18.20.6
- v18.20.5
- v18.20.4
- v18.20.3
- v18.20.2
- v18.20.1
- v18.20.0
- v18.19.1
- v18.19.0
- v18.18.2
- v18.18.1
- v18.18.0
- v18.17.1
- v18.17.0
- v18.16.1
- v18.16.0
- v18.15.0
- v18.14.2
- v18.14.1
- v18.14.0
- v18.13.0
- v18.12.1
- v18.12.0
- v18.11.0
- v18.10.0
- v18.9.1
- v18.9.0
- v18.8.0
- v18.7.0
- v18.6.0
- v18.5.0
- v18.4.0
- v18.3.0
- v18.2.0
- v18.1.0
- v18.0.0
- v17.9.1
- v17.9.0
- v17.8.0
- v17.7.2
- v17.7.1
- v17.7.0
- v17.6.0
- v17.5.0
- v17.4.0
- v17.3.1
- v17.3.0
- v17.2.0
- v17.1.0
- v17.0.1
- v17.0.0
- v16.20.2
- v16.20.1
- v16.20.0
- v16.19.1
- v16.19.0
- v16.18.1
- v16.18.0
- v16.17.1
- v16.17.0
- v16.16.0
- v16.15.1
- v16.15.0
- v16.14.2
- v16.14.1
- v16.14.0
- v16.13.2
- v16.13.1
- v16.13.0
- v16.12.0
- v16.11.1
- v16.11.0
- v16.10.0
- v16.9.1
- v16.9.0
- v16.8.0
- v16.7.0
- v16.6.2
- v16.6.1
- v16.6.0
- v16.5.0
- v16.4.2
- v16.4.1
- v16.4.0
- v16.3.0
- v16.2.0
- v16.1.0
- v16.0.0
- v15.14.0
- v15.13.0
- v15.12.0
- v15.11.0
- v15.10.0
- v15.9.0
- v15.8.0
- v15.7.0
- v15.6.0
- v15.5.1
- v15.5.0
- v15.4.0
- v15.3.0
- v15.2.1
- v15.2.0
- v15.1.0
- v15.0.1
- v15.0.0
- v14.21.3
- v14.21.2
- v14.21.1
- v14.21.0
- v14.20.1
- v14.20.0
- v14.19.3
- v14.19.2
- v14.19.1
- v14.19.0
- v14.18.3
- v14.18.2
- v14.18.1
- v14.18.0
- v14.17.6
- v14.17.5
- v14.17.4
- v14.17.3
- v14.17.2
- v14.17.1
- v14.17.0
- v14.16.1
- v14.16.0
- v14.15.5
- v14.15.4
- v14.15.3
- v14.15.2
- v14.15.1
- v14.15.0
- v14.14.0
- v14.13.1
- v14.13.0
- v14.12.0
- v14.11.0
- v14.10.1
- v14.10.0
- v14.9.0
- v14.8.0
- v14.7.0
- v14.6.0
- v14.5.0
- v14.4.0
- v14.3.0
- v14.2.0
- v14.1.0
- v14.0.0
- v13.14.0
- v13.13.0
- v13.12.0
- v13.11.0
- v13.10.1
- v13.10.0
- v13.9.0
- v13.8.0
- v13.7.0
- v13.6.0
- v13.5.0
- v13.4.0
- v13.3.0
- v13.2.0
- v13.1.0
- v13.0.1
- v13.0.0
- v12.22.12
- v12.22.11
- v12.22.10
- v12.22.9
- v12.22.8
- v12.22.7
- v12.22.6
- v12.22.5
- v12.22.4
- v12.22.3
- v12.22.2
- v12.22.1
- v12.22.0
- v12.21.0
- v12.20.2
- v12.20.1
- v12.20.0
- v12.19.1
- v12.19.0
- v12.18.4
- v12.18.3
- v12.18.2
- v12.18.1
- v12.18.0
- v12.17.0
- v12.16.3
- v12.16.2
- v12.16.1
- v12.16.0
- v12.15.0
- v12.14.1
- v12.14.0
- v12.13.1
- v12.13.0
- v12.12.0
- v12.11.1
- v12.11.0
- v12.10.0
- v12.9.1
- v12.9.0
- v12.8.1
- v12.8.0
- v12.7.0
- v12.6.0
- v12.5.0
- v12.4.0
- v12.3.1
- v12.3.0
- v12.2.0
- v12.1.0
- v12.0.0
1 parent
feebdc5
commit 6967f91
Showing
37 changed files
with
855 additions
and
721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.