PR-URL: https://github.com/nodejs/node/pull/52293
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/51362
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Original commit message:
Reland "[api] allow v8::Data as internal field"
This is a reland of commit 0aa622e12893e9921c01a34ce9507b544e599c4a
The original patch tried to run a test that calls exit() in the
fatal error handler in parallel, which would not work. This marked
the test with TEST() to avoid running it in parallel.
Original change's description:
> [api] allow v8::Data as internal field
>
> Previously only v8::Value can be stored as internal fields.
> In some cases, however, it's necessary for the embedder to
> tie the lifetime of a v8::Data with the lifetime of a
> JS object, and that v8::Data may not be a v8::Value, as
> it can be something returned from the V8 API. One way to
> keep the v8::Data alive may be to use a v8::Persistent<v8::Data>
> but that can easily lead to leaks.
>
> This patch changes v8::Object::GetInternalField() and
> v8::Object::SetInernalField() to accept v8::Data instead of just
> v8::Value, so that v8::Data can kept alive by a JS object in
> a way that the GC can be aware of to address this problem.
> This is a breaking change for embedders
> using v8::Object::GetInternalField() as it changes the return
> type. Since most v8::Value subtypes only support direct casts
> from v8::Value but not v8::Data, calls like
>
> object->GetInternalField(index).As<v8::External>()
>
> needs to be updated to cast the value to v8::Value first:
>
> object->GetInternalField(index).As<v8::Value>().As<v8::External>()
>
> Bug: v8:14120
> Change-Id: I731c958d1756b9d5ee4a3e78813416cd60d1b7ca
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4707972
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Joyee Cheung <joyee@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#89718}
Bug: v8:14120
Change-Id: I3e45d09b5c300d5eefc73e380ef21ac2bd61760c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4834471
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#89824}
Refs: 93b1a74cbc
PR-URL: https://github.com/nodejs/node/pull/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: https://github.com/nodejs/node/pull/49639
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Original commit message:
Reland "[api] allow v8::Data as internal field"
This is a reland of commit 0aa622e12893e9921c01a34ce9507b544e599c4a
The original patch tried to run a test that calls exit() in the
fatal error handler in parallel, which would not work. This marked
the test with TEST() to avoid running it in parallel.
Original change's description:
> [api] allow v8::Data as internal field
>
> Previously only v8::Value can be stored as internal fields.
> In some cases, however, it's necessary for the embedder to
> tie the lifetime of a v8::Data with the lifetime of a
> JS object, and that v8::Data may not be a v8::Value, as
> it can be something returned from the V8 API. One way to
> keep the v8::Data alive may be to use a v8::Persistent<v8::Data>
> but that can easily lead to leaks.
>
> This patch changes v8::Object::GetInternalField() and
> v8::Object::SetInernalField() to accept v8::Data instead of just
> v8::Value, so that v8::Data can kept alive by a JS object in
> a way that the GC can be aware of to address this problem.
> This is a breaking change for embedders
> using v8::Object::GetInternalField() as it changes the return
> type. Since most v8::Value subtypes only support direct casts
> from v8::Value but not v8::Data, calls like
>
> object->GetInternalField(index).As<v8::External>()
>
> needs to be updated to cast the value to v8::Value first:
>
> object->GetInternalField(index).As<v8::Value>().As<v8::External>()
>
> Bug: v8:14120
> Change-Id: I731c958d1756b9d5ee4a3e78813416cd60d1b7ca
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4707972
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Joyee Cheung <joyee@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#89718}
Bug: v8:14120
Change-Id: I3e45d09b5c300d5eefc73e380ef21ac2bd61760c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4834471
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#89824}
Refs: 93b1a74cbc
PR-URL: https://github.com/nodejs/node/pull/49419
Refs: 0aa622e128
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/42657
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/41610
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/40178
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Upgrade the bundled V8 and update code in src/ and lib/ to the new API.
Notable backwards incompatible changes are the removal of the smalloc
module and dropped support for CESU-8 decoding. CESU-8 support can be
brought back if necessary by doing UTF-8 decoding ourselves.
This commit includes https://codereview.chromium.org/1192973004 to fix
a build error on python 2.6 systems. The original commit log follows:
Use optparse in js2c.py for python compatibility
Without this change, V8 won't build on RHEL/CentOS 6 because the
distro python is too old to know about the argparse module.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
This commit applies some secondary changes in order to make `make test`
pass cleanly:
* disable broken postmortem debugging in common.gypi
* drop obsolete strict mode test in parallel/test-repl
* drop obsolete test parallel/test-v8-features
PR-URL: https://github.com/iojs/io.js/pull/1232
Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit removes the simple/test-event-emitter-memory-leak test for
being unreliable with the new garbage collector: the memory pressure
exerted by the test case is too low for the garbage collector to kick
in. It can be made to work again by limiting the heap size with the
--max_old_space_size=x flag but that won't be very reliable across
platforms and architectures.