Skip to content
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

[v19.x] src: bootstrap Web [Exposed=*] APIs in the shadow realm #47530

Closed

Conversation

legendecas
Copy link
Member

The first commit splits the Web APIs bootstrapping and can be helpful to be backported to reduce conflicts, regardless of whether or not the last two commits are backported.

lib: distinguish webidl interfaces with the extended property "Exposed"
PR-URL: #46809
Refs: #42528
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: James M Snell jasnell@gmail.com
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: Joyee Cheung joyeec9h3@gmail.com

src: bootstrap Web [Exposed=*] APIs in the shadow realm
This is the initial work to bootstrap Web interfaces that are defined
with extended attributes [Exposed=*].

The ShadowRealm instances are garbage-collected once it is
unreachable. However, V8 can not infer the reference cycles between
the per-realm strong persistent function handles and the realm's
context handle. To allow the context to be gc-ed once it is not
reachable, the per-realm persistent handles are attached to the
context's global object and the persistent handles are set as weak.

PR-URL: #46809
Refs: #42528
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: James M Snell jasnell@gmail.com
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: Joyee Cheung joyeec9h3@gmail.com

test: move test-shadow-realm-gc.js to known_issues
There is actually a leak. The test doesn't exercise the right
path to create a substantial enough object graph (e.g.
accessing something that results in the loading of a binding).
This does something more complicated in the test and moves it
to known_issues until we find a fix.

PR-URL: #47355
Refs: #47353
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: Chengzhong Wu legendecas@gmail.com
Reviewed-By: Yagiz Nizipli yagiz@nizipli.com

legendecas and others added 3 commits April 13, 2023 01:04
PR-URL: nodejs#46809
Refs: nodejs#42528
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This is the initial work to bootstrap Web interfaces that are defined
with extended attributes `[Exposed=*]`.

The ShadowRealm instances are garbage-collected once it is
unreachable. However, V8 can not infer the reference cycles between
the per-realm strong persistent function handles and the realm's
context handle. To allow the context to be gc-ed once it is not
reachable, the per-realm persistent handles are attached to the
context's global object and the persistent handles are set as weak.

PR-URL: nodejs#46809
Refs: nodejs#42528
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
There is actually a leak. The test doesn't exercise the right
path to create a substantial enough object graph (e.g.
accessing something that results in the loading of a binding).
This does something more complicated in the test and moves it
to known_issues until we find a fix.

PR-URL: nodejs#47355
Refs: nodejs#47353
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/realm
  • @nodejs/startup
  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v19.x labels Apr 12, 2023
@targos
Copy link
Member

targos commented Jun 4, 2023

v19.x is EoL

@targos targos closed this Jun 4, 2023
@targos targos removed the v19.x label Jun 4, 2023
@legendecas legendecas deleted the backport-46809-to-19 branch June 14, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants