Skip to content

Update std::vector<v8::Local<T>> to use v8::LocalVector<T> (Part 2) #57642

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

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

Aditi-1400
Copy link
Contributor

A follow up of #57578 to replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

Also updates src/README.md to document the same.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/single-executable
  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 26, 2025
@Aditi-1400 Aditi-1400 force-pushed the contextify-vector-replace branch from d0175c7 to 30d022e Compare March 26, 2025 18:45
@Aditi-1400 Aditi-1400 changed the title src: update std::vector<v8::Local<T>> to use v8::LocalVector<T> Update std::vector<v8::Local<T>> to use v8::LocalVector<T> (Part 2) Mar 26, 2025
@Aditi-1400 Aditi-1400 force-pushed the contextify-vector-replace branch from 30d022e to 2581400 Compare March 26, 2025 18:52
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.24%. Comparing base (1123585) to head (54ff50f).
Report is 146 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57642      +/-   ##
==========================================
+ Coverage   90.22%   90.24%   +0.01%     
==========================================
  Files         630      630              
  Lines      185055   185081      +26     
  Branches    36216    36228      +12     
==========================================
+ Hits       166975   167020      +45     
+ Misses      11042    11030      -12     
+ Partials     7038     7031       -7     
Files with missing lines Coverage Δ
src/node_contextify.cc 80.47% <100.00%> (-0.04%) ⬇️
src/node_contextify.h 86.66% <ø> (+6.66%) ⬆️
src/node_sea.cc 91.30% <100.00%> (+0.04%) ⬆️
src/node_snapshotable.cc 75.43% <100.00%> (+0.05%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Aditi-1400 Aditi-1400 force-pushed the contextify-vector-replace branch from 2581400 to 44691fc Compare March 27, 2025 16:35
Additionally, according to [V8 public API documentation][`v8::Local<T>`], local handles
(`v8::Local<T>`) should **never** be allocated on the heap.

This disallows heap-allocated data structures containing instances of `v8::Local`
Copy link
Member

@joyeecheung joyeecheung Mar 27, 2025

Choose a reason for hiding this comment

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

Now come to think of it, when it's done we can probably add a rule to cpplint.py to just disallow std::vector<Local> or std::vector<v8::Local> (should be pretty straight-forward to implement).

A follow up of nodejs#57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>
@Aditi-1400 Aditi-1400 force-pushed the contextify-vector-replace branch from 44691fc to 54ff50f Compare April 2, 2025 21:34
@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 10, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 10, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 16, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 16, 2025
@nodejs-github-bot nodejs-github-bot merged commit ad3e835 into nodejs:main Apr 16, 2025
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ad3e835

RafaelGSS pushed a commit that referenced this pull request May 1, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 6, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 18, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
A follow up of #57578 to
replace all std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: #57642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants