Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use v8::LocalVector in multiple places #2605

Merged
merged 1 commit into from
Aug 26, 2024
Merged

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 25, 2024

v8 Local handles aren't really supposed to be heap allocated at all. A short while back v8 introduced a new v8::LocalVector<T> collection type that more correctly handles the allocation and handling of a collection of locals. Update workerd to use it.

@jasnell jasnell requested review from a team as code owners August 25, 2024 19:54

kj::Vector<v8::Local<v8::Value>> argv(args.Length());
v8::LocalVector<v8::Value> argv(js.v8Isolate, args.Length());
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can we have a helper function to convert FunctionCallbackInfo<T> to LocalVector<T>? We can add a todo to simplify it once FunctionCallbackInfo has iterator support?

src/workerd/api/worker-rpc.c++ Show resolved Hide resolved
src/workerd/api/worker-rpc.c++ Show resolved Hide resolved
@jasnell jasnell force-pushed the jsnell/use-v8-localvector branch from 278eb7c to 29dcb39 Compare August 25, 2024 23:19
@jasnell jasnell merged commit 2c95da3 into main Aug 26, 2024
8 of 10 checks passed
@jasnell jasnell deleted the jsnell/use-v8-localvector branch August 26, 2024 14:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants