Skip to content

process: refactor bootstrap of worker/main thread stdio, fatalException, and script evaluation

process: move eval and exception bootstrap ito process/execution.js

This patch:

  • Moves tryGetCwd, evalScript and fatalException from bootstrap/node.js into process/execution.js so that they do have to be passed into the worker thread setup function, instead the worker code can require them when necessary.
  • Moves setUncaughtExceptionCaptureCallback and hasUncaughtExceptionCaptureCallback along with the two global state exceptionHandlerState and shouldAbortOnUncaughtToggle info process.execution.js as those are only used by the fatalException and these two accessors as one self-contained unit.

process: split worker IO into internal/worker/io.js

  • Move setupProcessStdio which contains write access to the process object into bootstrap/node.js
  • Move MessagePort, MessageChannel, ReadableWorkerStdio, and WritableWorkerStdio into internal/worker/io.js
  • Move more worker-specific bootstrap code into internal/process/worker_thread_only from setupChild in internal/worker.js, and move the process._fatalException overwrite into bootstrap/node.js for clarity.

process: move worker bootstrap code into worker_thread_only.js

Move worker bootstrap code into worker_thread_only.js from internal/worker.js since they are only run once during bootstrap.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading