Commit 83a5e42b authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[cleanup] Remove remaining redundant NOLINTs

After a series of CLs per component, this removes all remaining NOLINT
annotations that my script identified as not needed (because removing
them does not cause a presubmit error).

R=mlippautz@chromium.org, jkummerow@chromium.org, leszeks@chromium.org
R=cbruni@chromium.org

Bug: v8:11879
Change-Id: Ia403c23588a0c2871b987931f6c26f85821e9e9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2972733Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75296}
parent 3f24baf6
......@@ -344,7 +344,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Label invoke, handler_entry, exit;
Label not_outermost_js, not_outermost_js_2;
{ // NOLINT. Scope block confuses linter.
{
NoRootArrayScope uninitialized_root_register(masm);
// Set up frame.
......
......@@ -338,7 +338,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Label invoke, handler_entry, exit;
Label not_outermost_js, not_outermost_js_2;
{ // NOLINT. Scope block confuses linter.
{
NoRootArrayScope uninitialized_root_register(masm);
// Set up frame.
__ pushq(rbp);
......
......@@ -124,7 +124,7 @@ class PerThreadAssertScopeDebugOnly
#else
class V8_NODISCARD PerThreadAssertScopeDebugOnly {
public:
PerThreadAssertScopeDebugOnly() { // NOLINT (modernize-use-equals-default)
PerThreadAssertScopeDebugOnly() {
// Define a constructor to avoid unused variable warnings.
}
void Release() {}
......
......@@ -385,7 +385,7 @@ constexpr uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
using uc16 = uint16_t;
using uc32 = uint32_t;
constexpr int kOneByteSize = kCharSize;
constexpr int kUC16Size = sizeof(uc16); // NOLINT
constexpr int kUC16Size = sizeof(uc16);
// 128 bit SIMD value size.
constexpr int kSimd128Size = 16;
......
......@@ -343,7 +343,7 @@ static Local<Value> GetStdout(Isolate* isolate, int child_fd,
// Get exit status of child.
static bool WaitForChild(Isolate* isolate, int pid,
ZombieProtector& child_waiter, // NOLINT
ZombieProtector& child_waiter,
const struct timeval& start_time, int read_timeout,
int total_timeout) {
#ifdef HAS_WAITID
......
......@@ -79,9 +79,9 @@
#endif
#if !defined(_WIN32) && !defined(_WIN64)
#include <unistd.h> // NOLINT
#include <unistd.h>
#else
#include <windows.h> // NOLINT
#include <windows.h>
#endif // !defined(_WIN32) && !defined(_WIN64)
#ifndef DCHECK
......
......@@ -341,7 +341,7 @@ class ShellOptions {
DisallowReassignment(const char* name, T value)
: name_(name), value_(value) {}
operator T() const { return value_; } // NOLINT
operator T() const { return value_; }
T get() const { return value_; }
DisallowReassignment& operator=(T value) {
if (check_d8_flag_contradictions) {
......
......@@ -429,7 +429,7 @@ static const char* Type2String(Flag::FlagType type) {
UNREACHABLE();
}
std::ostream& operator<<(std::ostream& os, const Flag& flag) { // NOLINT
std::ostream& operator<<(std::ostream& os, const Flag& flag) {
switch (flag.type()) {
case Flag::TYPE_BOOL:
os << (flag.bool_variable() ? "true" : "false");
......
......@@ -14,7 +14,7 @@ namespace internal {
// Declare all of our flags.
#define FLAG_MODE_DECLARE
#include "src/flags/flag-definitions.h" // NOLINT
#include "src/flags/flag-definitions.h"
// The global list of all flags.
class V8_EXPORT_PRIVATE FlagList {
......
......@@ -128,7 +128,6 @@ class Handle final : public HandleBase {
// Ex. Handle<JSFunction> can be passed when Handle<Object> is expected.
template <typename S, typename = typename std::enable_if<
std::is_convertible<S*, T*>::value>::type>
// NOLINTNEXTLINE
V8_INLINE Handle(Handle<S> handle) : HandleBase(handle) {}
V8_INLINE ObjectRef operator->() const { return ObjectRef{**this}; }
......
......@@ -2972,7 +2972,6 @@ STATIC_ASSERT(IsAligned(ByteArray::kHeaderSize, kDoubleAlignment));
#endif
#ifdef V8_HOST_ARCH_32_BIT
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((HeapNumber::kValueOffset & kDoubleAlignmentMask) == kTaggedSize);
#endif
......
......@@ -1205,7 +1205,7 @@ static void AddToWeakNativeContextList(Isolate* isolate, Context context) {
DCHECK(context.IsNativeContext());
Heap* heap = isolate->heap();
#ifdef DEBUG
{ // NOLINT
{
DCHECK(context.next_context_link().IsUndefined(isolate));
// Check that context is not in the list yet.
for (Object current = heap->native_contexts_list();
......@@ -4062,7 +4062,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtin::kHandleApiCallAsConstructor, 0, false);
native_context()->set_call_as_constructor_delegate(*delegate);
}
} // NOLINT(readability/fn_size)
}
Handle<JSFunction> Genesis::InstallTypedArray(const char* name,
ElementsKind elements_kind,
......
......@@ -156,7 +156,7 @@ class V8_EXPORT_PRIVATE SwitchBuilder final
case_sites_(builder->zone()) {
case_sites_.resize(number_of_cases);
}
~SwitchBuilder() override; // NOLINT (modernize-use-equals-default)
~SwitchBuilder() override;
// This method should be called by the SwitchBuilder owner when the case
// statement with |index| is emitted to update the case jump site.
......
......@@ -13,7 +13,7 @@
#include <atomic>
#if !V8_OS_QNX && !V8_OS_AIX
#include <sys/syscall.h> // NOLINT
#include <sys/syscall.h>
#endif
#if V8_OS_MACOSX
......
......@@ -1198,10 +1198,10 @@ void Logger::DeleteEvent(const char* name, void* object) {
namespace {
void AppendCodeCreateHeader(
Log::MessageBuilder& msg, // NOLINT(runtime/references)
CodeEventListener::LogEventsAndTags tag, CodeKind kind, uint8_t* address,
int size, uint64_t time) {
void AppendCodeCreateHeader(Log::MessageBuilder& msg,
CodeEventListener::LogEventsAndTags tag,
CodeKind kind, uint8_t* address, int size,
uint64_t time) {
msg << kLogEventsNames[CodeEventListener::CODE_CREATION_EVENT]
<< Logger::kNext << kLogEventsNames[tag] << Logger::kNext
<< static_cast<int>(kind) << Logger::kNext << time << Logger::kNext
......@@ -1209,9 +1209,9 @@ void AppendCodeCreateHeader(
<< Logger::kNext;
}
void AppendCodeCreateHeader(
Log::MessageBuilder& msg, // NOLINT(runtime/references)
CodeEventListener::LogEventsAndTags tag, AbstractCode code, uint64_t time) {
void AppendCodeCreateHeader(Log::MessageBuilder& msg,
CodeEventListener::LogEventsAndTags tag,
AbstractCode code, uint64_t time) {
AppendCodeCreateHeader(msg, tag, code.kind(),
reinterpret_cast<uint8_t*>(code.InstructionStart()),
code.InstructionSize(), time);
......@@ -1522,9 +1522,8 @@ void Logger::CodeDependencyChangeEvent(Handle<Code> code,
namespace {
void CodeLinePosEvent(
JitLogger& jit_logger, Address code_start,
SourcePositionTableIterator& iter) { // NOLINT(runtime/references)
void CodeLinePosEvent(JitLogger& jit_logger, Address code_start,
SourcePositionTableIterator& iter) {
void* jit_handler_data = jit_logger.StartCodePosInfoEvent();
for (; !iter.done(); iter.Advance()) {
if (iter.is_statement()) {
......@@ -1597,10 +1596,9 @@ void Logger::SuspectReadEvent(Name name, Object obj) {
}
namespace {
void AppendFunctionMessage(
Log::MessageBuilder& msg, // NOLINT(runtime/references)
const char* reason, int script_id, double time_delta, int start_position,
int end_position, uint64_t time) {
void AppendFunctionMessage(Log::MessageBuilder& msg, const char* reason,
int script_id, double time_delta, int start_position,
int end_position, uint64_t time) {
msg << "function" << Logger::kNext << reason << Logger::kNext << script_id
<< Logger::kNext << start_position << Logger::kNext << end_position
<< Logger::kNext;
......
......@@ -2490,7 +2490,7 @@ void HeapSnapshotJSONSerializer::SerializeEdge(HeapGraphEdge* edge,
bool first_edge) {
// The buffer needs space for 3 unsigned ints, 3 commas, \n and \0
static const int kBufferSize =
MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned * 3 + 3 + 2; // NOLINT
MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned * 3 + 3 + 2;
base::EmbeddedVector<char, kBufferSize> buffer;
int edge_name_or_index = edge->type() == HeapGraphEdge::kElement
|| edge->type() == HeapGraphEdge::kHidden
......@@ -2523,9 +2523,9 @@ void HeapSnapshotJSONSerializer::SerializeNode(const HeapEntry* entry) {
// The buffer needs space for 5 unsigned ints, 1 size_t, 1 uint8_t, 7 commas,
// \n and \0
static const int kBufferSize =
5 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned // NOLINT
+ MaxDecimalDigitsIn<sizeof(size_t)>::kUnsigned // NOLINT
+ MaxDecimalDigitsIn<sizeof(uint8_t)>::kUnsigned + 7 + 1 + 1;
5 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned +
MaxDecimalDigitsIn<sizeof(size_t)>::kUnsigned +
MaxDecimalDigitsIn<sizeof(uint8_t)>::kUnsigned + 7 + 1 + 1;
base::EmbeddedVector<char, kBufferSize> buffer;
int buffer_pos = 0;
if (to_node_index(entry) != 0) {
......@@ -2672,8 +2672,7 @@ void HeapSnapshotJSONSerializer::SerializeTraceTree() {
void HeapSnapshotJSONSerializer::SerializeTraceNode(AllocationTraceNode* node) {
// The buffer needs space for 4 unsigned ints, 4 commas, [ and \0
const int kBufferSize =
4 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned // NOLINT
+ 4 + 1 + 1;
4 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned + 4 + 1 + 1;
base::EmbeddedVector<char, kBufferSize> buffer;
int buffer_pos = 0;
buffer_pos = utoa(node->id(), buffer, buffer_pos);
......@@ -2716,8 +2715,7 @@ void HeapSnapshotJSONSerializer::SerializeTraceNodeInfos() {
if (!tracker) return;
// The buffer needs space for 6 unsigned ints, 6 commas, \n and \0
const int kBufferSize =
6 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned // NOLINT
+ 6 + 1 + 1;
6 * MaxDecimalDigitsIn<sizeof(unsigned)>::kUnsigned + 6 + 1 + 1;
base::EmbeddedVector<char, kBufferSize> buffer;
int i = 0;
for (AllocationTracker::FunctionInfo* info : tracker->function_info_list()) {
......
......@@ -32,8 +32,7 @@ V8_INLINE constexpr bool operator<(RootIndex lhs, RootIndex rhs) {
return static_cast<type>(lhs) < static_cast<type>(rhs);
}
V8_INLINE RootIndex
operator++(RootIndex& index) { // NOLINT(runtime/references)
V8_INLINE RootIndex operator++(RootIndex& index) {
using type = typename std::underlying_type<RootIndex>::type;
index = static_cast<RootIndex>(static_cast<type>(index) + 1);
return index;
......
......@@ -136,10 +136,10 @@ Handle<Name> KeyToName<NumberDictionary>(Isolate* isolate, Handle<Object> key) {
// method's shared function info indicates that method does not have a
// shared name.
template <typename Dictionary>
MaybeHandle<Object> GetMethodAndSetName(
Isolate* isolate,
RuntimeArguments& args, // NOLINT(runtime/references)
Smi index, Handle<String> name_prefix, Handle<Object> key) {
MaybeHandle<Object> GetMethodAndSetName(Isolate* isolate,
RuntimeArguments& args, Smi index,
Handle<String> name_prefix,
Handle<Object> key) {
int int_index = index.value();
// Class constructor and prototype values do not require post processing.
......@@ -168,10 +168,8 @@ MaybeHandle<Object> GetMethodAndSetName(
// This is a simplified version of GetMethodAndSetName()
// function above that is used when it's guaranteed that the method has
// shared name.
Object GetMethodWithSharedName(
Isolate* isolate,
RuntimeArguments& args, // NOLINT(runtime/references)
Object index) {
Object GetMethodWithSharedName(Isolate* isolate, RuntimeArguments& args,
Object index) {
DisallowGarbageCollection no_gc;
int int_index = Smi::ToInt(index);
......@@ -204,7 +202,7 @@ Handle<Dictionary> ShallowCopyDictionaryTemplate(
template <typename Dictionary>
bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary,
RuntimeArguments& args, // NOLINT(runtime/references)
RuntimeArguments& args,
bool* install_name_accessor = nullptr) {
Handle<Name> name_string = isolate->factory()->name_string();
......@@ -282,8 +280,7 @@ bool AddDescriptorsByTemplate(
Isolate* isolate, Handle<Map> map,
Handle<DescriptorArray> descriptors_template,
Handle<NumberDictionary> elements_dictionary_template,
Handle<JSObject> receiver,
RuntimeArguments& args) { // NOLINT(runtime/references)
Handle<JSObject> receiver, RuntimeArguments& args) {
int nof_descriptors = descriptors_template->number_of_descriptors();
Handle<DescriptorArray> descriptors =
......@@ -403,8 +400,7 @@ bool AddDescriptorsByTemplate(
Handle<Dictionary> properties_dictionary_template,
Handle<NumberDictionary> elements_dictionary_template,
Handle<FixedArray> computed_properties, Handle<JSObject> receiver,
bool install_name_accessor,
RuntimeArguments& args) { // NOLINT(runtime/references)
bool install_name_accessor, RuntimeArguments& args) {
int computed_properties_length = computed_properties->length();
// Shallow-copy properties template.
......@@ -492,7 +488,7 @@ bool InitClassPrototype(Isolate* isolate,
Handle<JSObject> prototype,
Handle<HeapObject> prototype_parent,
Handle<JSFunction> constructor,
RuntimeArguments& args) { // NOLINT(runtime/references)
RuntimeArguments& args) {
Handle<Map> map(prototype->map(), isolate);
map = Map::CopyDropDescriptors(isolate, map);
map->set_is_prototype_map(true);
......@@ -545,10 +541,11 @@ bool InitClassPrototype(Isolate* isolate,
}
}
bool InitClassConstructor(
Isolate* isolate, Handle<ClassBoilerplate> class_boilerplate,
Handle<HeapObject> constructor_parent, Handle<JSFunction> constructor,
RuntimeArguments& args) { // NOLINT(runtime/references)
bool InitClassConstructor(Isolate* isolate,
Handle<ClassBoilerplate> class_boilerplate,
Handle<HeapObject> constructor_parent,
Handle<JSFunction> constructor,
RuntimeArguments& args) {
Handle<Map> map(constructor->map(), isolate);
map = Map::CopyDropDescriptors(isolate, map);
DCHECK(map->is_prototype_map());
......@@ -607,10 +604,11 @@ bool InitClassConstructor(
}
}
MaybeHandle<Object> DefineClass(
Isolate* isolate, Handle<ClassBoilerplate> class_boilerplate,
Handle<Object> super_class, Handle<JSFunction> constructor,
RuntimeArguments& args) { // NOLINT(runtime/references)
MaybeHandle<Object> DefineClass(Isolate* isolate,
Handle<ClassBoilerplate> class_boilerplate,
Handle<Object> super_class,
Handle<JSFunction> constructor,
RuntimeArguments& args) {
Handle<Object> prototype_parent;
Handle<HeapObject> constructor_parent;
......
......@@ -26,9 +26,7 @@ namespace internal {
namespace {
void AdvanceToOffsetForTracing(
interpreter::BytecodeArrayIterator&
bytecode_iterator, // NOLINT(runtime/references)
int offset) {
interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) {
while (bytecode_iterator.current_offset() +
bytecode_iterator.current_bytecode_size() <=
offset) {
......@@ -41,8 +39,7 @@ void AdvanceToOffsetForTracing(
}
void PrintRegisters(UnoptimizedFrame* frame, std::ostream& os, bool is_input,
interpreter::BytecodeArrayIterator&
bytecode_iterator, // NOLINT(runtime/references)
interpreter::BytecodeArrayIterator& bytecode_iterator,
Handle<Object> accumulator) {
static const char kAccumulator[] = "accumulator";
static const int kRegFieldWidth = static_cast<int>(sizeof(kAccumulator) - 1);
......
......@@ -414,7 +414,6 @@ class Serializer::ObjectSerializer : public ObjectVisitor {
serializer_->PushStack(obj);
#endif // DEBUG
}
// NOLINTNEXTLINE (modernize-use-equals-default)
~ObjectSerializer() override {
#ifdef DEBUG
serializer_->PopStack();
......
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