-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process: run RunBootstrapping in CreateEnvironment #26788
Conversation
|
||
// TODO(addaleax): This should load a real per-Isolate option, currently | ||
// this is still effectively per-process. | ||
if (isolate_data->options()->track_heap_objects) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
return nullptr; | ||
} | ||
|
||
std::vector<Local<String>> parameters = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
CreateMainEnvironment
to 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