process: run RunBootstrapping in CreateEnvironment#26788
process: run RunBootstrapping in CreateEnvironment#26788joyeecheung wants to merge 1 commit intonodejs:masterfrom
Conversation
src/node.cc
Outdated
There was a problem hiding this comment.
My thinking was when we implement snapshot, this could be where the context is deserialized from the snapshot (as opposed to using NewContext). Note that to deserialize the snapshot properly we need to reinstall per-isolate callbacks, including the ones installed in SetIsolateUpForNode, so we may need to stop using NewIsolate at that point. We also need to restore inspector states after deserialization as those are discarded when the snapshot is generated, so it makes sense to me to encapsulate all this together.
|
Resume: https://ci.nodejs.org/job/node-test-pull-request/21692/ cc @addaleax @nodejs/process |
|
Cross referencing: #26334 (comment) This detaches bootstraping and pre-execution in our C++ API, so |
04d2c6e to
cb956fc
Compare
|
Rebased and added a CI: |
src/api/environment.cc
Outdated
There was a problem hiding this comment.
Since we are splitting RunBootstrapping and StartExecution, this requires the user not to pass any arguments that result in an async operation done in pre-execution at the moment. This is not ideal, but we may be able to split what's done in environment.js in the future to make sure nothing async is done during that...then the bootstrap will be divided into three phases:
- Up to node.js: no async operation is allowed, no access to run time states
- environment.js: no async operation is allowed, but access to run time states is allowed (warnings emitted here must be done synchronously)
- pre_execution.js: both are allowed, but the embedder would have to call this themselves somehow and make sure it plays with how they run the event loops.
|
https://ci.nodejs.org/job/node-test-pull-request/21934/ @addaleax this changed quite a bit since last reviews (mostly, |
|
@joyeecheung seems like this needs another rebase :/ |
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments.
|
If there are no more reviews I am going to land this later today. |
|
Landed in 1944265 |
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments. PR-URL: nodejs#26788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments. PR-URL: #26788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments. PR-URL: #26788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Also creates `CreateMainEnvironment` to encapsulate the code creating the main environment from the provided Isolate data and arguments. PR-URL: #26788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Also creates
CreateMainEnvironmentto encapsulate the codecreating the main environment from the provided Isolate data
and arguments.
This should be easier to review with https://github.com/nodejs/node/pull/26788/files?w=1
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes