Skip to content

src: fix creating `Isolate`s from addons

daae938f broke addons which create their own Isolate instances, because enabling the shared-readonly-heap feature of V8 requires all snapshots used for different Isolates to be identical. Usage of addons that do this has probably decreased quite a bit since Worker threads were introduced in Node.js, but it’s still a valid use case, and in any case the breakage was probably not intentional (although the referenced commit did require test changes because of this issue).

This commit addresses this issue partially by caching the V8 snapshot parameters and ignoring ones passed in from users in NewIsolate() when this feature is enabled, and makes the NodeMainInstance snapshot-based isolate creation also re-use this code.

Merge request reports

Loading