Skip to content

Commit 2ea9de2

Browse files
committed
deps: V8: cherry-pick f4b860d
Original commit message: [heap,api] Remove deprecated APIs Bug: chromium:923361, v8:8834 Change-Id: I6ec42aeb74bea5c0629fcdc3f95c125f5de534a0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526195 Commit-Queue: Michael Lippautz <[email protected]> Auto-Submit: Michael Lippautz <[email protected]> Reviewed-by: Ulan Degenbaev <[email protected]> Cr-Commit-Position: refs/heads/master@{#60289} Refs: v8/v8@f4b860d PR-URL: #27013 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 98b5ba8 commit 2ea9de2

File tree

8 files changed

+1
-107
lines changed

8 files changed

+1
-107
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.13',
40+
'v8_embedder_string': '-node.14',
4141

4242
##### V8 defaults for Node.js #####
4343

deps/v8/include/v8-internal.h

-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ class Internals {
164164
static const int kNodeStateMask = 0x7;
165165
static const int kNodeStateIsWeakValue = 2;
166166
static const int kNodeStateIsPendingValue = 3;
167-
static const int kNodeStateIsNearDeathValue = 4;
168167
static const int kNodeIsIndependentShift = 3;
169168
static const int kNodeIsActiveShift = 4;
170169

deps/v8/include/v8.h

-26
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,6 @@ template <class T> class PersistentBase {
576576

577577
V8_DEPRECATED("See MarkIndependent.", V8_INLINE bool IsIndependent() const);
578578

579-
/** Checks if the handle holds the only reference to an object. */
580-
V8_DEPRECATED("Garbage collection internal state should not be relied on.",
581-
V8_INLINE bool IsNearDeath() const);
582-
583579
/** Returns true if the handle's reference is weak. */
584580
V8_INLINE bool IsWeak() const;
585581

@@ -8519,17 +8515,6 @@ class V8_EXPORT Isolate {
85198515
*/
85208516
void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor);
85218517

8522-
/**
8523-
* Iterates through all the persistent handles in the current isolate's heap
8524-
* that have class_ids and are candidates to be marked as partially dependent
8525-
* handles. This will visit handles to young objects created since the last
8526-
* garbage collection but is free to visit an arbitrary superset of these
8527-
* objects.
8528-
*/
8529-
V8_DEPRECATED(
8530-
"Use VisitHandlesWithClassIds",
8531-
void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor));
8532-
85338518
/**
85348519
* Iterates through all the persistent handles in the current isolate's heap
85358520
* that have class_ids and are weak to be marked as inactive if there is no
@@ -9783,17 +9768,6 @@ bool PersistentBase<T>::IsIndependent() const {
97839768
I::kNodeIsIndependentShift);
97849769
}
97859770

9786-
template <class T>
9787-
bool PersistentBase<T>::IsNearDeath() const {
9788-
typedef internal::Internals I;
9789-
if (this->IsEmpty()) return false;
9790-
uint8_t node_state =
9791-
I::GetNodeState(reinterpret_cast<internal::Address*>(this->val_));
9792-
return node_state == I::kNodeStateIsNearDeathValue ||
9793-
node_state == I::kNodeStateIsPendingValue;
9794-
}
9795-
9796-
97979771
template <class T>
97989772
bool PersistentBase<T>::IsWeak() const {
97999773
typedef internal::Internals I;

deps/v8/src/api.cc

-9
Original file line numberDiff line numberDiff line change
@@ -8876,15 +8876,6 @@ void Isolate::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) {
88768876
isolate->global_handles()->IterateAllRootsWithClassIds(visitor);
88778877
}
88788878

8879-
8880-
void Isolate::VisitHandlesForPartialDependence(
8881-
PersistentHandleVisitor* visitor) {
8882-
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8883-
i::DisallowHeapAllocation no_allocation;
8884-
isolate->global_handles()->IterateAllYoungRootsWithClassIds(visitor);
8885-
}
8886-
8887-
88888879
void Isolate::VisitWeakHandles(PersistentHandleVisitor* visitor) {
88898880
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
88908881
i::DisallowHeapAllocation no_allocation;

deps/v8/src/global-handles.cc

-10
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
379379
Internals::kNodeStateMask);
380380
STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue);
381381
STATIC_ASSERT(PENDING == Internals::kNodeStateIsPendingValue);
382-
STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue);
383382
STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) ==
384383
Internals::kNodeIsIndependentShift);
385384
STATIC_ASSERT(static_cast<int>(IsActive::kShift) ==
@@ -427,11 +426,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
427426
flags_ = NodeWeaknessType::update(flags_, weakness_type);
428427
}
429428

430-
bool IsNearDeath() const {
431-
// Check for PENDING to ensure correct answer when processing callbacks.
432-
return state() == PENDING || state() == NEAR_DEATH;
433-
}
434-
435429
bool IsWeak() const { return state() == WEAK; }
436430

437431
bool IsInUse() const { return state() != FREE; }
@@ -819,10 +813,6 @@ void GlobalHandles::AnnotateStrongRetainer(Address* location,
819813
Node::FromLocation(location)->AnnotateStrongRetainer(label);
820814
}
821815

822-
bool GlobalHandles::IsNearDeath(Address* location) {
823-
return Node::FromLocation(location)->IsNearDeath();
824-
}
825-
826816
bool GlobalHandles::IsWeak(Address* location) {
827817
return Node::FromLocation(location)->IsWeak();
828818
}

deps/v8/src/global-handles.h

-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ class GlobalHandles final {
7373
// Clear the weakness of a global handle.
7474
static void* ClearWeakness(Address* location);
7575

76-
// Tells whether global handle is near death.
77-
static bool IsNearDeath(Address* location);
78-
7976
// Tells whether global handle is weak.
8077
static bool IsWeak(Address* location);
8178

deps/v8/test/cctest/heap/test-heap.cc

-20
Original file line numberDiff line numberDiff line change
@@ -531,14 +531,9 @@ TEST(WeakGlobalHandlesScavenge) {
531531

532532
// Scavenge treats weak pointers as normal roots.
533533
CcTest::CollectGarbage(NEW_SPACE);
534-
535534
CHECK((*h1)->IsString());
536535
CHECK((*h2)->IsHeapNumber());
537-
538536
CHECK(!WeakPointerCleared);
539-
CHECK(!global_handles->IsNearDeath(h2.location()));
540-
CHECK(!global_handles->IsNearDeath(h1.location()));
541-
542537
GlobalHandles::Destroy(h1.location());
543538
GlobalHandles::Destroy(h2.location());
544539
}
@@ -576,11 +571,8 @@ TEST(WeakGlobalUnmodifiedApiHandlesScavenge) {
576571
&TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
577572

578573
CcTest::CollectGarbage(NEW_SPACE);
579-
580574
CHECK((*h1)->IsHeapNumber());
581575
CHECK(WeakPointerCleared);
582-
CHECK(!global_handles->IsNearDeath(h1.location()));
583-
584576
GlobalHandles::Destroy(h1.location());
585577
}
586578

@@ -617,10 +609,7 @@ TEST(WeakGlobalApiHandleModifiedMapScavenge) {
617609
&TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
618610

619611
CcTest::CollectGarbage(NEW_SPACE);
620-
621612
CHECK(!WeakPointerCleared);
622-
CHECK(!global_handles->IsNearDeath(h1.location()));
623-
624613
GlobalHandles::Destroy(h1.location());
625614
}
626615

@@ -661,10 +650,7 @@ TEST(WeakGlobalApiHandleWithElementsScavenge) {
661650
&TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
662651

663652
CcTest::CollectGarbage(NEW_SPACE);
664-
665653
CHECK(!WeakPointerCleared);
666-
CHECK(!global_handles->IsNearDeath(h1.location()));
667-
668654
GlobalHandles::Destroy(h1.location());
669655
}
670656

@@ -699,17 +685,11 @@ TEST(WeakGlobalHandlesMark) {
699685
GlobalHandles::MakeWeak(
700686
h2.location(), reinterpret_cast<void*>(&handle_and_id),
701687
&TestWeakGlobalHandleCallback, v8::WeakCallbackType::kParameter);
702-
CHECK(!GlobalHandles::IsNearDeath(h1.location()));
703-
CHECK(!GlobalHandles::IsNearDeath(h2.location()));
704688

705689
// Incremental marking potentially marked handles before they turned weak.
706690
CcTest::CollectAllGarbage();
707-
708691
CHECK((*h1)->IsString());
709-
710692
CHECK(WeakPointerCleared);
711-
CHECK(!GlobalHandles::IsNearDeath(h1.location()));
712-
713693
GlobalHandles::Destroy(h1.location());
714694
}
715695

deps/v8/test/cctest/test-api.cc

-37
Original file line numberDiff line numberDiff line change
@@ -20545,43 +20545,6 @@ TEST(WrapperClassId) {
2054520545
object.Reset();
2054620546
}
2054720547

20548-
20549-
TEST(PersistentHandleInNewSpaceVisitor) {
20550-
LocalContext context;
20551-
v8::Isolate* isolate = context->GetIsolate();
20552-
v8::HandleScope scope(isolate);
20553-
v8::Persistent<v8::Object> object1(isolate, v8::Object::New(isolate));
20554-
CHECK_EQ(0, object1.WrapperClassId());
20555-
object1.SetWrapperClassId(42);
20556-
CHECK_EQ(42, object1.WrapperClassId());
20557-
20558-
CcTest::CollectAllGarbage();
20559-
CcTest::CollectAllGarbage();
20560-
20561-
v8::Persistent<v8::Object> object2(isolate, v8::Object::New(isolate));
20562-
CHECK_EQ(0, object2.WrapperClassId());
20563-
object2.SetWrapperClassId(42);
20564-
CHECK_EQ(42, object2.WrapperClassId());
20565-
20566-
Visitor42 visitor(&object2);
20567-
#if __clang__
20568-
#pragma clang diagnostic push
20569-
#pragma clang diagnostic ignored "-Wdeprecated"
20570-
#endif
20571-
// VisitHandlesForPartialDependence is marked deprecated. This test will be
20572-
// removed with the API method.
20573-
isolate->VisitHandlesForPartialDependence(&visitor);
20574-
#if __clang__
20575-
#pragma clang diagnostic pop
20576-
#endif
20577-
20578-
CHECK_EQ(1, visitor.counter_);
20579-
20580-
object1.Reset();
20581-
object2.Reset();
20582-
}
20583-
20584-
2058520548
TEST(RegExp) {
2058620549
LocalContext context;
2058720550
v8::HandleScope scope(context->GetIsolate());

0 commit comments

Comments
 (0)