Commit df2dbecd authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

cppgc: Fix -Wshadow warning in cppgc and related unittests

Bug: v8:12244,v8:12245
Change-Id: Ic2d324fa5a3bde18b4fdbe7d64e44c7fc9ccd4ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3181534Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77042}
parent b101e0bb
......@@ -120,14 +120,14 @@ class HeapObjectHeader {
static constexpr size_t DecodeSize(uint16_t encoded) {
// Essentially, gets optimized to << 1.
using SizeField = MarkBitField::Next<size_t, 15>;
return SizeField::decode(encoded) * kAllocationGranularity;
using SizeFieldImpl = MarkBitField::Next<size_t, 15>;
return SizeFieldImpl::decode(encoded) * kAllocationGranularity;
}
static constexpr uint16_t EncodeSize(size_t size) {
// Essentially, gets optimized to >> 1.
using SizeField = MarkBitField::Next<size_t, 15>;
return SizeField::encode(size / kAllocationGranularity);
using SizeFieldImpl = MarkBitField::Next<size_t, 15>;
return SizeFieldImpl::encode(size / kAllocationGranularity);
}
V8_EXPORT_PRIVATE void CheckApiConstants();
......
......@@ -214,7 +214,7 @@ void MarkerBase::StartMarking() {
is_marking_ = true;
if (EnterIncrementalMarkingIfNeeded(config_, heap())) {
StatsCollector::EnabledScope stats_scope(
StatsCollector::EnabledScope inner_stats_scope(
heap().stats_collector(), StatsCollector::kMarkIncrementalStart);
// Performing incremental or concurrent marking.
......@@ -510,7 +510,7 @@ bool MarkerBase::ProcessWorklistsWithDeadline(
}
{
StatsCollector::EnabledScope stats_scope(
StatsCollector::EnabledScope inner_stats_scope(
heap().stats_collector(), StatsCollector::kMarkProcessEphemerons);
if (!DrainWorklistWithBytesAndTimeDeadline(
mutator_marking_state_, marked_bytes_deadline, time_deadline,
......
......@@ -817,7 +817,7 @@ class Sweeper::SweeperImpl final {
MutatorThreadSweeper sweeper(&space_states_, platform_,
config_.free_memory_handling);
{
StatsCollector::EnabledScope stats_scope(
StatsCollector::EnabledScope inner_stats_scope(
stats_collector_, internal_scope_id, "deltaInSeconds",
deadline_in_seconds - platform_->MonotonicallyIncreasingTime());
......
......@@ -147,7 +147,7 @@ class Unreferenced : public cppgc::GarbageCollected<Unreferenced> {
} // namespace
TEST_F(UnifiedHeapTest, FreeUnreferencedDuringNoGcScope) {
v8::HandleScope scope(v8_isolate());
v8::HandleScope handle_scope(v8_isolate());
v8::Local<v8::Context> context = v8::Context::New(v8_isolate());
v8::Context::Scope context_scope(context);
auto* unreferenced = cppgc::MakeGarbageCollected<Unreferenced>(
......@@ -156,7 +156,7 @@ TEST_F(UnifiedHeapTest, FreeUnreferencedDuringNoGcScope) {
// Force safepoint to force flushing of cached allocated/freed sizes in cppgc.
cpp_heap().stats_collector()->NotifySafePointForTesting();
{
cppgc::subtle::NoGarbageCollectionScope scope(cpp_heap());
cppgc::subtle::NoGarbageCollectionScope no_gc_scope(cpp_heap());
cppgc::internal::FreeUnreferencedObject(cpp_heap(), unreferenced);
// Force safepoint to make sure allocated size decrease due to freeing
// unreferenced object is reported to CppHeap. Due to
......@@ -177,12 +177,12 @@ TEST_F(UnifiedHeapTest, FreeUnreferencedDuringNoGcScope) {
#if !V8_OS_FUCHSIA
TEST_F(UnifiedHeapTest, TracedReferenceRetainsFromStack) {
v8::HandleScope scope(v8_isolate());
v8::HandleScope handle_scope(v8_isolate());
v8::Local<v8::Context> context = v8::Context::New(v8_isolate());
v8::Context::Scope context_scope(context);
TracedReference<v8::Object> holder;
{
v8::HandleScope scope(v8_isolate());
v8::HandleScope inner_handle_scope(v8_isolate());
auto local = v8::Object::New(v8_isolate());
EXPECT_TRUE(local->IsObject());
holder.Reset(v8_isolate(), local);
......
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