GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — vm: include vm context in the embedded snapshot by joyeecheung · Pull Request #44252 · nodejs/node Conversation
|
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
29c650e to
e582c5c
Compare
There was an error while loading. Please reload this page.
|
s/embeded/embedded in commit message |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
c32efba to
5e2a212
Compare
There was an error while loading. Please reload this page.
|
Rebased on top of #44258 and added a commit that makes use of the snapshot to speed up the initialization of the vm contexts a bit. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
From the CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1174 It seems that I needed to bump up the number of iterations (--set n=1000) to get a stable number from the benchmarks though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I've found that (inside build snapshot) const vm = require('vm') const context = vm.createContext(); console.log(context, vm.isContext(context)) const global2 = vm.runInContext( 'this', context, ) throws an error should it be fixed in this PR or next? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@goloveychuk My plan is to implement user-land vm context it in another PR (because that requires more refactoring to the lifetime management of the bindings), this only adds support for vm context in the embedded snapshot, which isn't that complex. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Opened #44277 and transferred the discussions there, in case this PR goes too off-topic. @goloveychuk please use that thread for discussions about user-land modules instead, thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Extract common context embedder tag checks to ContextEmbedderTag so that verifying if a context is a node context doesn't need to access private members of node::Environment. PR-URL: #44258 Refs: #44179 Refs: #44252 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Instead of creating an object template for every ContextifyContext, we now create one object template that can be reused by all contexts. The native pointer can be obtained through an embdder pointer field in the creation context of the receiver in the interceptors, because the interceptors are only meant to be invoked on the global object of the contextified contexts. This makes the ContextifyContext template context-independent and therefore snapshotable.
Include a minimally initialized contextify context in the embedded snapshot. This paves the way for user-land vm context snapshots.
Access to the global object from within a vm context is intercepted so it's slow, therefore we should try to avoid unnecessary access to it during the initialization of vm contexts. - Remove the Atomics.wake deletion as V8 now does not install it anymore. - Move the Intl.v8BreakIterator deletion into the snapshot. - Do not query the Object prototype if --disable-proto is not set. This should speed up the creation of vm contexts by about ~12%.
Notable changes: * cli: * (SEMVER-MINOR) add `--watch` (Moshe Atlow) #44366 * doc: * add daeyeon to collaborators (Daeyeon Jeong) #44355 * lib: * (SEMVER-MINOR) add diagnostics channel for process and worker (theanarkh) #44045 * os: * (SEMVER-MINOR) add machine method (theanarkh) #44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) #44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) #44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) #44252 PR-URL: #44521
Notable changes: * doc: * add daeyeon to collaborators (Daeyeon Jeong) #44355 * lib: * (SEMVER-MINOR) add diagnostics channel for process and worker (theanarkh) #44045 * os: * (SEMVER-MINOR) add machine method (theanarkh) #44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) #44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) #44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) #44252 PR-URL: #44521
Notable changes: * doc: * add daeyeon to collaborators (Daeyeon Jeong) #44355 * lib: * (SEMVER-MINOR) add diagnostics channel for process and worker (theanarkh) #44045 * os: * (SEMVER-MINOR) add machine method (theanarkh) #44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) #44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) #44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) #44252 PR-URL: #44521
Notable changes: * doc: * add daeyeon to collaborators (Daeyeon Jeong) nodejs#44355 * os: * (SEMVER-MINOR) add machine method (theanarkh) nodejs#44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) nodejs#44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) nodejs#44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) nodejs#44252 PR-URL: nodejs#44521
Notable changes: * doc: * add daeyeon to collaborators (Daeyeon Jeong) #44355 * lib: * (SEMVER-MINOR) add diagnostics channel for process and worker (theanarkh) #44045 * os: * (SEMVER-MINOR) add machine method (theanarkh) #44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) #44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) #44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) #44252 PR-URL: #44521
Notable changes: * doc: * add daeyeon to collaborators (Daeyeon Jeong) #44355 * lib: * (SEMVER-MINOR) add diagnostics channel for process and worker (theanarkh) #44045 * os: * (SEMVER-MINOR) add machine method (theanarkh) #44416 * report: * (SEMVER-MINOR) expose report public native apis (Chengzhong Wu) #44255 * src: * (SEMVER-MINOR) expose environment RequestInterrupt api (Chengzhong Wu) #44362 * vm: * include vm context in the embedded snapshot (Joyee Cheung) #44252 PR-URL: #44521
|
This is not landing cleanly in v16.x |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Extract common context embedder tag checks to ContextEmbedderTag so that verifying if a context is a node context doesn't need to access private members of node::Environment. PR-URL: #44258 Refs: #44179 Refs: #44252 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Extract common context embedder tag checks to ContextEmbedderTag so that verifying if a context is a node context doesn't need to access private members of node::Environment. PR-URL: nodejs/node#44258 Refs: nodejs/node#44179 Refs: nodejs/node#44252 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Extract common context embedder tag checks to ContextEmbedderTag so that verifying if a context is a node context doesn't need to access private members of node::Environment. PR-URL: nodejs/node#44258 Refs: nodejs/node#44179 Refs: nodejs/node#44252 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.