2013-04-17 16:10:37 +02:00
|
|
|
// Copyright 2013 the V8 project authors. All rights reserved.
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following
|
|
|
|
// disclaimer in the documentation and/or other materials provided
|
|
|
|
// with the distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived
|
|
|
|
// from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
#include "src/handles/global-handles.h"
|
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
#include "include/cppgc/macros.h"
|
2023-03-30 12:11:08 +02:00
|
|
|
#include "include/v8-embedder-heap.h"
|
2021-10-10 11:10:43 +02:00
|
|
|
#include "include/v8-function.h"
|
2019-08-01 08:38:30 +02:00
|
|
|
#include "src/api/api-inl.h"
|
|
|
|
#include "src/execution/isolate.h"
|
2022-11-18 09:50:46 +00:00
|
|
|
#include "src/flags/flags.h"
|
2018-05-31 11:11:57 +02:00
|
|
|
#include "src/heap/factory.h"
|
2019-03-15 18:35:06 +05:30
|
|
|
#include "src/heap/heap-inl.h"
|
2019-08-01 08:38:30 +02:00
|
|
|
#include "src/objects/objects-inl.h"
|
2022-09-21 13:28:42 +02:00
|
|
|
#include "test/unittests/heap/heap-utils.h"
|
|
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
2022-04-12 11:10:15 +02:00
|
|
|
|
2017-10-18 15:03:02 -07:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2013-08-10 16:27:43 +02:00
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
namespace {
|
|
|
|
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
struct TracedReferenceWrapper {
|
2025-04-29 08:03:15 +02:00
|
|
|
void Trace(cppgc::Visitor* v) { v->Trace(handle); }
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
v8::TracedReference<v8::Object> handle;
|
|
|
|
};
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
class NonRootingEmbedderRootsHandler final : public v8::EmbedderRootsHandler {
|
2025-04-29 08:03:15 +02:00
|
|
|
CPPGC_STACK_ALLOCATED();
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
public:
|
|
|
|
NonRootingEmbedderRootsHandler() : v8::EmbedderRootsHandler() {}
|
2023-03-30 12:11:08 +02:00
|
|
|
void ResetRoot(const v8::TracedReference<v8::Value>& handle) final {
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
for (auto* wrapper : wrappers_) {
|
|
|
|
if (wrapper->handle == handle) {
|
|
|
|
wrapper->handle.Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Register(TracedReferenceWrapper* wrapper) {
|
|
|
|
wrappers_.push_back(wrapper);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<TracedReferenceWrapper*> wrappers_;
|
2019-08-01 08:38:30 +02:00
|
|
|
};
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
void SimpleCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
2022-09-21 13:28:42 +02:00
|
|
|
v8::Isolate* isolate = info.GetIsolate();
|
|
|
|
info.GetReturnValue().Set(v8::Number::New(isolate, 0));
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
struct FlagAndHandles {
|
2018-01-24 20:16:06 +01:00
|
|
|
bool flag;
|
|
|
|
v8::Global<v8::Object> handle;
|
2023-03-30 12:11:08 +02:00
|
|
|
v8::Local<v8::Object> local;
|
2018-01-24 20:16:06 +01:00
|
|
|
};
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
void ResetHandleAndSetFlag(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-01-24 20:16:06 +01:00
|
|
|
data.GetParameter()->handle.Reset();
|
|
|
|
data.GetParameter()->flag = true;
|
|
|
|
}
|
|
|
|
|
2019-08-01 08:38:30 +02:00
|
|
|
template <typename HandleContainer>
|
2018-01-24 20:16:06 +01:00
|
|
|
void ConstructJSObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
|
2019-08-01 08:38:30 +02:00
|
|
|
HandleContainer* flag_and_persistent) {
|
2018-01-24 20:16:06 +01:00
|
|
|
v8::HandleScope handle_scope(isolate);
|
|
|
|
v8::Local<v8::Object> object(v8::Object::New(isolate));
|
|
|
|
CHECK(!object.IsEmpty());
|
|
|
|
flag_and_persistent->handle.Reset(isolate, object);
|
|
|
|
CHECK(!flag_and_persistent->handle.IsEmpty());
|
|
|
|
}
|
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
void ConstructJSObject(v8::Isolate* isolate, v8::Global<v8::Object>* global) {
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Object> object(v8::Object::New(isolate));
|
|
|
|
CHECK(!object.IsEmpty());
|
|
|
|
*global = v8::Global<v8::Object>(isolate, object);
|
|
|
|
CHECK(!global->IsEmpty());
|
|
|
|
}
|
|
|
|
|
2020-05-05 09:19:02 +02:00
|
|
|
void ConstructJSObject(v8::Isolate* isolate,
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
v8::TracedReference<v8::Object>* handle) {
|
2020-05-05 09:19:02 +02:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Object> object(v8::Object::New(isolate));
|
|
|
|
CHECK(!object.IsEmpty());
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
*handle = v8::TracedReference<v8::Object>(isolate, object);
|
|
|
|
CHECK(!handle->IsEmpty());
|
2020-05-05 09:19:02 +02:00
|
|
|
}
|
|
|
|
|
2019-08-01 08:38:30 +02:00
|
|
|
template <typename HandleContainer>
|
2018-01-24 20:16:06 +01:00
|
|
|
void ConstructJSApiObject(v8::Isolate* isolate, v8::Local<v8::Context> context,
|
2019-08-01 08:38:30 +02:00
|
|
|
HandleContainer* flag_and_persistent) {
|
2018-01-24 20:16:06 +01:00
|
|
|
v8::HandleScope handle_scope(isolate);
|
|
|
|
v8::Local<v8::FunctionTemplate> fun =
|
|
|
|
v8::FunctionTemplate::New(isolate, SimpleCallback);
|
|
|
|
v8::Local<v8::Object> object = fun->GetFunction(context)
|
|
|
|
.ToLocalChecked()
|
|
|
|
->NewInstance(context)
|
|
|
|
.ToLocalChecked();
|
|
|
|
CHECK(!object.IsEmpty());
|
|
|
|
flag_and_persistent->handle.Reset(isolate, object);
|
|
|
|
CHECK(!flag_and_persistent->handle.IsEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
enum class SurvivalMode { kSurvives, kDies };
|
|
|
|
|
2019-08-01 08:38:30 +02:00
|
|
|
template <typename ConstructFunction, typename ModifierFunction,
|
|
|
|
typename GCFunction>
|
2018-01-24 20:16:06 +01:00
|
|
|
void WeakHandleTest(v8::Isolate* isolate, ConstructFunction construct_function,
|
|
|
|
ModifierFunction modifier_function, GCFunction gc_function,
|
|
|
|
SurvivalMode survives) {
|
2024-09-17 12:09:47 +02:00
|
|
|
ManualGCScope manual_gc_scope(reinterpret_cast<internal::Isolate*>(isolate));
|
2018-01-24 20:16:06 +01:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Context> context = v8::Context::New(isolate);
|
|
|
|
v8::Context::Scope context_scope(context);
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
FlagAndHandles fp;
|
2018-01-24 20:16:06 +01:00
|
|
|
construct_function(isolate, context, &fp);
|
2022-09-21 13:28:42 +02:00
|
|
|
CHECK(IsNewObjectInCorrectGeneration(isolate, fp.handle));
|
2018-01-24 20:16:06 +01:00
|
|
|
fp.handle.SetWeak(&fp, &ResetHandleAndSetFlag,
|
|
|
|
v8::WeakCallbackType::kParameter);
|
|
|
|
fp.flag = false;
|
|
|
|
modifier_function(&fp);
|
|
|
|
gc_function();
|
|
|
|
CHECK_IMPLIES(survives == SurvivalMode::kSurvives, !fp.flag);
|
|
|
|
CHECK_IMPLIES(survives == SurvivalMode::kDies, fp.flag);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmptyWeakCallback(const v8::WeakCallbackInfo<void>& data) {}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
class GlobalHandlesTest : public TestWithContext {
|
|
|
|
protected:
|
|
|
|
template <typename ConstructFunction, typename ModifierFunction>
|
|
|
|
void TracedReferenceTestWithScavenge(ConstructFunction construct_function,
|
|
|
|
ModifierFunction modifier_function,
|
|
|
|
SurvivalMode survives) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2023-03-30 12:11:08 +02:00
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
2022-09-21 13:28:42 +02:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Context> context = v8::Context::New(isolate);
|
|
|
|
v8::Context::Scope context_scope(context);
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
NonRootingEmbedderRootsHandler roots_handler;
|
|
|
|
v8_isolate()->SetEmbedderRootsHandler(&roots_handler);
|
2022-09-21 13:28:42 +02:00
|
|
|
|
|
|
|
auto fp = std::make_unique<TracedReferenceWrapper>();
|
2023-03-30 12:11:08 +02:00
|
|
|
roots_handler.Register(fp.get());
|
2022-09-21 13:28:42 +02:00
|
|
|
construct_function(isolate, context, fp.get());
|
|
|
|
CHECK(IsNewObjectInCorrectGeneration(isolate, fp->handle));
|
|
|
|
modifier_function(fp.get());
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMinorGC();
|
2022-09-21 13:28:42 +02:00
|
|
|
// Scavenge clear properly resets the original handle, so we can check the
|
|
|
|
// handle directly here.
|
|
|
|
CHECK_IMPLIES(survives == SurvivalMode::kSurvives, !fp->handle.IsEmpty());
|
|
|
|
CHECK_IMPLIES(survives == SurvivalMode::kDies, fp->handle.IsEmpty());
|
2023-03-30 12:11:08 +02:00
|
|
|
|
|
|
|
v8_isolate()->SetEmbedderRootsHandler(nullptr);
|
2022-09-21 13:28:42 +02:00
|
|
|
}
|
|
|
|
};
|
2018-01-24 20:16:06 +01:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, EternalHandles) {
|
|
|
|
Isolate* isolate = i_isolate();
|
2013-08-10 16:27:43 +02:00
|
|
|
v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
|
2013-10-22 15:14:25 -07:00
|
|
|
EternalHandles* eternal_handles = isolate->eternal_handles();
|
2013-08-10 16:27:43 +02:00
|
|
|
|
|
|
|
// Create a number of handles that will not be on a block boundary
|
2022-09-21 13:28:42 +02:00
|
|
|
const int kArrayLength = 2048 - 1;
|
2013-08-10 16:27:43 +02:00
|
|
|
int indices[kArrayLength];
|
2013-10-22 15:14:25 -07:00
|
|
|
v8::Eternal<v8::Value> eternals[kArrayLength];
|
2013-08-10 16:27:43 +02:00
|
|
|
|
2019-03-12 09:01:49 +01:00
|
|
|
CHECK_EQ(0, eternal_handles->handles_count());
|
2013-08-10 16:27:43 +02:00
|
|
|
for (int i = 0; i < kArrayLength; i++) {
|
2013-10-22 15:14:25 -07:00
|
|
|
indices[i] = -1;
|
2013-08-10 16:27:43 +02:00
|
|
|
HandleScope scope(isolate);
|
2014-03-13 20:45:44 +04:00
|
|
|
v8::Local<v8::Object> object = v8::Object::New(v8_isolate);
|
2022-09-21 13:28:42 +02:00
|
|
|
object
|
|
|
|
->Set(v8_isolate->GetCurrentContext(), i,
|
|
|
|
v8::Integer::New(v8_isolate, i))
|
2016-03-01 08:58:05 -08:00
|
|
|
.FromJust();
|
2013-10-22 15:14:25 -07:00
|
|
|
// Create with internal api
|
2024-04-18 07:06:43 +02:00
|
|
|
eternal_handles->Create(isolate, *v8::Utils::OpenDirectHandle(*object),
|
2022-09-21 13:28:42 +02:00
|
|
|
&indices[i]);
|
2013-10-22 15:14:25 -07:00
|
|
|
// Create with external api
|
|
|
|
CHECK(eternals[i].IsEmpty());
|
|
|
|
eternals[i].Set(v8_isolate, object);
|
|
|
|
CHECK(!eternals[i].IsEmpty());
|
2013-08-10 16:27:43 +02:00
|
|
|
}
|
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
{
|
|
|
|
// We need to invoke GC without stack, otherwise some objects may not be
|
|
|
|
// reclaimed because of conservative stack scanning.
|
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
isolate->heap());
|
|
|
|
InvokeMemoryReducingMajorGCs(isolate);
|
|
|
|
}
|
2013-08-10 16:27:43 +02:00
|
|
|
|
|
|
|
for (int i = 0; i < kArrayLength; i++) {
|
|
|
|
for (int j = 0; j < 2; j++) {
|
|
|
|
HandleScope scope(isolate);
|
2013-10-22 15:14:25 -07:00
|
|
|
v8::Local<v8::Value> local;
|
2013-08-10 16:27:43 +02:00
|
|
|
if (j == 0) {
|
|
|
|
// Test internal api
|
2013-10-22 15:14:25 -07:00
|
|
|
local = v8::Utils::ToLocal(eternal_handles->Get(indices[i]));
|
2013-08-10 16:27:43 +02:00
|
|
|
} else {
|
|
|
|
// Test external api
|
2013-10-22 15:14:25 -07:00
|
|
|
local = eternals[i].Get(v8_isolate);
|
2013-08-10 16:27:43 +02:00
|
|
|
}
|
2016-03-01 08:58:05 -08:00
|
|
|
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(local);
|
|
|
|
v8::Local<v8::Value> value =
|
|
|
|
object->Get(v8_isolate->GetCurrentContext(), i).ToLocalChecked();
|
2013-08-10 16:27:43 +02:00
|
|
|
CHECK(value->IsInt32());
|
2016-03-01 08:58:05 -08:00
|
|
|
CHECK_EQ(i,
|
|
|
|
value->Int32Value(v8_isolate->GetCurrentContext()).FromJust());
|
2013-08-10 16:27:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-12 09:01:49 +01:00
|
|
|
CHECK_EQ(2 * kArrayLength, eternal_handles->handles_count());
|
2013-10-22 15:14:25 -07:00
|
|
|
|
|
|
|
// Create an eternal via the constructor
|
|
|
|
{
|
|
|
|
HandleScope scope(isolate);
|
2014-03-13 20:45:44 +04:00
|
|
|
v8::Local<v8::Object> object = v8::Object::New(v8_isolate);
|
2013-10-22 15:14:25 -07:00
|
|
|
v8::Eternal<v8::Object> eternal(v8_isolate, object);
|
|
|
|
CHECK(!eternal.IsEmpty());
|
|
|
|
CHECK(object == eternal.Get(v8_isolate));
|
|
|
|
}
|
|
|
|
|
2019-03-12 09:01:49 +01:00
|
|
|
CHECK_EQ(2 * kArrayLength + 1, eternal_handles->handles_count());
|
2013-08-10 16:27:43 +02:00
|
|
|
}
|
2015-10-06 08:42:38 +02:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, PersistentBaseGetLocal) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2015-10-06 08:42:38 +02:00
|
|
|
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Object> o = v8::Object::New(isolate);
|
|
|
|
CHECK(!o.IsEmpty());
|
|
|
|
v8::Persistent<v8::Object> p(isolate, o);
|
|
|
|
CHECK(o == p.Get(isolate));
|
|
|
|
CHECK(v8::Local<v8::Object>::New(isolate, p) == p.Get(isolate));
|
|
|
|
|
|
|
|
v8::Global<v8::Object> g(isolate, o);
|
|
|
|
CHECK(o == g.Get(isolate));
|
|
|
|
CHECK(v8::Local<v8::Object>::New(isolate, g) == g.Get(isolate));
|
|
|
|
}
|
2016-03-01 08:58:05 -08:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, WeakPersistentSmi) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2016-03-01 08:58:05 -08:00
|
|
|
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Number> n = v8::Number::New(isolate, 0);
|
|
|
|
v8::Global<v8::Number> g(isolate, n);
|
|
|
|
|
|
|
|
// Should not crash.
|
2018-01-24 20:16:06 +01:00
|
|
|
g.SetWeak<void>(nullptr, &EmptyWeakCallback,
|
|
|
|
v8::WeakCallbackType::kParameter);
|
2016-09-06 22:49:51 +02:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, PhantomHandlesWithoutCallbacks) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2023-03-30 12:11:08 +02:00
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
2016-09-06 22:49:51 +02:00
|
|
|
|
|
|
|
v8::Global<v8::Object> g1, g2;
|
|
|
|
{
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
g1.Reset(isolate, v8::Object::New(isolate));
|
|
|
|
g1.SetWeak();
|
|
|
|
g2.Reset(isolate, v8::Object::New(isolate));
|
|
|
|
g2.SetWeak();
|
|
|
|
}
|
2022-09-21 13:28:42 +02:00
|
|
|
CHECK(!g1.IsEmpty());
|
|
|
|
CHECK(!g2.IsEmpty());
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMemoryReducingMajorGCs(i_isolate());
|
2022-09-21 13:28:42 +02:00
|
|
|
CHECK(g1.IsEmpty());
|
|
|
|
CHECK(g2.IsEmpty());
|
2016-09-06 22:49:51 +02:00
|
|
|
}
|
2017-10-18 15:03:02 -07:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSObjectDiesOnScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
// We need to invoke GC without stack, otherwise the object may survive.
|
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSObject<FlagAndHandles>,
|
2023-10-05 08:46:07 +02:00
|
|
|
[](FlagAndHandles* fp) {}, [this]() { InvokeMinorGC(); },
|
2023-03-30 12:11:08 +02:00
|
|
|
SurvivalMode::kDies);
|
2019-08-01 08:38:30 +02:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, TracedReferenceToUnmodifiedJSObjectSurvivesScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
|
|
|
ManualGCScope manual_gc(i_isolate());
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
TracedReferenceTestWithScavenge(
|
2022-09-21 13:28:42 +02:00
|
|
|
&ConstructJSObject<TracedReferenceWrapper>,
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
[](TracedReferenceWrapper* fp) {}, SurvivalMode::kSurvives);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSObjectDiesOnMarkCompact) {
|
2023-03-30 12:11:08 +02:00
|
|
|
// We need to invoke GC without stack, otherwise the object may survive.
|
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSObject<FlagAndHandles>,
|
2023-10-05 08:46:07 +02:00
|
|
|
[](FlagAndHandles* fp) {}, [this]() { InvokeMajorGC(); },
|
2023-03-30 12:11:08 +02:00
|
|
|
SurvivalMode::kDies);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
WeakHandleToUnmodifiedJSObjectSurvivesMarkCompactWhenInHandle) {
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSObject<FlagAndHandles>,
|
|
|
|
[this](FlagAndHandles* fp) {
|
|
|
|
fp->local = v8::Local<v8::Object>::New(v8_isolate(), fp->handle);
|
2018-01-24 20:16:06 +01:00
|
|
|
},
|
2023-10-05 08:46:07 +02:00
|
|
|
[this]() { InvokeMajorGC(); }, SurvivalMode::kSurvives);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSApiObjectDiesOnScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
// We need to invoke GC without stack, otherwise the object may survive.
|
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSApiObject<FlagAndHandles>,
|
2023-10-05 08:46:07 +02:00
|
|
|
[](FlagAndHandles* fp) {}, [this]() { InvokeMinorGC(); },
|
2019-08-01 08:38:30 +02:00
|
|
|
SurvivalMode::kDies);
|
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
TracedReferenceToJSApiObjectWithIdentityHashSurvivesScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
2021-07-14 11:30:07 +02:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
ManualGCScope manual_gc(i_isolate());
|
|
|
|
Isolate* isolate = i_isolate();
|
|
|
|
HandleScope scope(isolate);
|
|
|
|
Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap();
|
2019-05-28 08:46:21 -04:00
|
|
|
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
TracedReferenceTestWithScavenge(
|
2022-09-21 13:28:42 +02:00
|
|
|
&ConstructJSApiObject<TracedReferenceWrapper>,
|
|
|
|
[this, &weakmap, isolate](TracedReferenceWrapper* fp) {
|
|
|
|
v8::HandleScope scope(v8_isolate());
|
2025-04-29 08:03:15 +02:00
|
|
|
DirectHandle<JSReceiver> key =
|
|
|
|
Utils::OpenDirectHandle(*fp->handle.Get(v8_isolate()));
|
2024-08-14 20:41:00 +02:00
|
|
|
DirectHandle<Smi> smi(Smi::FromInt(23), isolate);
|
2023-10-05 08:46:07 +02:00
|
|
|
int32_t hash = Object::GetOrCreateHash(*key, isolate).value();
|
2019-05-28 08:46:21 -04:00
|
|
|
JSWeakCollection::Set(weakmap, key, smi, hash);
|
|
|
|
},
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
SurvivalMode::kSurvives);
|
2019-05-28 08:46:21 -04:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
WeakHandleToUnmodifiedJSApiObjectSurvivesScavengeWhenInHandle) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSApiObject<FlagAndHandles>,
|
|
|
|
[this](FlagAndHandles* fp) {
|
|
|
|
fp->local = v8::Local<v8::Object>::New(v8_isolate(), fp->handle);
|
2018-01-24 20:16:06 +01:00
|
|
|
},
|
2023-10-05 08:46:07 +02:00
|
|
|
[this]() { InvokeMinorGC(); }, SurvivalMode::kSurvives);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, WeakHandleToUnmodifiedJSApiObjectDiesOnMarkCompact) {
|
2023-03-30 12:11:08 +02:00
|
|
|
// We need to invoke GC without stack, otherwise the object may survive.
|
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSApiObject<FlagAndHandles>,
|
2023-10-05 08:46:07 +02:00
|
|
|
[](FlagAndHandles* fp) {}, [this]() { InvokeMajorGC(); },
|
2019-08-01 08:38:30 +02:00
|
|
|
SurvivalMode::kDies);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
WeakHandleToUnmodifiedJSApiObjectSurvivesMarkCompactWhenInHandle) {
|
2018-01-24 20:16:06 +01:00
|
|
|
WeakHandleTest(
|
2023-03-30 12:11:08 +02:00
|
|
|
v8_isolate(), &ConstructJSApiObject<FlagAndHandles>,
|
|
|
|
[this](FlagAndHandles* fp) {
|
|
|
|
fp->local = v8::Local<v8::Object>::New(v8_isolate(), fp->handle);
|
2018-01-24 20:16:06 +01:00
|
|
|
},
|
2023-10-05 08:46:07 +02:00
|
|
|
[this]() { InvokeMajorGC(); }, SurvivalMode::kSurvives);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
TracedReferenceToJSApiObjectWithModifiedMapSurvivesScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2018-01-24 20:16:06 +01:00
|
|
|
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
TracedReference<v8::Object> handle;
|
2019-08-01 08:38:30 +02:00
|
|
|
{
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
// Create an API object which does not have the same map as constructor.
|
|
|
|
auto function_template = FunctionTemplate::New(isolate);
|
|
|
|
auto instance_t = function_template->InstanceTemplate();
|
2020-10-15 20:17:08 +02:00
|
|
|
instance_t->Set(isolate, "a", v8::Number::New(isolate, 10));
|
2019-08-01 08:38:30 +02:00
|
|
|
auto function =
|
2022-09-21 13:28:42 +02:00
|
|
|
function_template->GetFunction(v8_context()).ToLocalChecked();
|
|
|
|
auto i = function->NewInstance(v8_context()).ToLocalChecked();
|
2019-08-01 08:38:30 +02:00
|
|
|
handle.Reset(isolate, i);
|
|
|
|
}
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMinorGC();
|
2019-08-01 08:38:30 +02:00
|
|
|
CHECK(!handle.IsEmpty());
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest,
|
|
|
|
TracedReferenceTOJsApiObjectWithElementsSurvivesScavenge) {
|
|
|
|
if (v8_flags.single_generation) return;
|
|
|
|
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2019-08-01 08:38:30 +02:00
|
|
|
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
TracedReference<v8::Object> handle;
|
2019-08-01 08:38:30 +02:00
|
|
|
{
|
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
|
|
|
|
// Create an API object which has elements.
|
|
|
|
auto function_template = FunctionTemplate::New(isolate);
|
|
|
|
auto instance_t = function_template->InstanceTemplate();
|
2020-10-15 20:17:08 +02:00
|
|
|
instance_t->Set(isolate, "1", v8::Number::New(isolate, 10));
|
|
|
|
instance_t->Set(isolate, "2", v8::Number::New(isolate, 10));
|
2019-08-01 08:38:30 +02:00
|
|
|
auto function =
|
2022-09-21 13:28:42 +02:00
|
|
|
function_template->GetFunction(v8_context()).ToLocalChecked();
|
|
|
|
auto i = function->NewInstance(v8_context()).ToLocalChecked();
|
2019-08-01 08:38:30 +02:00
|
|
|
handle.Reset(isolate, i);
|
|
|
|
}
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMinorGC();
|
2019-08-01 08:38:30 +02:00
|
|
|
CHECK(!handle.IsEmpty());
|
2019-03-12 09:01:49 +01:00
|
|
|
}
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
namespace {
|
|
|
|
|
2023-10-05 08:46:07 +02:00
|
|
|
void ForceMinorGC2(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-01-24 20:16:06 +01:00
|
|
|
data.GetParameter()->flag = true;
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMinorGC(reinterpret_cast<Isolate*>(data.GetIsolate()));
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2023-10-05 08:46:07 +02:00
|
|
|
void ForceMinorGC1(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-01-24 20:16:06 +01:00
|
|
|
data.GetParameter()->handle.Reset();
|
2023-10-05 08:46:07 +02:00
|
|
|
data.SetSecondPassCallback(ForceMinorGC2);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2023-10-05 08:46:07 +02:00
|
|
|
void ForceMajorGC2(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-01-24 20:16:06 +01:00
|
|
|
data.GetParameter()->flag = true;
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC(reinterpret_cast<Isolate*>(data.GetIsolate()));
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
2023-10-05 08:46:07 +02:00
|
|
|
void ForceMajorGC1(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-01-24 20:16:06 +01:00
|
|
|
data.GetParameter()->handle.Reset();
|
2023-10-05 08:46:07 +02:00
|
|
|
data.SetSecondPassCallback(ForceMajorGC2);
|
2018-01-24 20:16:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, GCFromWeakCallbacks) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2024-09-17 12:09:47 +02:00
|
|
|
ManualGCScope manual_gc_scope(i_isolate());
|
2023-03-30 12:11:08 +02:00
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
2018-01-24 20:16:06 +01:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Context> context = v8::Context::New(isolate);
|
|
|
|
v8::Context::Scope context_scope(context);
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
if (v8_flags.single_generation) {
|
2023-03-30 12:11:08 +02:00
|
|
|
FlagAndHandles fp;
|
2020-10-15 20:17:08 +02:00
|
|
|
ConstructJSApiObject(isolate, context, &fp);
|
2022-11-18 09:50:46 +00:00
|
|
|
CHECK_IMPLIES(!v8_flags.single_generation,
|
|
|
|
!InYoungGeneration(isolate, fp.handle));
|
2020-10-15 20:17:08 +02:00
|
|
|
fp.flag = false;
|
2023-10-05 08:46:07 +02:00
|
|
|
fp.handle.SetWeak(&fp, &ForceMajorGC1, v8::WeakCallbackType::kParameter);
|
|
|
|
InvokeMajorGC();
|
2022-09-21 13:28:42 +02:00
|
|
|
EmptyMessageQueues();
|
2020-10-15 20:17:08 +02:00
|
|
|
CHECK(fp.flag);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-24 20:16:06 +01:00
|
|
|
static const int kNumberOfGCTypes = 2;
|
2023-03-30 12:11:08 +02:00
|
|
|
using Callback = v8::WeakCallbackInfo<FlagAndHandles>::Callback;
|
2023-10-05 08:46:07 +02:00
|
|
|
Callback gc_forcing_callback[kNumberOfGCTypes] = {&ForceMinorGC1,
|
|
|
|
&ForceMajorGC1};
|
2018-01-24 20:16:06 +01:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
using GCInvoker = std::function<void(void)>;
|
2023-10-05 08:46:07 +02:00
|
|
|
GCInvoker invoke_gc[kNumberOfGCTypes] = {[this]() { InvokeMinorGC(); },
|
|
|
|
[this]() { InvokeMajorGC(); }};
|
2018-01-24 20:16:06 +01:00
|
|
|
|
|
|
|
for (int outer_gc = 0; outer_gc < kNumberOfGCTypes; outer_gc++) {
|
|
|
|
for (int inner_gc = 0; inner_gc < kNumberOfGCTypes; inner_gc++) {
|
2023-03-30 12:11:08 +02:00
|
|
|
FlagAndHandles fp;
|
2018-01-24 20:16:06 +01:00
|
|
|
ConstructJSApiObject(isolate, context, &fp);
|
2022-09-21 13:28:42 +02:00
|
|
|
CHECK(InYoungGeneration(isolate, fp.handle));
|
2018-01-24 20:16:06 +01:00
|
|
|
fp.flag = false;
|
|
|
|
fp.handle.SetWeak(&fp, gc_forcing_callback[inner_gc],
|
|
|
|
v8::WeakCallbackType::kParameter);
|
|
|
|
invoke_gc[outer_gc]();
|
2022-09-21 13:28:42 +02:00
|
|
|
EmptyMessageQueues();
|
2018-01-24 20:16:06 +01:00
|
|
|
CHECK(fp.flag);
|
|
|
|
}
|
|
|
|
}
|
2017-12-05 16:41:55 +01:00
|
|
|
}
|
|
|
|
|
2018-09-07 17:07:13 +02:00
|
|
|
namespace {
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
void SecondPassCallback(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-09-07 17:07:13 +02:00
|
|
|
data.GetParameter()->flag = true;
|
|
|
|
}
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
void FirstPassCallback(const v8::WeakCallbackInfo<FlagAndHandles>& data) {
|
2018-09-07 17:07:13 +02:00
|
|
|
data.GetParameter()->handle.Reset();
|
|
|
|
data.SetSecondPassCallback(SecondPassCallback);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, SecondPassPhantomCallbacks) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2023-03-30 12:11:08 +02:00
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
2018-09-07 17:07:13 +02:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
v8::Local<v8::Context> context = v8::Context::New(isolate);
|
|
|
|
v8::Context::Scope context_scope(context);
|
2023-03-30 12:11:08 +02:00
|
|
|
FlagAndHandles fp;
|
2018-09-07 17:07:13 +02:00
|
|
|
ConstructJSApiObject(isolate, context, &fp);
|
|
|
|
fp.flag = false;
|
|
|
|
fp.handle.SetWeak(&fp, FirstPassCallback, v8::WeakCallbackType::kParameter);
|
|
|
|
CHECK(!fp.flag);
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
|
|
|
InvokeMajorGC();
|
2018-09-07 17:07:13 +02:00
|
|
|
CHECK(fp.flag);
|
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, MoveStrongGlobal) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2019-03-15 18:35:06 +05:30
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
|
|
|
|
v8::Global<v8::Object>* global = new Global<v8::Object>();
|
|
|
|
ConstructJSObject(isolate, global);
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
2019-03-15 18:35:06 +05:30
|
|
|
v8::Global<v8::Object> global2(std::move(*global));
|
|
|
|
delete global;
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
2019-03-15 18:35:06 +05:30
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, MoveWeakGlobal) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2019-03-15 18:35:06 +05:30
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
|
|
|
|
v8::Global<v8::Object>* global = new Global<v8::Object>();
|
|
|
|
ConstructJSObject(isolate, global);
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
2019-03-15 18:35:06 +05:30
|
|
|
global->SetWeak();
|
|
|
|
v8::Global<v8::Object> global2(std::move(*global));
|
|
|
|
delete global;
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
2019-03-15 18:35:06 +05:30
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, TotalSizeRegularNode) {
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2020-05-05 09:19:02 +02:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
|
2024-03-30 09:54:35 +01:00
|
|
|
// This is not necessarily zero, if the implementation of tests uses global
|
|
|
|
// handles.
|
|
|
|
size_t initial_total = i_isolate()->global_handles()->TotalSize();
|
|
|
|
size_t initial_used = i_isolate()->global_handles()->UsedSize();
|
|
|
|
|
2020-05-05 09:19:02 +02:00
|
|
|
v8::Global<v8::Object>* global = new Global<v8::Object>();
|
2024-03-30 09:54:35 +01:00
|
|
|
CHECK_EQ(i_isolate()->global_handles()->TotalSize(), initial_total);
|
|
|
|
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), initial_used);
|
2020-05-05 09:19:02 +02:00
|
|
|
ConstructJSObject(isolate, global);
|
2024-03-30 09:54:35 +01:00
|
|
|
CHECK_GE(i_isolate()->global_handles()->TotalSize(), initial_total);
|
|
|
|
CHECK_GT(i_isolate()->global_handles()->UsedSize(), initial_used);
|
2020-05-05 09:19:02 +02:00
|
|
|
delete global;
|
2024-03-30 09:54:35 +01:00
|
|
|
CHECK_GE(i_isolate()->global_handles()->TotalSize(), initial_total);
|
|
|
|
CHECK_EQ(i_isolate()->global_handles()->UsedSize(), initial_used);
|
2020-05-05 09:19:02 +02:00
|
|
|
}
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
TEST_F(GlobalHandlesTest, TotalSizeTracedNode) {
|
2025-04-29 08:03:15 +02:00
|
|
|
DisableConservativeStackScanningScopeForTesting no_stack_scanning(
|
|
|
|
i_isolate()->heap());
|
2022-09-21 13:28:42 +02:00
|
|
|
ManualGCScope manual_gc(i_isolate());
|
|
|
|
v8::Isolate* isolate = v8_isolate();
|
2020-05-05 09:19:02 +02:00
|
|
|
v8::HandleScope scope(isolate);
|
|
|
|
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
v8::TracedReference<v8::Object>* handle = new TracedReference<v8::Object>();
|
2022-11-22 09:57:37 -05:00
|
|
|
CHECK_EQ(i_isolate()->traced_handles()->total_size_bytes(), 0);
|
|
|
|
CHECK_EQ(i_isolate()->traced_handles()->used_size_bytes(), 0);
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
ConstructJSObject(isolate, handle);
|
2022-11-22 09:57:37 -05:00
|
|
|
CHECK_GT(i_isolate()->traced_handles()->total_size_bytes(), 0);
|
|
|
|
CHECK_GT(i_isolate()->traced_handles()->used_size_bytes(), 0);
|
deps: V8: cherry-pick semver-major commits from 10.2
Includes the following commits:
commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Remove dynamic map checks and custom deoptimization kinds
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
Fixed: v8:12552
Change-Id: I492cf1667e0f54586690b2f72a65ea804224b840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401585
commit f52f934119635058b179c2359fe070b8ee0f9233
PPC/s390: Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Original Commit Message:
This CL removes:
- Dynamic map checks aka minimorphic property loads (TF support,
builtins).
- "Bailout" deopts (= drop to the interpreter once, but don't
throw out optimized code).
- "EagerWithResume" deopts (= part of dynamic map check
functionality, we call a builtin for the deopt check and deopt
or resume based on the result).
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I64476f73810774c2c592231d82c4a2cbfa2bf94e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537881
commit 38940b70986da6b43d18cb8cf8f0a3be36ca9010
[loong64][mips] Remove dynamic map checks and custom deoptimization kinds
Port commit b2978927d8a96ebc814cccbc5a9f1c35910ee621
Fixed: v8:12552
Change-Id: Ic2fbded9a662ed840a0350e3ce049e147fbf03a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3541527
commit da5b5f66a6bd27df6249602378300c6961bc62b4
[riscv64] Remove dynamic map checks and custom deoptimization kinds
Port b2978927d8a96ebc814cccbc5a9f1c35910ee621
Bug: v8:12552
Change-Id: I73e76fc5cc8905a0fbfc801b2f794735866d19e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3544725
commit ffae028b37991566c080c5528463f7d16017668c
Forward deprecation for resurrecting finalizer
Bug: v8:12672
Change-Id: Ib4f53086436e028b4ea32fbc960f57e91709d184
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532256
commit f6386018d472665e36d662c8b159d95325999d69
[api] Remove TracedGlobal<>
Remove deprecated TracedGlobal<>, greatly simplifying handling of
traced references in general.
Also saves a word per v8::TracedReference as there's no need to keep a
possible callback around.
Bug: v8:12603
Change-Id: Ice35d7906775b912d02e97a27a722b3e1cec28d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532251
commit a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Deprecate some signature checks
Deprecate signature checks in
* Template::SetNativeDataProperty
* ObjectTemplate::SetAccessor
These are not used in Chrome and require some complicated check in the IC code, which we want to remove.
Change-Id: I413fafc8658e922fd590e7fe200600a624f019a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3557253
commit cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Deprecate signature checks in Set{Accessor,NativeDataProperty}
Change from V8_DEPRECATE_SOON to V8_DEPRECATED. It turned out that we
don't have to make changes in chrome code, so we can go to deprecated
right away.
Bug: chromium:1310790
Change-Id: I1bd529536d3a0098f11f13b3e44fe3dbc80eed04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571897
commit 9238afb0c0ee52c9111a7e9f2f055137628771ad
Allow embedder to set global OOM handler
Embedders can currently specify a callback for OOM errors during
Isolate initialization. However, there are cases where an OOM error can
be thrown in a context where we don't have access to an Isolate, for
example on a task posted to a worker thread. This CL introduces an
initialization API to allow the embedder to specify a process-wide OOM
callback.
Bug: chromium:614440
Change-Id: I326753d80767679f677e85104d9edeef92e19086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3561916
commit ca51ae3ac8b468509603633adb6ee3b3be9306ec
[api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.
Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Refs: https://github.com/v8/v8/commit/b2978927d8a96ebc814cccbc5a9f1c35910ee621
Refs: https://github.com/v8/v8/commit/f52f934119635058b179c2359fe070b8ee0f9233
Refs: https://github.com/v8/v8/commit/38940b70986da6b43d18cb8cf8f0a3be36ca9010
Refs: https://github.com/v8/v8/commit/da5b5f66a6bd27df6249602378300c6961bc62b4
Refs: https://github.com/v8/v8/commit/ffae028b37991566c080c5528463f7d16017668c
Refs: https://github.com/v8/v8/commit/f6386018d472665e36d662c8b159d95325999d69
Refs: https://github.com/v8/v8/commit/a8beac553b0a1639bc9790c2d6f82caf6b2e150f
Refs: https://github.com/v8/v8/commit/cff2b5000a1aa417a9c4499bcfa3ffda4542f4f1
Refs: https://github.com/v8/v8/commit/9238afb0c0ee52c9111a7e9f2f055137628771ad
Refs: https://github.com/v8/v8/commit/ca51ae3ac8b468509603633adb6ee3b3be9306ec
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>
2022-04-12 11:44:13 +02:00
|
|
|
delete handle;
|
2023-10-05 08:46:07 +02:00
|
|
|
InvokeMajorGC();
|
2022-11-22 09:57:37 -05:00
|
|
|
CHECK_GT(i_isolate()->traced_handles()->total_size_bytes(), 0);
|
|
|
|
CHECK_EQ(i_isolate()->traced_handles()->used_size_bytes(), 0);
|
2020-05-05 09:19:02 +02:00
|
|
|
}
|
|
|
|
|
2017-10-18 15:03:02 -07:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|