Skip to content

v8::Isolate::AttachCppHeap is deprecated #52718

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
targos opened this issue Nov 4, 2023 · 15 comments
Open

v8::Isolate::AttachCppHeap is deprecated #52718

targos opened this issue Nov 4, 2023 · 15 comments

Comments

@targos
Copy link
Member Author

targos commented Nov 4, 2023

test/cctest/test_cppgc.cc is also affected.

@targos
Copy link
Member Author

targos commented Nov 15, 2023

Ping. This is soon going to be a problem.

@joyeecheung
Copy link
Member

joyeecheung commented Nov 15, 2023

It seems to me that we can just skip the attach and detach call at all and V8 can handle it for us? (We previously already do "if there isn't one, create one, otherwise use the existing one" which seems to be what V8 does internally now) cc @mlippautz

@joyeecheung
Copy link
Member

joyeecheung commented Nov 15, 2023

Or specifically is this branch always true now? Then we can just remove the else branch and the branch in IsolateData::~IsolateData

https://github.com/nodejs/node-v8/blob/1ccbbfef3a32dbce7d5f35f17c2280bc995af10e/src/env.cc#L524-L527

@targos
Copy link
Member Author

targos commented Nov 15, 2023

It's entirely possible that this is easy to fix. I just am not able to do it myself with my knowledge of C++.

@joyeecheung
Copy link
Member

I can check later to see if that branch is always true now. If it is we can delete the extra handling.

@targos
Copy link
Member Author

targos commented Nov 15, 2023

I pushed a buildable version of the canary branch today.

@targos targos transferred this issue from nodejs/node-v8 Apr 27, 2024
@targos
Copy link
Member Author

targos commented Apr 27, 2024

Moved to core repo as the code is now in main.

@targos
Copy link
Member Author

targos commented Jan 29, 2025

Related: v8#209

@joyeecheung
Copy link
Member

It seems V8 fork is able to just let the isolate own the CppHeap now? Not sure if the task runner timing issue has been dealt with already in the upstream, if it is we can revive #53205 (comment)

@targos
Copy link
Member Author

targos commented Jan 30, 2025

Another one: v8#210

@targos
Copy link
Member Author

targos commented Jan 31, 2025

And v8#211

@targos
Copy link
Member Author

targos commented Feb 18, 2025

And v8#212

@targos
Copy link
Member Author

targos commented Mar 5, 2025

And v8#213

@joyeecheung
Copy link
Member

I see that on the main branch, AttachCppHeap and DetachCppHeap are still only marked as V8_DEPRECATED_SOON, which means the code that are needed to fully migrate may not be there yet (see #53205 (comment)). Though when 13.4 upgrade lands we may be able to start migration.

targos added a commit to targos/node that referenced this issue Apr 5, 2025
Closes: nodejs#52718
Co-authored-by: Andreas Haas <ahaas@chromium.org>
targos added a commit to targos/node that referenced this issue Apr 6, 2025
Closes: nodejs#52718
Co-authored-by: Andreas Haas <ahaas@chromium.org>
targos added a commit to targos/node that referenced this issue Apr 6, 2025
Closes: nodejs#52718
Co-authored-by: Andreas Haas <ahaas@chromium.org>
targos added a commit to targos/node that referenced this issue Apr 9, 2025
Closes: nodejs#52718
Co-authored-by: Andreas Haas <ahaas@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants