Unverified Commit 0e090768 authored by Joyee Cheung's avatar Joyee Cheung Committed by Michaël Zasso
Browse files

deps: cherry-pick 0483e9a from upstream V8

Original commit message:

    [api] Allow embedder to construct an Array from Local<Value>*

    Currently to obtain a v8::Array out of a C array or a std::vector,
    one needs to loop through the elements and call array->Set() multiple
    times, and these calls go into v8::Object::Set() which can be slow.
    This patch adds a new Array::New overload that converts a
    Local<Value>* with known size into a Local<Array>.

    Change-Id: I0a768f0e18eec51e78d58be455482ec6425ca188
    Reviewed-on: https://chromium-review.googlesource.com/c/1317049


Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Reviewed-by: default avatarAdam Klein <adamk@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#57261}

Refs: https://github.com/v8/v8/commit/0483e9a9abe77a73632fd85b9c0cd608efa9aa0d

PR-URL: https://github.com/nodejs/node/pull/24125


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarYang Guo <yangguo@chromium.org>
Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarRefael Ackermann <refack@gmail.com>
parent 5620727f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment