mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
deps: patch V8 to 9.5.172.25
Refs: https://github.com/v8/v8/compare/9.5.172.21...9.5.172.25 PR-URL: https://github.com/nodejs/node/pull/40604 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
8 files changed
+75
-12
No files matched your search
Vendored
+1
-1
@@ -11,7 +11,7 @@
|
||||
#define V8_MAJOR_VERSION 9
|
||||
#define V8_MINOR_VERSION 5
|
||||
#define V8_BUILD_NUMBER 172
|
||||
#define V8_PATCH_LEVEL 21
|
||||
#define V8_PATCH_LEVEL 25
|
||||
|
||||
// Use 1 for candidates and 0 otherwise.
|
||||
// (Boolean macro values are not supported by all preprocessors.)
|
||||
|
||||
@@ -343,8 +343,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
|
||||
remembered_set_action, save_fp_mode,
|
||||
StubCallMode::kCallWasmRuntimeStub);
|
||||
} else {
|
||||
#endif // V8_ENABLE_WEBASSEMBLY
|
||||
} else {
|
||||
__ CallRecordWriteStubSaveRegisters(object_, scratch1_,
|
||||
remembered_set_action, save_fp_mode);
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -50,7 +50,7 @@ bool Isolate::has_pending_message() {
|
||||
}
|
||||
|
||||
Object Isolate::pending_exception() {
|
||||
DCHECK(has_pending_exception());
|
||||
CHECK(has_pending_exception());
|
||||
DCHECK(!thread_local_top()->pending_exception_.IsException(this));
|
||||
return thread_local_top()->pending_exception_;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -243,6 +243,7 @@ void MarkerBase::EnterAtomicPause(MarkingConfig::StackState stack_state) {
|
||||
}
|
||||
config_.stack_state = stack_state;
|
||||
config_.marking_type = MarkingConfig::MarkingType::kAtomic;
|
||||
mutator_marking_state_.set_in_atomic_pause();
|
||||
|
||||
// Lock guards against changes to {Weak}CrossThreadPersistent handles, that
|
||||
// may conflict with marking. E.g., a WeakCrossThreadPersistent may be
|
||||
|
||||
+17
-6
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "include/cppgc/trace-trait.h"
|
||||
#include "include/cppgc/visitor.h"
|
||||
#include "src/base/logging.h"
|
||||
#include "src/heap/cppgc/compaction-worklists.h"
|
||||
#include "src/heap/cppgc/globals.h"
|
||||
#include "src/heap/cppgc/heap-object-header.h"
|
||||
@@ -123,6 +124,8 @@ class MarkingStateBase {
|
||||
discovered_new_ephemeron_pairs_ = false;
|
||||
}
|
||||
|
||||
void set_in_atomic_pause() { in_atomic_pause_ = true; }
|
||||
|
||||
protected:
|
||||
inline void MarkAndPush(HeapObjectHeader&, TraceDescriptor);
|
||||
|
||||
@@ -160,6 +163,7 @@ class MarkingStateBase {
|
||||
size_t marked_bytes_ = 0;
|
||||
bool in_ephemeron_processing_ = false;
|
||||
bool discovered_new_ephemeron_pairs_ = false;
|
||||
bool in_atomic_pause_ = false;
|
||||
};
|
||||
|
||||
MarkingStateBase::MarkingStateBase(HeapBase& heap,
|
||||
@@ -300,12 +304,19 @@ void MarkingStateBase::ProcessEphemeron(const void* key, const void* value,
|
||||
// would break the main marking loop.
|
||||
DCHECK(!in_ephemeron_processing_);
|
||||
in_ephemeron_processing_ = true;
|
||||
// Filter out already marked keys. The write barrier for WeakMember
|
||||
// ensures that any newly set value after this point is kept alive and does
|
||||
// not require the callback.
|
||||
if (!HeapObjectHeader::FromObject(key)
|
||||
.IsInConstruction<AccessMode::kAtomic>() &&
|
||||
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>()) {
|
||||
// Keys are considered live even in incremental/concurrent marking settings
|
||||
// because the write barrier for WeakMember ensures that any newly set value
|
||||
// after this point is kept alive and does not require the callback.
|
||||
const bool key_in_construction =
|
||||
HeapObjectHeader::FromObject(key).IsInConstruction<AccessMode::kAtomic>();
|
||||
const bool key_considered_as_live =
|
||||
key_in_construction
|
||||
? in_atomic_pause_
|
||||
: HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>();
|
||||
DCHECK_IMPLIES(
|
||||
key_in_construction && in_atomic_pause_,
|
||||
HeapObjectHeader::FromObject(key).IsMarked<AccessMode::kAtomic>());
|
||||
if (key_considered_as_live) {
|
||||
if (value_desc.base_object_payload) {
|
||||
MarkAndPush(value_desc.base_object_payload, value_desc);
|
||||
} else {
|
||||
|
||||
Vendored
+2
-2
@@ -846,8 +846,8 @@ void AccessorAssembler::HandleLoadICSmiHandlerLoadNamedCase(
|
||||
Comment("module export");
|
||||
TNode<UintPtrT> index =
|
||||
DecodeWord<LoadHandler::ExportsIndexBits>(handler_word);
|
||||
TNode<Module> module = LoadObjectField<Module>(
|
||||
CAST(p->receiver()), JSModuleNamespace::kModuleOffset);
|
||||
TNode<Module> module =
|
||||
LoadObjectField<Module>(CAST(holder), JSModuleNamespace::kModuleOffset);
|
||||
TNode<ObjectHashTable> exports =
|
||||
LoadObjectField<ObjectHashTable>(module, Module::kExportsOffset);
|
||||
TNode<Cell> cell = CAST(LoadFixedArrayElement(exports, index));
|
||||
|
||||
Vendored
+7
-1
@@ -989,7 +989,13 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
|
||||
// We found the accessor, so the entry must exist.
|
||||
DCHECK(entry.is_found());
|
||||
int index = ObjectHashTable::EntryToValueIndex(entry);
|
||||
return LoadHandler::LoadModuleExport(isolate(), index);
|
||||
Handle<Smi> smi_handler =
|
||||
LoadHandler::LoadModuleExport(isolate(), index);
|
||||
if (holder_is_lookup_start_object) {
|
||||
return smi_handler;
|
||||
}
|
||||
return LoadHandler::LoadFromPrototype(isolate(), map, holder,
|
||||
smi_handler);
|
||||
}
|
||||
|
||||
Handle<Object> accessors = lookup->GetAccessors();
|
||||
|
||||
@@ -242,5 +242,50 @@ TEST_F(EphemeronPairTest, EphemeronPairWithEmptyMixinValue) {
|
||||
FinishMarking();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
class KeyWithCallback final : public GarbageCollected<KeyWithCallback> {
|
||||
public:
|
||||
template <typename Callback>
|
||||
explicit KeyWithCallback(Callback callback) {
|
||||
callback(this);
|
||||
}
|
||||
void Trace(Visitor*) const {}
|
||||
};
|
||||
|
||||
class EphemeronHolderForKeyWithCallback final
|
||||
: public GarbageCollected<EphemeronHolderForKeyWithCallback> {
|
||||
public:
|
||||
EphemeronHolderForKeyWithCallback(KeyWithCallback* key, GCed* value)
|
||||
: ephemeron_pair_(key, value) {}
|
||||
void Trace(cppgc::Visitor* visitor) const { visitor->Trace(ephemeron_pair_); }
|
||||
|
||||
private:
|
||||
const EphemeronPair<KeyWithCallback, GCed> ephemeron_pair_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_F(EphemeronPairTest, EphemeronPairWithKeyInConstruction) {
|
||||
GCed* value = MakeGarbageCollected<GCed>(GetAllocationHandle());
|
||||
Persistent<EphemeronHolderForKeyWithCallback> holder;
|
||||
InitializeMarker(*Heap::From(GetHeap()), GetPlatformHandle().get());
|
||||
FinishSteps();
|
||||
MakeGarbageCollected<KeyWithCallback>(
|
||||
GetAllocationHandle(), [this, &holder, value](KeyWithCallback* thiz) {
|
||||
// The test doesn't use conservative stack scanning to retain key to
|
||||
// avoid retaining value as a side effect.
|
||||
EXPECT_TRUE(HeapObjectHeader::FromObject(thiz).TryMarkAtomic());
|
||||
holder = MakeGarbageCollected<EphemeronHolderForKeyWithCallback>(
|
||||
GetAllocationHandle(), thiz, value);
|
||||
// Finishing marking at this point will leave an ephemeron pair
|
||||
// reachable where the key is still in construction. The GC needs to
|
||||
// mark the value for such pairs as live in the atomic pause as they key
|
||||
// is considered live.
|
||||
FinishMarking();
|
||||
});
|
||||
EXPECT_TRUE(HeapObjectHeader::FromObject(value).IsMarked());
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace cppgc
|
||||
Reference in new issue
Block a user