bootstrap: use the embedded snapshot in workers
bootstrap: move embedded snapshot to SnapshotBuilder
So that the embedded snapshot can be reused by the worker.
bootstrap: use the embedded snapshot in workers
Use the isolate snapshot and the default context snapshot from the embedded snapshot in workers.
test: fix calculations in test-worker-resource-limits
The heap size limit should be the sum of old generation and young generation size limits, and does not solely depend on the limit of the old generation.
Refs: https://github.com/nodejs/node/issues/35711
It seems the workers have no problem sharing the isolate snapshot and the default context snapshot with the main instance (thanks @legendecas for the idea), at least the tests pass locally for me.