-
Notifications
You must be signed in to change notification settings - Fork 72
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
src: remove dependency on wrapper-descriptor-based cpp heap #284
Conversation
Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 12.7. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md
dllexport introduces issues when compiling with MSVC. PR-URL: nodejs/node#47251 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
It introduces process hangs on some platforms because Node.js doesn't tear down V8 correctly. Disable it while we work on a solution. Refs: nodejs/node#47297 Refs: https://bugs.chromium.org/p/v8/issues/detail?id=13902 PR-URL: nodejs/node#47450 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=14221 PR-URL: nodejs/node#49639 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
We are not ready to compile with C++20 support yet. This is only a DCHECK that can be removed without affecting the behavior of release builds. PR-URL: nodejs/node#49639 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs/node#49639 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs/node#52293 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
After enabling -std:c++20 on Windows, patch is now much smaller. PR-URL: nodejs/node#52465 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
On Windows debug builds, it is not allowed to dereference empty iterators. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5331688 PR-URL: nodejs/node#52465 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Namely: - `v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, ...);` - `v8::ObjectTemplate::SetNativeDataProperty` with `AccessControl` Refs: v8/v8@46c241e Refs: v8/v8@6ec8839 Co-authored-by: Michaël Zasso <targos@protonmail.com>
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5447267 Co-authored-by: Michaël Zasso <targos@protonmail.com>
As V8 is moving towards built-in CppHeap creation, change the management so that the automatic CppHeap creation on Node.js's end is also enforced at Isolate creation time. 1. If embedder uses NewIsolate(), either they use IsolateSettings::cpp_heap to specify a CppHeap that will be owned by V8, or if it's not configured, Node.js will create a CppHeap that will be owned by V8. 2. If the embedder uses SetIsolateUpForNode(), IsolateSettings::cpp_heap will be ignored (as V8 has deprecated attaching CppHeap post-isolate-creation). The embedders need to ensure that the v8::Isolate has a CppHeap attached while it's still used by Node.js, preferably using v8::CreateParams. See https://issues.chromium.org/issues/42203693 for details. In future version of V8, this CppHeap will be created by V8 if not provided, and we can remove our own "if no CppHeap provided, create one" code in NewIsolate().
// | ||
// See https://issues.chromium.org/issues/42203693. In future version | ||
// of V8, this CppHeap will be created by V8 if not provided. | ||
v8::CppHeap* cpp_heap = nullptr; |
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.
This needs a flag in IsolateSettingsFlags
(similar to e.g. ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK
), as otherwise it's ABI-breaking? Or do you want to do that when backporting this change?
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.
I think the new tracing mechanism is already ABI breaking (wrappers are now getting a new layout and a slot in their headers), so this can't be backported anyway?
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.
Also this is part of the migration that builds on top of the new v8::Object::Wrap
/v8::Object::Unwrap
APIs that are replacement of the deprecated APIs, which won't be available until 12.5 with https://issues.chromium.org/issues/328117814 (I suspect the series of changes are already ABI-breaking in themselves somehow....or it would be very difficult to backport all the related patches in a non-ABI breaking way to older releases), this PR is baking for the 12.5 upgrade, see #283
@joyeecheung The |
Thanks for the reminder, moving to nodejs/node#53086 |
As V8 is moving towards built-in CppHeap creation, change the management so that the automatic CppHeap creation on Node.js's end is also enforced at Isolate creation time.
See https://issues.chromium.org/issues/42203693 for details. In future version of V8, this CppHeap will be created by V8 if not provided, and we can remove our own "if no CppHeap provided, create one" code in NewIsolate().
This also deprecates
node::SetCppgcReference()
in favor ofv8::Object::Wrap()
since the wrapper descriptor is no longer relevant. It is still kept as a compatibility layer for addons that need to also work on Node.js versions withoutv8::Object::Wrap()
.Fixes: #283
Fixes: nodejs/node#52718