Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

v21.3.0 proposal #50954

Merged
merged 114 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
982b576
test: migrate message v8 tests from Python to JS
jahjahLemonade Oct 29, 2023
0bd694a
test_runner: add tests for various mock timer issues
mika-fischer Nov 12, 2023
7ebc8c2
test,stream: enable compression WPTs
panva Nov 8, 2023
146ad9c
stream: treat compression web stream format per its WebIDL definition
panva Nov 9, 2023
0d556d9
tools: update lint-md-dependencies to [email protected]
nodejs-github-bot Nov 12, 2023
75265e4
test: replace forEach with for...of
SpaceDux Nov 12, 2023
3731f83
deps: V8: cherry-pick 8f0b94671ddb
luyahan Nov 12, 2023
57587de
src: handle errors from uv_pipe_connect2()
deokjinkim Nov 12, 2023
8746073
src: avoid silent coercion to signed/unsigned int
tniessen Nov 12, 2023
673de30
node-api: factor out common code into macros
gabrielschulhof Nov 12, 2023
c494838
tools: change minimatch install strategy
marco-ippolito Nov 13, 2023
342a83e
test: change forEach to for...of in path extname
marquicodes Nov 13, 2023
4a1ce45
src: make process binding data weak
legendecas Nov 9, 2023
5c58341
src: create worker per isolate properties
legendecas Nov 9, 2023
91aa9dd
src: create fs_dir per isolate properties
legendecas Nov 9, 2023
aadff07
src: create per isolate proxy env template
legendecas Nov 9, 2023
bc3f7b5
module: remove useCustomLoadersIfPresent flag
legendecas Nov 9, 2023
c7a7493
module: bootstrap module loaders in shadow realm
legendecas Nov 9, 2023
0d3aa72
src: return error --env-file if file is not found
ardinugrxha Nov 14, 2023
377dede
test: test streambase has already has a consumer
MrJithil May 18, 2023
5d28f8d
deps: escape Python strings correctly
targos Nov 14, 2023
2e8e237
src: fix JSONParser leaking internal V8 scopes
kvakil Nov 14, 2023
5ef6729
tools: remove unused file
UlisesGascon Nov 8, 2023
713fdf1
doc: run license-builder
github-actions[bot] Nov 15, 2023
c81d2ac
benchmark: remove punycode from require-builtins fixture
joyeecheung Nov 15, 2023
db8ce5b
tools: recognize GN files in dep_updaters
zcbenz Nov 15, 2023
0e8275b
test: replace foreach with for
bluescreen Nov 15, 2023
52830b7
tools: add workflow to update release links
targos Nov 15, 2023
6b7403c
doc: fix `Buffer.allocUnsafe` documentation
mertcanaltin Nov 15, 2023
f7245d7
benchmark: add misc/startup-cli-version benchmark
joyeecheung Nov 15, 2023
dee8039
tls: fix order of setting cipher before setting cert and key
kumarrishav Oct 16, 2023
071e46a
deps: upgrade npm to 10.2.4
npm-cli-bot Nov 16, 2023
eaa4c14
util: improve performance of normalizeEncoding
kylo5aby Nov 16, 2023
465f75b
build: disable flag v8_scriptormodule_legacy_lifetime
legendecas Nov 17, 2023
27a4f58
permission: mark const functions as such
tniessen Nov 17, 2023
ead9879
doc: update print results(detail) in `PerformanceEntry`
Nov 17, 2023
6475cee
test: give more time to GC in test-shadow-realm-gc-*
joyeecheung Nov 14, 2023
4088b75
test: mark SEA tests as flaky on PowerPC
joyeecheung Nov 15, 2023
43da9ea
build: fix GN configuration for deps/base64
zcbenz Nov 17, 2023
28d78de
test: skip parallel/test-macos-app-sandbox if disk space < 120MB
joyeecheung Nov 17, 2023
4b26f14
test: improve test-bootstrap-modules.js
joyeecheung Nov 17, 2023
aebe2fc
perf_hooks: implement performance.now() with fast API calls
joyeecheung Nov 17, 2023
23f56d8
benchmark: rewrite import.meta benchmark
joyeecheung Nov 18, 2023
a0c01b2
deps: update simdutf to 4.0.4
nodejs-github-bot Nov 18, 2023
b4935dd
doc: fix fs.writeFileSync return value documentation
RyanZim Nov 18, 2023
f2e0fce
test: replace forEach() with for-loop
jabro86 Nov 18, 2023
36380eb
benchmark: increase the iteration number to an appropriate value
lucshi Nov 19, 2023
a275155
stream: add Symbol.toStringTag to Compression Streams
panva Nov 13, 2023
2e0abed
stream: yield expected Error class on zlib errors
panva Nov 13, 2023
f25637b
test: update WPT files for WebIDL tests
panva Nov 13, 2023
83ad272
src: remove erroneous default argument in RadixTree
tniessen Nov 19, 2023
0fb35b6
src: avoid copying strings in FSPermission::Apply
tniessen Nov 19, 2023
c8d4cd6
test: replace forEach in whatwg-encoding-custom-interop
HonzaMac Nov 19, 2023
eacf4ba
src: iterate on import attributes array correctly
targos Nov 19, 2023
c3eee59
inspector: use private fields instead of symbols
anonrig Nov 19, 2023
12605e8
build: add configuration flag to enable Maglev
kvakil Nov 12, 2023
0e3b714
test: enable idlharness tests for encoding
MattiasBuelens Nov 20, 2023
8468daf
doc: update Crypto API doc for x509.keyUsage
DMeechan Nov 20, 2023
00dab30
deps: V8: cherry-pick 475c8cdf9a95
kvakil Nov 12, 2023
faf6a04
src: add IsolateScopes before using isolates
kvakil Nov 12, 2023
221952a
test: use ppc and ppc64 to skip SEA tests on PowerPC
joyeecheung Nov 21, 2023
ee69c61
deps: update minimatch to 9.0.3
nodejs-github-bot Nov 21, 2023
daa933d
tools: update lint-md-dependencies to [email protected]
nodejs-github-bot Nov 21, 2023
f216377
tools: update eslint to 8.54.0
nodejs-github-bot Nov 21, 2023
0e4d25e
test: use requires instead of flaky in console WPT status
panva Nov 21, 2023
221f02d
deps: update undici to 5.27.2
nodejs-github-bot Nov 21, 2023
9197b0f
net: check pipe mode and path
theanarkh Nov 21, 2023
3b79983
test: replace forEach() with for ... of in test-tls-getprotocol.js
SociableSteve Nov 21, 2023
82f0882
test: replace forEach with for-of in test-url-relative
vitosorriso Nov 21, 2023
4522e22
stream: fix enumerability of ReadableStream.prototype.values
MattiasBuelens Nov 17, 2023
e5cce00
stream: fix enumerability of ReadableStream.from
MattiasBuelens Nov 20, 2023
628a12a
test: add note about readable streams with type owning
MattiasBuelens Nov 17, 2023
ce8fc56
test: add note about unresolved spec issue
MattiasBuelens Nov 18, 2023
3ff2bda
deps: update ada to 2.7.4
nodejs-github-bot Nov 21, 2023
79ef39b
src: add `--disable-warning` option
Nov 21, 2023
d2c0dfb
crypto: update root certificates to NSS 3.95
nodejs-github-bot Nov 21, 2023
6dfe102
dns: call handle.setServers() with a valid array
lpinca Nov 21, 2023
c31ad5c
deps: update icu to 74.1
nodejs-github-bot Nov 1, 2023
5849f09
build: add GN configurations for simdjson
zcbenz Nov 21, 2023
a37d9ee
doc: fix typos in --allow-fs-*
tniessen Nov 22, 2023
e116fcd
doc: add CanadaHonk to triagers
CanadaHonk Nov 21, 2023
adcab85
src: fix compatility with upcoming V8 12.1 APIs
zcbenz Nov 22, 2023
a12d9e0
tools: use macOS keychain to notarize the releases
UlisesGascon Nov 13, 2023
98fb1fa
doc: create deprecation code for isWebAssemblyCompiledModule
marco-ippolito Nov 22, 2023
3fdecc4
permission: do not create symlinks if target is relative
tniessen Nov 22, 2023
08c3b0a
doc: get rid of unnecessary `eslint-skip` comments
aduh95 Nov 22, 2023
9dc4cde
fs: improve error perf of sync `lstat`+`fstat`
CanadaHonk Nov 23, 2023
bc31375
doc: shard not supported with watch mode
pulkit-30 Nov 23, 2023
9d76de1
test: replace foreach with for in test-https-simple.js
Shikha2410 Nov 23, 2023
5de3053
tools: add macOS notarization verification step
UlisesGascon Nov 21, 2023
492e3e3
fs: replace deprecated `path._makeLong` in copyFile
CanadaHonk Nov 23, 2023
e02f304
deps: V8: cherry-pick 0f9ebbc672c7
legendecas Nov 24, 2023
7f44164
test: replace forEach to for at test-webcrypto-sign-verify-ecdsa.js
StiffWriter00 Nov 24, 2023
b1b6c44
test: replace forEach with for of
RBrNx Nov 24, 2023
7de900a
test: fix dns test case failures after c-ares update to 1.21.0+
bradh352 Nov 15, 2023
5811a59
meta: move cjihrig to TSC regular member
cjihrig Nov 24, 2023
fd9195d
src: fix coverity warning
mhdawson Nov 24, 2023
45b2bb0
fs: fix to not return for void function
Nov 24, 2023
8d3a1d8
deps: update zlib to 1.2.13.1-motley-5daffc7
nodejs-github-bot Nov 24, 2023
6485687
doc: update email to reflect affiliation
anonrig Nov 24, 2023
a5d959b
v8,tools: expose necessary V8 defines
zcbenz Nov 25, 2023
8c4976b
doc: add a section regarding `instanceof` in `primordials.md`
aduh95 Nov 25, 2023
65a811a
meta: clarify recommendation for bug reproductions
aduh95 Nov 25, 2023
feb8ff9
src: assert return value of BN_bn2binpad
tniessen Nov 25, 2023
e4e0add
fs: fix glob returning duplicates
MoLow Nov 26, 2023
4a20912
benchmark: update iterations in benchmark/util/splice-one.js
Septa2112 Nov 26, 2023
1a0069b
meta: clarify nomination process according to Node.js charter
mcollina Nov 26, 2023
483200f
fs: improve error performance for `rmdirSync`
CanadaHonk Nov 26, 2023
e59268a
fs: add c++ fast path for writeFileSync utf8
CanadaHonk Nov 27, 2023
2f13db4
doc: make theme consistent across api and other docs
demakoff Nov 27, 2023
087cffc
test: fix message v8 not normalising alphanumeric paths
MrJithil Nov 14, 2023
bd58870
esm: do not call `getSource` when format is `commonjs`
fasttime Nov 29, 2023
50f336c
esm: fallback to `getSource` when `load` returns nullish `source`
aduh95 Nov 29, 2023
1f0ba08
2023-11-30, Version 21.3.0 (Current)
RafaelGSS Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: V8: cherry-pick 475c8cdf9a95
Original commit message:

    [ptr-compr] Fix multi-cage mode

    This CL introduces PtrComprCageAccessScope which sets/restores current
    thread's pointer compression cage base values. It's supposed to be used
    by V8 jobs accessing V8 heap outside of v8::Isolate::Scope or
    i::LocalHeap or i::LocalIsolate scopes (they already ensure that the
    cage base values are properly initialized).
    For all other build modes PtrComprCageAccessScope is a no-op.

    For simplicity reasons the multi-cage mode is made incompatible with
    external code space.

    Bug: v8:13788, v8:14292
    Change-Id: I06c2d19a1eb7254fa7af07a17617e22d98abea9f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4846592
    Reviewed-by: Jakob Linke <[email protected]>
    Reviewed-by: Jakob Kummerow <[email protected]>
    Commit-Queue: Igor Sheludko <[email protected]>
    Reviewed-by: Dominik Inführ <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#90075}

