Repository navigation
node-api: remove RefBase and CallbackWrapper - #53590
Merged
Merged
Conversation
Collaborator
|
Review requested:
|
legendecas
reviewed
Jun 27, 2024
Collaborator
legendecas
reviewed
Jun 28, 2024
gabrielschulhof
approved these changes
Jun 28, 2024
legendecas
approved these changes
Jul 1, 2024
toyobayashi
added a commit
to toyobayashi/emnapi
that referenced
this pull request
Jul 2, 2024
Collaborator
jasnell
approved these changes
Jul 4, 2024
Collaborator
vmoroz
force-pushed
the
PR/remove_refbase
branch
from
July 12, 2024 15:04
e8bb387 to
e73c7a0
Compare
mhdawson
approved these changes
Jul 12, 2024
commented
Aug 23, 2024
Collaborator
commented
Aug 25, 2024
Collaborator
Commit Queue failed- Loading data for nodejs/node/pull/53590 ✔ Done loading data for nodejs/node/pull/53590 ----------------------------------- PR info ------------------------------------ Title node-api: remove RefBase and CallbackWrapper (#53590) Author Vladimir Morozov <vmorozov@microsoft.com> (@vmoroz) Branch vmoroz:PR/remove_refbase -> nodejs:main Labels c++, node-api, author ready, needs-ci Commits 4 - node-api: remove RefBase and CallbackWrapper - reduce size of Reference - address PR feedback - add const for refcount() Committers 2 - Vladimir Morozov <vmorozov@microsoft.com> - GitHub <noreply@github.com> PR-URL: https://github.com/nodejs/node/pull/53590 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/53590 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last approving review: ⚠ - node-api: remove RefBase and CallbackWrapper ⚠ - reduce size of Reference ⚠ - address PR feedback ⚠ - add const for refcount() ℹ This PR was created on Tue, 25 Jun 2024 21:35:58 GMT ✔ Approvals: 5 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/53590#pullrequestreview-2141773353 ✔ - Gabriel Schulhof (@gabrielschulhof): https://github.com/nodejs/node/pull/53590#pullrequestreview-2148413989 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/53590#pullrequestreview-2151082401 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/53590#pullrequestreview-2157911770 ✔ - Michael Dawson (@mhdawson) (TSC): https://github.com/nodejs/node/pull/53590#pullrequestreview-2175228053 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-08-23T13:20:52Z: https://ci.nodejs.org/job/node-test-pull-request/61377/ - Querying data for job/node-test-pull-request/61377/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/10548497690 |
commented
Aug 25, 2024
Member
Author
|
@nodejs/node-api , could you please sign off the latest changes. The last CI build is succeeded and we must be able to merge the PR. |
commented
Aug 27, 2024
Member
Author
legendecas
approved these changes
Aug 27, 2024
commented
Aug 27, 2024
Collaborator
|
Landed in 431ac16 |
commented
Aug 27, 2024
Member
Author
|
@legendecas , thank you for merging it! :) |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR simplifies internal Node-API implementation to reduce the code complexity and to reduce allocated memory size.
There are no API changes or changes to the code behavior. All existing tests are passing and no new tests are needed.
RefBaseclass.Referenceclass directly inherits fromRefTracker.napi_set_instance_dataandnapi_get_instance_datauseTrackedFinalizerinstead ofRefBase.v8impl::Ownershipenum is renamed tov8impl::ReferenceOwnershipto better reflect its purpose.v8impl::ReferenceOwnershipsize changed to one byte to reduceReferencesize.Finalizerclass became non-virtual to reduce its size.Finalizerfields became private for better encapsulation.TrackedFinalizerandTrackedStringResourcesize changed from 64 to 56 bytes on 64-bit platforms.Referenceclass is split up into three classes depending on the usage scenario:Reference,ReferenceWithData, andReferenceWithFinalizer.Referenceinstance size on 64-bit platforms was 88 bytes.Referencesize is 40 bytes,ReferenceWithDatais 48 bytes, andReferenceWithFinalizeris 72 bytes.ReferenceWithFinalizersize reduced by 16 bytes due to changes toFinalizer(8 bytes) and removal ofRefBasethat along with thev8impl::ReferenceOwnershipto be one byte gained reduction of another 8 bytes.ReferenceandReferenceWithDataare not queued for finalization since they do not have user finalizer callbacks. They are finalized immediately.FunctionCallbackWrapper.CallbackWrapperandCallbackWrapperBase