Commit 38fbddbf authored by Ross Mcilroy's avatar Ross Mcilroy Committed by Commit Bot

[cleanup] Disable deprecation warnings on calls to Mark/IsIndependent.

Mark/IsIndependent is marked V8_DEPRECATE_SOON, but is still needed in some
places. In order to allow us to warn on V8_DEPRECATE_SOON within V8, explicity
disable deprecation warnings on these calls temporarily.

BUG=v8:7754

Change-Id: I0a7f3aedc04412c120217ba83d2cf91aafff568d
Reviewed-on: https://chromium-review.googlesource.com/1147751
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54670}
parent 1ae4d38c
......@@ -191,12 +191,6 @@ class GlobalHandles::Node {
set_state(PENDING);
}
// Independent flag accessors.
void MarkIndependent() {
DCHECK(IsInUse());
set_independent(true);
}
// Callback parameter accessors.
void set_parameter(void* parameter) {
DCHECK(IsInUse());
......@@ -600,14 +594,6 @@ void GlobalHandles::AnnotateStrongRetainer(Object** location,
Node::FromLocation(location)->AnnotateStrongRetainer(label);
}
void GlobalHandles::MarkIndependent(Object** location) {
Node::FromLocation(location)->MarkIndependent();
}
bool GlobalHandles::IsIndependent(Object** location) {
return Node::FromLocation(location)->is_independent();
}
bool GlobalHandles::IsNearDeath(Object** location) {
return Node::FromLocation(location)->IsNearDeath();
}
......
......@@ -99,11 +99,6 @@ class GlobalHandles {
// Clear the weakness of a global handle.
static void* ClearWeakness(Object** location);
// Mark the reference to this object independent.
static void MarkIndependent(Object** location);
static bool IsIndependent(Object** location);
// Tells whether global handle is near death.
static bool IsNearDeath(Object** location);
......
......@@ -99,7 +99,16 @@ void SamplingHeapProfiler::SampleObject(Address soon_object, size_t size) {
Sample* sample = new Sample(size, node, loc, this);
samples_.emplace(sample);
sample->global.SetWeak(sample, OnWeakCallback, WeakCallbackType::kParameter);
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
// MarkIndependent is marked deprecated but we still rely on it here
// temporarily.
sample->global.MarkIndependent();
#if __clang__
#pragma clang diagnostic pop
#endif
}
void SamplingHeapProfiler::OnWeakCallback(
......
......@@ -7845,10 +7845,18 @@ static void IndependentWeakHandle(bool global_gc, bool interlinked) {
v8::WeakCallbackType::kParameter);
object_b.handle.SetWeak(&object_b, &SetFlag,
v8::WeakCallbackType::kParameter);
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
// MarkIndependent is marked deprecated but we still rely on it temporarily.
CHECK(!object_b.handle.IsIndependent());
object_a.handle.MarkIndependent();
object_b.handle.MarkIndependent();
CHECK(object_b.handle.IsIndependent());
#if __clang__
#pragma clang diagnostic pop
#endif
if (global_gc) {
CcTest::CollectAllGarbage();
} else {
......@@ -8000,9 +8008,17 @@ void v8::internal::heap::HeapTester::ResetWeakHandle(bool global_gc) {
object_b.handle.SetWeak(&object_b, &ResetUseValueAndSetFlag,
v8::WeakCallbackType::kParameter);
if (!global_gc) {
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
// MarkIndependent is marked deprecated but we still rely on it temporarily.
object_a.handle.MarkIndependent();
object_b.handle.MarkIndependent();
CHECK(object_b.handle.IsIndependent());
#if __clang__
#pragma clang diagnostic pop
#endif
}
if (global_gc) {
CcTest::CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
......@@ -8071,7 +8087,16 @@ THREADED_TEST(GCFromWeakCallbacks) {
object.flag = false;
object.handle.SetWeak(&object, gc_forcing_callback[inner_gc],
v8::WeakCallbackType::kParameter);
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
// MarkIndependent is marked deprecated but we still rely on it
// temporarily.
object.handle.MarkIndependent();
#if __clang__
#pragma clang diagnostic pop
#endif
invoke_gc[outer_gc]();
EmptyMessageQueues(isolate);
CHECK(object.flag);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment