Commit a9384810 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Remove NOLINT(runtime/references)

Mutable references are allowed by the style guide and the linter has
been adjusted.

Bug: v8:10624, chromium:1056170
Change-Id: I8a7dc06da5758f5c714a5e61d75378c2a13ffb9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2252192
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68455}
parent 65ae2a0f
......@@ -44,12 +44,10 @@ class V8_EXPORT MakeGarbageCollectedTraitInternal {
atomic_mutable_bitfield->store(value, std::memory_order_release);
}
static void* Allocate(
cppgc::AllocationHandle& handle, // NOLINT(runtime/references)
size_t size, GCInfoIndex index);
static void* Allocate(
cppgc::AllocationHandle& handle, // NOLINT(runtime/references)
size_t size, GCInfoIndex index, CustomSpaceIndex space_index);
static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
GCInfoIndex index);
static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
GCInfoIndex index, CustomSpaceIndex space_index);
friend class HeapObjectHeader;
};
......@@ -69,9 +67,7 @@ class MakeGarbageCollectedTraitBase
private:
template <typename U, typename CustomSpace>
struct SpacePolicy {
static void* Allocate(
AllocationHandle& handle, // NOLINT(runtime/references)
size_t size) {
static void* Allocate(AllocationHandle& handle, size_t size) {
// Custom space.
static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
"Custom space must inherit from CustomSpaceBase.");
......@@ -83,9 +79,7 @@ class MakeGarbageCollectedTraitBase
template <typename U>
struct SpacePolicy<U, void> {
static void* Allocate(
AllocationHandle& handle, // NOLINT(runtime/references)
size_t size) {
static void* Allocate(AllocationHandle& handle, size_t size) {
// Default space.
return internal::MakeGarbageCollectedTraitInternal::Allocate(
handle, size, internal::GCInfoTrait<T>::Index());
......@@ -101,8 +95,7 @@ class MakeGarbageCollectedTraitBase
* \param size The size that should be reserved for the object.
* \returns the memory to construct an object of type T on.
*/
static void* Allocate(AllocationHandle& handle, // NOLINT(runtime/references)
size_t size) {
static void* Allocate(AllocationHandle& handle, size_t size) {
return SpacePolicy<T, typename SpaceTrait<T>::Space>::Allocate(handle,
size);
}
......@@ -133,8 +126,7 @@ template <typename T>
class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
public:
template <typename... Args>
static T* Call(AllocationHandle& handle, // NOLINT(runtime/references)
Args&&... args) {
static T* Call(AllocationHandle& handle, Args&&... args) {
static_assert(internal::IsGarbageCollectedType<T>::value,
"T needs to be a garbage collected object");
static_assert(
......@@ -169,8 +161,7 @@ struct PostConstructionCallbackTrait {
* \returns an instance of type T.
*/
template <typename T, typename... Args>
T* MakeGarbageCollected(AllocationHandle& handle, // NOLINT(runtime/references)
Args&&... args) {
T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
T* object =
MakeGarbageCollectedTrait<T>::Call(handle, std::forward<Args>(args)...);
PostConstructionCallbackTrait<T>::Call(object);
......
......@@ -60,8 +60,7 @@ class CppgcPlatformAdapter final : public cppgc::Platform {
class UnifiedHeapMarker : public cppgc::internal::Marker {
public:
explicit UnifiedHeapMarker(
cppgc::internal::HeapBase& heap); // NOLINT(runtime/references)
explicit UnifiedHeapMarker(cppgc::internal::HeapBase& heap);
void AddObject(void*);
......
......@@ -44,7 +44,7 @@ class V8_EXPORT_PRIVATE HeapBase {
CPPGC_STACK_ALLOCATED();
public:
explicit NoGCScope(HeapBase& heap); // NOLINT(runtime/references)
explicit NoGCScope(HeapBase& heap);
~NoGCScope();
NoGCScope(const NoGCScope&) = delete;
......
......@@ -21,9 +21,8 @@ namespace internal {
namespace {
void EnterIncrementalMarkingIfNeeded(
Marker::MarkingConfig config,
HeapBase& heap) { // NOLINT(runtime/references)
void EnterIncrementalMarkingIfNeeded(Marker::MarkingConfig config,
HeapBase& heap) {
if (config.marking_type == Marker::MarkingConfig::MarkingType::kIncremental ||
config.marking_type ==
Marker::MarkingConfig::MarkingType::kIncrementalAndConcurrent) {
......@@ -34,9 +33,8 @@ void EnterIncrementalMarkingIfNeeded(
#endif
}
void ExitIncrementalMarkingIfNeeded(
Marker::MarkingConfig config,
HeapBase& heap) { // NOLINT(runtime/references)
void ExitIncrementalMarkingIfNeeded(Marker::MarkingConfig config,
HeapBase& heap) {
if (config.marking_type == Marker::MarkingConfig::MarkingType::kIncremental ||
config.marking_type ==
Marker::MarkingConfig::MarkingType::kIncrementalAndConcurrent) {
......@@ -48,8 +46,7 @@ void ExitIncrementalMarkingIfNeeded(
}
// Visit remembered set that was recorded in the generational barrier.
void VisitRememberedSlots(
HeapBase& heap, MarkingVisitor* visitor) { // NOLINT(runtime/references)
void VisitRememberedSlots(HeapBase& heap, MarkingVisitor* visitor) {
#if defined(CPPGC_YOUNG_GENERATION)
for (void* slot : heap.remembered_slots()) {
auto& slot_header = BasePage::FromInnerAddress(&heap, slot)
......@@ -68,7 +65,7 @@ void VisitRememberedSlots(
}
// Assumes that all spaces have their LABs reset.
void ResetRememberedSet(HeapBase& heap) { // NOLINT(runtime/references)
void ResetRememberedSet(HeapBase& heap) {
#if defined(CPPGC_YOUNG_GENERATION)
auto& local_data = heap.caged_heap().local_data();
local_data.age_table.Reset(&heap.caged_heap().allocator());
......
......@@ -73,7 +73,7 @@ class V8_EXPORT_PRIVATE Marker {
MarkingType marking_type = MarkingType::kAtomic;
};
explicit Marker(HeapBase& heap); // NOLINT(runtime/references)
explicit Marker(HeapBase& heap);
virtual ~Marker();
Marker(const Marker&) = delete;
......
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