Refs: v8/v8@475c8cd
PR-URL: #50680
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=14292
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
kvakil authored and RafaelGSS committed Nov 29, 2023
commit 00dab30fd2a834c2900b7a36e4d5e81e48cbd185
7 changes: 7 additions & 0 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ if (v8_enable_short_builtin_calls == "") {
if (v8_enable_external_code_space == "") {
v8_enable_external_code_space =
v8_enable_pointer_compression &&
v8_enable_pointer_compression_shared_cage &&
(v8_current_cpu == "x64" || v8_current_cpu == "arm64")
}
if (v8_enable_maglev == "") {
Expand Down Expand Up @@ -683,6 +684,12 @@ assert(
!v8_enable_pointer_compression_shared_cage || v8_enable_pointer_compression,
"Can't share a pointer compression cage if pointers aren't compressed")

assert(
!v8_enable_pointer_compression ||
v8_enable_pointer_compression_shared_cage ||
!v8_enable_external_code_space,
"Multi-cage pointer compression mode is not compatible with external code space")

assert(
!v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
Expand Down
16 changes: 16 additions & 0 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9227,6 +9227,14 @@ void Isolate::TerminateExecution() {

bool Isolate::IsExecutionTerminating() {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
#ifdef DEBUG
// This method might be called on a thread that's not bound to any Isolate
// and thus pointer compression schemes might have cage base value unset.
// Read-only roots accessors contain type DCHECKs which require access to
// V8 heap in order to check the object type. So, allow heap access here
// to let the checks work.
i::PtrComprCageAccessScope ptr_compr_cage_access_scope(i_isolate);
#endif // DEBUG
return i_isolate->is_execution_terminating();
}

Expand Down Expand Up @@ -9898,6 +9906,14 @@ void Isolate::LowMemoryNotification() {
i::NestedTimedHistogramScope idle_notification_scope(
i_isolate->counters()->gc_low_memory_notification());
TRACE_EVENT0("v8", "V8.GCLowMemoryNotification");
#ifdef DEBUG
// This method might be called on a thread that's not bound to any Isolate
// and thus pointer compression schemes might have cage base value unset.
// Read-only roots accessors contain type DCHECKs which require access to
// V8 heap in order to check the object type. So, allow heap access here
// to let the checks work.
i::PtrComprCageAccessScope ptr_compr_cage_access_scope(i_isolate);
#endif // DEBUG
i_isolate->heap()->CollectAllAvailableGarbage(
i::GarbageCollectionReason::kLowMemoryNotification);
}
Expand Down
31 changes: 27 additions & 4 deletions deps/v8/src/common/ptr-compr-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ Address V8HeapCompressionScheme::DecompressTaggedSigned(Tagged_t raw_value) {
template <typename TOnHeapAddress>
Address V8HeapCompressionScheme::DecompressTagged(TOnHeapAddress on_heap_addr,
Tagged_t raw_value) {
#if defined(V8_COMPRESS_POINTERS_IN_SHARED_CAGE)
#ifdef V8_COMPRESS_POINTERS
Address cage_base = base();
#ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
DCHECK_WITH_MSG(cage_base != kNullAddress,
"V8HeapCompressionScheme::base is not initialized for "
"current thread");
#endif // V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
#else
Address cage_base = GetPtrComprCageBaseAddress(on_heap_addr);
#endif
#endif // V8_COMPRESS_POINTERS
Address result = cage_base + static_cast<Address>(raw_value);
V8_ASSUME(static_cast<uint32_t>(result) == raw_value);
return result;
Expand Down Expand Up @@ -191,11 +196,16 @@ Address ExternalCodeCompressionScheme::DecompressTaggedSigned(
template <typename TOnHeapAddress>
Address ExternalCodeCompressionScheme::DecompressTagged(
TOnHeapAddress on_heap_addr, Tagged_t raw_value) {
#if defined(V8_COMPRESS_POINTERS_IN_SHARED_CAGE)
#ifdef V8_COMPRESS_POINTERS
Address cage_base = base();
#ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
DCHECK_WITH_MSG(cage_base != kNullAddress,
"ExternalCodeCompressionScheme::base is not initialized for "
"current thread");
#endif // V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
#else
Address cage_base = GetPtrComprCageBaseAddress(on_heap_addr);
#endif
#endif // V8_COMPRESS_POINTERS
Address result = cage_base + static_cast<Address>(raw_value);
V8_ASSUME(static_cast<uint32_t>(result) == raw_value);
return result;
Expand Down Expand Up @@ -275,6 +285,19 @@ V8_INLINE PtrComprCageBase GetPtrComprCageBase(Tagged<HeapObject> object) {
return GetPtrComprCageBaseFromOnHeapAddress(object.ptr());
}

#ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE

PtrComprCageAccessScope::PtrComprCageAccessScope(Isolate* isolate)
: cage_base_(V8HeapCompressionScheme::base()) {
V8HeapCompressionScheme::InitBase(isolate->cage_base());
}

PtrComprCageAccessScope::~PtrComprCageAccessScope() {
V8HeapCompressionScheme::InitBase(cage_base_);
}

#endif // V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE

} // namespace internal
} // namespace v8

Expand Down
27 changes: 25 additions & 2 deletions deps/v8/src/common/ptr-compr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class V8HeapCompressionScheme {
private:
// These non-inlined accessors to base_ field are used in component builds
// where cross-component access to thread local variables is not allowed.
static Address base_non_inlined();
static void set_base_non_inlined(Address base);
static V8_EXPORT_PRIVATE Address base_non_inlined();
static V8_EXPORT_PRIVATE void set_base_non_inlined(Address base);

#ifdef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
static V8_EXPORT_PRIVATE uintptr_t base_ V8_CONSTINIT;
Expand Down Expand Up @@ -156,6 +156,29 @@ static inline void WriteMaybeUnalignedValue(Address p, V value) {
}
}

// When multi-cage pointer compression mode is enabled this scope object
// saves current cage's base values and sets them according to given Isolate.
// For all other configurations this scope object is a no-op.
class PtrComprCageAccessScope final {
public:
#ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
V8_INLINE explicit PtrComprCageAccessScope(Isolate* isolate);
V8_INLINE ~PtrComprCageAccessScope();
#else
V8_INLINE explicit PtrComprCageAccessScope(Isolate* isolate) {}
V8_INLINE ~PtrComprCageAccessScope() {}
#endif

private:
#ifdef V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
const Address cage_base_;
#ifdef V8_EXTERNAL_CODE_SPACE
// In case this configuration is necessary the code cage base must be saved too.
#error Multi-cage pointer compression with external code space is not supported
#endif // V8_EXTERNAL_CODE_SPACE
#endif // V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
};

} // namespace v8::internal

#endif // V8_COMMON_PTR_COMPR_H_
8 changes: 8 additions & 0 deletions deps/v8/src/execution/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3933,6 +3933,14 @@ Isolate::~Isolate() {

void Isolate::InitializeThreadLocal() {
thread_local_top()->Initialize(this);
#ifdef DEBUG
// This method might be called on a thread that's not bound to any Isolate
// and thus pointer compression schemes might have cage base value unset.
// Read-only roots accessors contain type DCHECKs which require access to
// V8 heap in order to check the object type. So, allow heap access here
// to let the checks work.
i::PtrComprCageAccessScope ptr_compr_cage_access_scope(this);
#endif // DEBUG
clear_pending_exception();
clear_pending_message();
clear_scheduled_exception();
Expand Down
12 changes: 12 additions & 0 deletions deps/v8/src/execution/v8threads.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ bool ThreadManager::RestoreThread() {
InitThread(access);
return false;
}
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(isolate_);

ThreadState* state = per_thread->thread_state();
char* from = state->data();
from = isolate_->handle_scope_implementer()->RestoreThread(from);
Expand Down Expand Up @@ -274,6 +278,14 @@ void ThreadManager::EagerlyArchiveThread() {
}

void ThreadManager::FreeThreadResources() {
#ifdef DEBUG
// This method might be called on a thread that's not bound to any Isolate
// and thus pointer compression schemes might have cage base value unset.
// Read-only roots accessors contain type DCHECKs which require access to
// V8 heap in order to check the object type. So, allow heap access here
// to let the checks work.
PtrComprCageAccessScope ptr_compr_cage_access_scope(isolate_);
#endif // DEBUG
DCHECK(!isolate_->has_pending_exception());
DCHECK(!isolate_->external_caught_exception());
DCHECK_NULL(isolate_->try_catch_handler());
Expand Down
7 changes: 6 additions & 1 deletion deps/v8/src/heap/collection-barrier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ class BackgroundCollectionInterruptTask : public CancelableTask {

private:
// v8::internal::CancelableTask overrides.
void RunInternal() override { heap_->CheckCollectionRequested(); }
void RunInternal() override {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(heap_->isolate());
heap_->CheckCollectionRequested();
}

Heap* heap_;
};
Expand Down
10 changes: 10 additions & 0 deletions deps/v8/src/heap/concurrent-marking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ class ConcurrentMarking::JobTaskMajor : public v8::JobTask {

// v8::JobTask overrides.
void Run(JobDelegate* delegate) override {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
concurrent_marking_->heap_->isolate());

if (delegate->IsJoiningThread()) {
// TRACE_GC is not needed here because the caller opens the right scope.
concurrent_marking_->RunMajor(delegate, code_flush_mode_,
Expand Down Expand Up @@ -197,6 +202,11 @@ class ConcurrentMarking::JobTaskMinor : public v8::JobTask {

// v8::JobTask overrides.
void Run(JobDelegate* delegate) override {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
concurrent_marking_->heap_->isolate());

if (delegate->IsJoiningThread()) {
TRACE_GC_WITH_FLOW(concurrent_marking_->heap_->tracer(),
GCTracer::Scope::MINOR_MS_MARK_PARALLEL, trace_id_,
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/heap/incremental-marking-job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ void IncrementalMarkingJob::Task::RunInternal() {
VMState<GC> state(isolate());
TRACE_EVENT_CALL_STATS_SCOPED(isolate(), "v8",
"V8.IncrementalMarkingJob.Task");
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(isolate());

isolate()->stack_guard()->ClearStartIncrementalMarking();

Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/heap/local-heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void LocalHeap::VerifyCurrent() const {
LocalHeap::LocalHeap(Heap* heap, ThreadKind kind,
std::unique_ptr<PersistentHandles> persistent_handles)
: heap_(heap),
ptr_compr_cage_access_scope_(heap->isolate()),
is_main_thread_(kind == ThreadKind::kMain),
state_(ThreadState::Parked()),
allocation_failed_(false),
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/heap/local-heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "src/base/platform/condition-variable.h"
#include "src/base/platform/mutex.h"
#include "src/common/assert-scope.h"
#include "src/common/ptr-compr.h"
#include "src/execution/isolate.h"
#include "src/handles/global-handles.h"
#include "src/handles/persistent-handles.h"
Expand Down Expand Up @@ -348,6 +349,7 @@ class V8_EXPORT_PRIVATE LocalHeap {
void SetUpSharedMarking();

Heap* heap_;
V8_NO_UNIQUE_ADDRESS PtrComprCageAccessScope ptr_compr_cage_access_scope_;
bool is_main_thread_;

AtomicThreadState state_;
Expand Down
14 changes: 14 additions & 0 deletions deps/v8/src/heap/mark-compact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,10 @@ class ClearStringTableJobItem final : public ParallelClearingJob::ClearingItem {
GCTracer::Scope::MC_CLEAR_STRING_TABLE)) {}

void Run(JobDelegate* delegate) final {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(isolate_);

if (isolate_->OwnsStringTables()) {
TRACE_GC1_WITH_FLOW(isolate_->heap()->tracer(),
GCTracer::Scope::MC_CLEAR_STRING_TABLE,
Expand Down Expand Up @@ -4135,6 +4139,11 @@ class PageEvacuationJob : public v8::JobTask {
tracer_->CurrentEpoch(GCTracer::Scope::MC_EVACUATE)) {}

void Run(JobDelegate* delegate) override {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
collector_->heap()->isolate());

Evacuator* evacuator = (*evacuators_)[delegate->GetTaskId()].get();
if (delegate->IsJoiningThread()) {
TRACE_GC_WITH_FLOW(tracer_, GCTracer::Scope::MC_EVACUATE_COPY_PARALLEL,
Expand Down Expand Up @@ -4471,6 +4480,11 @@ class PointersUpdatingJob : public v8::JobTask {
tracer_->CurrentEpoch(GCTracer::Scope::MC_EVACUATE)) {}

void Run(JobDelegate* delegate) override {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
collector_->heap()->isolate());

if (delegate->IsJoiningThread()) {
TRACE_GC_WITH_FLOW(tracer_,
GCTracer::Scope::MC_EVACUATE_UPDATE_POINTERS_PARALLEL,
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/heap/mark-compact.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class MarkCompactCollector final {
return use_background_threads_in_cycle_;
}

Heap* heap() { return heap_; }

explicit MarkCompactCollector(Heap* heap);
~MarkCompactCollector();

Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/heap/scavenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ ScavengerCollector::JobTask::JobTask(

void ScavengerCollector::JobTask::Run(JobDelegate* delegate) {
DCHECK_LT(delegate->GetTaskId(), scavengers_->size());
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(outer_->heap_->isolate());

Scavenger* scavenger = (*scavengers_)[delegate->GetTaskId()].get();
if (delegate->IsJoiningThread()) {
TRACE_GC_WITH_FLOW(outer_->heap_->tracer(),
Expand Down
10 changes: 10 additions & 0 deletions deps/v8/src/heap/sweeper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ class Sweeper::MajorSweeperJob final : public JobTask {

private:
void RunImpl(JobDelegate* delegate, bool is_joining_thread) {
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
sweeper_->heap_->isolate());

DCHECK(sweeper_->major_sweeping_in_progress());
const int offset = delegate->GetTaskId();
DCHECK_LT(offset, concurrent_sweepers.size());
Expand Down Expand Up @@ -213,6 +218,11 @@ class Sweeper::MinorSweeperJob final : public JobTask {
tracer_, sweeper_->GetTracingScope(NEW_SPACE, is_joining_thread),
is_joining_thread ? ThreadKind::kMain : ThreadKind::kBackground,
trace_id_, TRACE_EVENT_FLAG_FLOW_IN);
// In case multi-cage pointer compression mode is enabled ensure that
// current thread's cage base values are properly initialized.
PtrComprCageAccessScope ptr_compr_cage_access_scope(
sweeper_->heap_->isolate());

if (!concurrent_sweeper.ConcurrentSweepSpace(delegate)) return;
concurrent_sweeper.ConcurrentSweepPromotedPages(delegate);
}
Expand Down
Loading