diff --git a/common.gypi b/common.gypi index 7c7ece7a381d6b..80c2395cbdec20 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.24', + 'v8_embedder_string': '-node.25', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index 68d651b15fefdc..d5624cb8ace431 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -415,6 +415,16 @@ bool OS::SetPermissions(void* address, size_t size, MemoryPermission access) { int prot = GetProtectionFromMemoryPermission(access); int ret = mprotect(address, size, prot); + + // MacOS 11.2 on Apple Silicon refuses to switch permissions from + // rwx to none. Just use madvise instead. +#if defined(V8_OS_MACOSX) + if (ret != 0 && access == OS::MemoryPermission::kNoAccess) { + ret = madvise(address, size, MADV_FREE_REUSABLE); + return ret == 0; + } +#endif + if (ret == 0 && access == OS::MemoryPermission::kNoAccess) { // This is advisory; ignore errors and continue execution. USE(DiscardSystemPages(address, size)); diff --git a/deps/v8/src/heap/remembered-set-inl.h~HEAD b/deps/v8/src/heap/remembered-set-inl.h~HEAD new file mode 100644 index 00000000000000..3790ed9e7123b9 --- /dev/null +++ b/deps/v8/src/heap/remembered-set-inl.h~HEAD @@ -0,0 +1,57 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_HEAP_REMEMBERED_SET_INL_H_ +#define V8_HEAP_REMEMBERED_SET_INL_H_ + +#include "src/common/ptr-compr-inl.h" +#include "src/heap/remembered-set.h" + +namespace v8 { +namespace internal { + +template +SlotCallbackResult UpdateTypedSlotHelper::UpdateTypedSlot(Heap* heap, + SlotType slot_type, + Address addr, + Callback callback) { + switch (slot_type) { + case CODE_TARGET_SLOT: { + RelocInfo rinfo(addr, RelocInfo::CODE_TARGET, 0, Code()); + return UpdateCodeTarget(&rinfo, callback); + } + case CODE_ENTRY_SLOT: { + return UpdateCodeEntry(addr, callback); + } + case COMPRESSED_EMBEDDED_OBJECT_SLOT: { + RelocInfo rinfo(addr, RelocInfo::COMPRESSED_EMBEDDED_OBJECT, 0, Code()); + return UpdateEmbeddedPointer(heap, &rinfo, callback); + } + case FULL_EMBEDDED_OBJECT_SLOT: { + RelocInfo rinfo(addr, RelocInfo::FULL_EMBEDDED_OBJECT, 0, Code()); + return UpdateEmbeddedPointer(heap, &rinfo, callback); + } + case COMPRESSED_OBJECT_SLOT: { + HeapObject old_target = HeapObject::cast(Object( + DecompressTaggedAny(heap->isolate(), base::Memory(addr)))); + HeapObject new_target = old_target; + SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target)); + DCHECK(!HasWeakHeapObjectTag(new_target)); + if (new_target != old_target) { + base::Memory(addr) = CompressTagged(new_target.ptr()); + } + return result; + } + case FULL_OBJECT_SLOT: { + return callback(FullMaybeObjectSlot(addr)); + } + case CLEARED_SLOT: + break; + } + UNREACHABLE(); +} + +} // namespace internal +} // namespace v8 +#endif // V8_HEAP_REMEMBERED_SET_INL_H_