Skip to content

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

Closed
joyeecheung wants to merge 3 commits intonodejs:masterfrom
joyeecheung:worker-stdio
Closed

process: refactor bootstrap of worker/main thread stdio, fatalException, and script evaluation#25199
joyeecheung wants to merge 3 commits intonodejs:masterfrom
joyeecheung:worker-stdio

Conversation

@joyeecheung
Copy link
Member

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants