src,tools: initialize cppgc#45704
Conversation
|
Review requested:
|
662d1aa to
3860b21
Compare
3860b21 to
97c248b
Compare
|
In Electron, the cppgc heap will be initialized by Chromium. I don't think anything in this PR clashes with what Electron will want. When they initialize node, they can use They don't use CC: @codebytere / @nornagon for awareness |
|
FYI I believe we don't currently initialize cppgc in the main process in Electron (though Blink does of course initialize it). So we would want to be able to initialize Node with cppgc initialization in the main process (either by doing it ourselves or through this initialization option), and without cppgc initialization in the renderer process (since that would clash with Blink's initialization). |
|
Erp, I hit the close button by mistake. Please re-approve running the workflows >_< |
97c248b to
a4f84b2
Compare
|
The previous test runs seemed to fail, and actually running my local build of node likewise fails. It seems to be due to a bug in v8: https://github.com/v8/v8/blob/main/src/heap/cppgc/heap-base.cc#L104 I believe this should be CC: @mlippautz |
Yep, changing that fixes my local build. |
a4f84b2 to
a00a060
Compare
I added a second commit to this PR which fixes the above. We can switch the commit to cherry-pick the v8 commit once it gets fixed there. Hopefully the CI checks will proceed now. |
|
Node is still segfaulting when I run it locally: It looks like |
|
Looks like there's no After digging a bit, it's because CC: @mlippautz |
|
Submitted the following v8 bugs: |
|
I added a commit to add |
|
Please re-approve running the workflows 😅 |
|
Landed in 7f2c810 |
|
Note to backporters: this depends on #48660 |
|
This PR didn't land cleanly because of #48660 in Node 20.x. Can you backport it? |
|
This change broke NodeJS on big-endian ppc64 on Linux for me. (see: #58277) |
|
I don't think V8 tests for ppc64be on their CI, nor does Node.js support ppc64be + Linux, from the stack trace it looks like a V8 support issue and the fix probably won't be in Node.js. |
This patch:
kNoInitializeCppgc is not set
there isn't one already during IsolateData initialization.
The CppHeap is detached and terminated when IsolateData
is freed.
This allows C++ addons to start using cppgc to manage objects.
A helper node::SetCppgcReference() is also added to help addons
enable cppgc tracing in a user-defined object.
Refs: #40786
Refs: https://docs.google.com/document/d/1ny2Qz_EsUnXGKJRGxoA-FXIE2xpLgaMAN6jD7eAkqFQ/edit