Skip to content

Pass a jsg::Lock to wrap and unwrap so we can get the isolate from it #4246

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

Open
wants to merge 1 commit into
base: erikcorry/wrap-unwrap-with-lock
Choose a base branch
from

Conversation

danlapid
Copy link
Collaborator

@danlapid danlapid commented Jun 4, 2025

No description provided.

@danlapid danlapid requested review from a team as code owners June 4, 2025 12:57
Copy link
Contributor

windsurf-bot bot commented Jun 4, 2025

The total size of the files in this PR is too large.

@danlapid danlapid force-pushed the dlapid/wrap-unwrap-with-lock branch from fee4658 to f182153 Compare June 4, 2025 12:58
@@ -675,10 +674,10 @@ class PromiseWrapper {
private:
const JsgConfig config;

static bool isThenable(v8::Local<v8::Context> context, v8::Local<v8::Value> handle) {
static bool isThenable(Lock& js, v8::Local<v8::Context> context, v8::Local<v8::Value> handle) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a jsg::Lock& takes 10% of an simple request. It's slow. We can directly pass the isolate rather than the jsg::Lock and we can remove context since context can be accessed through isolate.GetCurrentContext() method.

Copy link
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes themselves seem simple enough so accepting. But can you explain the context behind why we're doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants