GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: define per-isolate internal bindings registration callback by legendecas · Pull Request #45547 · nodejs/node

Conversation

@legendecas

@legendecas legendecas commented Nov 20, 2022

Copy link
Copy Markdown
Member

Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

Refs: #42528

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Nov 20, 2022

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Nov 20, 2022
@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch from d115a82 to c24d797 Compare November 22, 2022 07:43
@legendecas legendecas changed the title src: define realm-aware internal bindings src: define per-isolate internal bindings registration callback Nov 22, 2022
@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch 2 times, most recently from 06e2c24 to bbecbcd Compare November 22, 2022 07:52
@legendecas
legendecas marked this pull request as ready for review November 22, 2022 17:26
@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch from bbecbcd to 6311182 Compare November 22, 2022 17:42
joyeecheung
joyeecheung reviewed Nov 24, 2022
View reviewed changes
Comment thread src/env-inl.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node_binding.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node_builtins.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch 2 times, most recently from f762397 to e07122b Compare November 29, 2022 18:01
joyeecheung
joyeecheung reviewed Dec 2, 2022
View reviewed changes
Comment thread src/node_binding.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node_worker.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node_builtins.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch from e07122b to 0dc40ad Compare December 6, 2022 14:52
joyeecheung
joyeecheung approved these changes Dec 14, 2022
View reviewed changes

@joyeecheung joyeecheung left a comment

Copy link
Copy Markdown
Member

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.

LGTM with a nit

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/util.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@legendecas

legendecas commented Dec 15, 2022

Copy link
Copy Markdown
Member Author

@nodejs/realm PTAL, thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cjihrig
cjihrig approved these changes Dec 15, 2022
View reviewed changes
Comment thread src/node_binding.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/node_binding.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Dec 19, 2022
View reviewed changes
legendecas added 2 commits December 20, 2022 01:50
@legendecas
src: define per-isolate internal bindings registration callback
816f83a
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.
@legendecas
src: add worker per-isolate binding initialization
f264321
Create worker binding templates in the per-isolate initialization.
@legendecas
legendecas force-pushed the shadow-realm/per-realm-binding branch from 0dc40ad to f264321 Compare December 19, 2022 18:02
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 19, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 19, 2022
@nodejs-github-bot

nodejs-github-bot commented Dec 19, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/48603/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Dec 20, 2022
CI Reliability 2022-12-20 nodejs/reliability#463
Open
14 tasks
@nodejs-github-bot

nodejs-github-bot commented Dec 20, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/48619/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 21, 2022
CI Reliability 2022-12-21 nodejs/reliability#464
Open
CI Reliability 2022-12-22 nodejs/reliability#465
Open
@legendecas legendecas mentioned this pull request Dec 22, 2022
Adding realm label to nodejs/node repo nodejs/admin#760
Closed
@legendecas legendecas added the realm Issues and PRs related to the ShadowRealm API and node::Realm. label Dec 26, 2022
legendecas added a commit that referenced this pull request Dec 28, 2022
@legendecas
src: define per-isolate internal bindings registration callback
4310522
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
legendecas added a commit that referenced this pull request Dec 28, 2022
@legendecas
src: add worker per-isolate binding initialization
8dfd905
Create worker binding templates in the per-isolate initialization.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@legendecas

legendecas commented Dec 28, 2022

Copy link
Copy Markdown
Member Author

Landed in 796c4f9...8dfd905

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@legendecas legendecas closed this Dec 28, 2022
@legendecas
legendecas deleted the shadow-realm/per-realm-binding branch December 28, 2022 04:20
targos pushed a commit that referenced this pull request Jan 1, 2023
@legendecas @targos
src: define per-isolate internal bindings registration callback
aba1fdc
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jan 1, 2023
@legendecas @targos
src: add worker per-isolate binding initialization
fdbc593
Create worker binding templates in the per-isolate initialization.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Jan 2, 2023
v19.4.0 proposal #46061
Merged
RafaelGSS pushed a commit that referenced this pull request Jan 4, 2023
@legendecas @RafaelGSS
src: define per-isolate internal bindings registration callback
cc60443
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Jan 4, 2023
@legendecas @RafaelGSS
src: add worker per-isolate binding initialization
326b910
Create worker binding templates in the per-isolate initialization.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Jan 5, 2023
@legendecas @RafaelGSS
src: define per-isolate internal bindings registration callback
db535b6
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Jan 5, 2023
@legendecas @RafaelGSS
src: add worker per-isolate binding initialization
6c5b7e6
Create worker binding templates in the per-isolate initialization.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@juanarbol juanarbol added the backport-requested-v18.x label Jan 24, 2023
@juanarbol

juanarbol commented Jan 24, 2023

Copy link
Copy Markdown
Member

This is not landing cleanly in the v18.x line 💔

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@legendecas

legendecas commented Jan 28, 2023

Copy link
Copy Markdown
Member Author

Backport to v18.x depends on #46336.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@legendecas

legendecas commented May 23, 2023

Copy link
Copy Markdown
Member Author

Backport to v18.x depends on #44488.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos pushed a commit that referenced this pull request Nov 10, 2023
@legendecas @targos
src: define per-isolate internal bindings registration callback
92311a0
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: #45547
Refs: #42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Nov 28, 2023
v18.19.0 release proposal #50953
Merged
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
src: define per-isolate internal bindings registration
0d73359
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: nodejs/node#45547
Refs: nodejs/node#42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
src: define per-isolate internal bindings registration
b34433f
Bindings that need to be loaded in distinct contexts of node::Realm in
the same node::Environment instance needs to share the per-isolate
templates.

Add a new binding registration callback, which is called with
per-IsolateData. This allows bindings to define templates and
share them across realms eagerly, and avoid accidental modification on
the templates when the per-context callback is called multiple times.

This also tracks loaded bindings and built-in modules with node::Realm.

PR-URL: nodejs/node#45547
Refs: nodejs/node#42528
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@joyeecheung joyeecheung joyeecheung approved these changes
@jasnell jasnell jasnell approved these changes
@cjihrig cjihrig cjihrig approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. realm Issues and PRs related to the ShadowRealm API and node::Realm.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@legendecas @nodejs-github-bot @juanarbol @jasnell @cjihrig @joyeecheung
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.