Enable cpplint 'runtime/references' warning

Cpplint usually checks for non-const reference arguments. They are
forbidden in the style guide, and v8 does not explicitly make an
exception here.
This CL re-enables that warning, and fixes all current violations by
adding an explicit "NOLINT(runtime/references)" comment. In follow-up
CLs, we should aim to remove as many of them as possible.

TBR=mlippautz@chromium.org

Bug: v8:9429
Change-Id: If7054d0b366138b731972ed5d4e304b5ac8423bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687891
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62551}
This commit is contained in:
Clemens Hammacher 2019-07-08 10:42:48 +02:00 committed by Commit Bot
parent 46c3ea3154
commit 8e11cc395a
115 changed files with 769 additions and 490 deletions

View File

@ -3364,7 +3364,8 @@ class V8_EXPORT Object : public Value {
// //
// Returns true on success. // Returns true on success.
V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty( V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty(
Local<Context> context, Local<Name> key, PropertyDescriptor& descriptor); Local<Context> context, Local<Name> key,
PropertyDescriptor& descriptor); // NOLINT(runtime/references)
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
Local<Value> key); Local<Value> key);

View File

@ -154,7 +154,8 @@ class AsmJsParser {
template <typename T> template <typename T>
class CachedVector final : public ZoneVector<T> { class CachedVector final : public ZoneVector<T> {
public: public:
explicit CachedVector(CachedVectors<T>& cache) explicit CachedVector(
CachedVectors<T>& cache) // NOLINT(runtime/references)
: ZoneVector<T>(cache.zone()), cache_(&cache) { : ZoneVector<T>(cache.zone()), cache_(&cache) {
cache.fill(this); cache.fill(this);
} }

View File

@ -45,7 +45,7 @@ class ReversedAdapter {
// // iterates through v from back to front // // iterates through v from back to front
// } // }
template <typename T> template <typename T>
ReversedAdapter<T> Reversed(T& t) { ReversedAdapter<T> Reversed(T& t) { // NOLINT(runtime/references)
return ReversedAdapter<T>(t); return ReversedAdapter<T>(t);
} }

View File

@ -39,7 +39,8 @@ namespace internal {
namespace { namespace {
void ConsoleCall( void ConsoleCall(
Isolate* isolate, internal::BuiltinArguments& args, Isolate* isolate,
internal::BuiltinArguments& args, // NOLINT(runtime/references)
void (debug::ConsoleDelegate::*func)(const v8::debug::ConsoleCallArguments&, void (debug::ConsoleDelegate::*func)(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext&)) { const v8::debug::ConsoleContext&)) {
CHECK(!isolate->has_pending_exception()); CHECK(!isolate->has_pending_exception());

View File

@ -36,9 +36,10 @@ class ProxiesCodeStubAssembler : public CodeStubAssembler {
kProxyContextLength, kProxyContextLength,
}; };
Node* AllocateJSArrayForCodeStubArguments(Node* context, Node* AllocateJSArrayForCodeStubArguments(
CodeStubArguments& args, Node* argc, Node* context,
ParameterMode mode); CodeStubArguments& args, // NOLINT(runtime/references)
Node* argc, ParameterMode mode);
private: private:
Node* CreateProxyRevokeFunctionContext(Node* proxy, Node* native_context); Node* CreateProxyRevokeFunctionContext(Node* proxy, Node* native_context);

View File

@ -2135,9 +2135,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Int32T> TruncateHeapNumberValueToWord32(TNode<HeapNumber> object); TNode<Int32T> TruncateHeapNumberValueToWord32(TNode<HeapNumber> object);
// Conversions. // Conversions.
void TryHeapNumberToSmi(TNode<HeapNumber> number, TVariable<Smi>& output, void TryHeapNumberToSmi(TNode<HeapNumber> number,
TVariable<Smi>& output, // NOLINT(runtime/references)
Label* if_smi); Label* if_smi);
void TryFloat64ToSmi(TNode<Float64T> number, TVariable<Smi>& output, void TryFloat64ToSmi(TNode<Float64T> number,
TVariable<Smi>& output, // NOLINT(runtime/references)
Label* if_smi); Label* if_smi);
TNode<Number> ChangeFloat64ToTagged(SloppyTNode<Float64T> value); TNode<Number> ChangeFloat64ToTagged(SloppyTNode<Float64T> value);
TNode<Number> ChangeInt32ToTagged(SloppyTNode<Int32T> value); TNode<Number> ChangeInt32ToTagged(SloppyTNode<Int32T> value);

View File

@ -138,8 +138,9 @@ class ConstantPoolBuilder {
inline Label* EmittedPosition() { return &emitted_label_; } inline Label* EmittedPosition() { return &emitted_label_; }
private: private:
ConstantPoolEntry::Access AddEntry(ConstantPoolEntry& entry, ConstantPoolEntry::Access AddEntry(
ConstantPoolEntry::Type type); ConstantPoolEntry& entry, // NOLINT(runtime/references)
ConstantPoolEntry::Type type);
void EmitSharedEntries(Assembler* assm, ConstantPoolEntry::Type type); void EmitSharedEntries(Assembler* assm, ConstantPoolEntry::Type type);
void EmitGroup(Assembler* assm, ConstantPoolEntry::Access access, void EmitGroup(Assembler* assm, ConstantPoolEntry::Access access,
ConstantPoolEntry::Type type); ConstantPoolEntry::Type type);

View File

@ -1478,11 +1478,13 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
static bool IsAddImmediate(Instr instr); static bool IsAddImmediate(Instr instr);
static Instr SetAddImmediateOffset(Instr instr, int16_t offset); static Instr SetAddImmediateOffset(Instr instr, int16_t offset);
static uint32_t CreateTargetAddress(Instr instr_lui, Instr instr_jic); static uint32_t CreateTargetAddress(Instr instr_lui, Instr instr_jic);
static void UnpackTargetAddress(uint32_t address, int16_t& lui_offset, static void UnpackTargetAddress(
int16_t& jic_offset); uint32_t address, int16_t& lui_offset, // NOLINT(runtime/references)
static void UnpackTargetAddressUnsigned(uint32_t address, int16_t& jic_offset); // NOLINT(runtime/references)
uint32_t& lui_offset, static void UnpackTargetAddressUnsigned(
uint32_t& jic_offset); uint32_t address,
uint32_t& lui_offset, // NOLINT(runtime/references)
uint32_t& jic_offset); // NOLINT(runtime/references)
static bool IsAndImmediate(Instr instr); static bool IsAndImmediate(Instr instr);
static bool IsEmittedConstant(Instr instr); static bool IsEmittedConstant(Instr instr);
@ -1513,7 +1515,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
// Helper function for memory load/store using base register and offset. // Helper function for memory load/store using base register and offset.
void AdjustBaseAndOffset( void AdjustBaseAndOffset(
MemOperand& src, MemOperand& src, // NOLINT(runtime/references)
OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS, OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS,
int second_access_add_to_offset = 4); int second_access_add_to_offset = 4);

View File

@ -845,9 +845,12 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void BranchShortMSA(MSABranchDF df, Label* target, MSABranchCondition cond, void BranchShortMSA(MSABranchDF df, Label* target, MSABranchCondition cond,
MSARegister wt, BranchDelaySlot bd = PROTECT); MSARegister wt, BranchDelaySlot bd = PROTECT);
bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits); bool CalculateOffset(Label* L, int32_t& offset, // NOLINT(runtime/references)
bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits, OffsetSize bits);
Register& scratch, const Operand& rt); bool CalculateOffset(Label* L, int32_t& offset, // NOLINT(runtime/references)
OffsetSize bits,
Register& scratch, // NOLINT(runtime/references)
const Operand& rt);
void BranchShortHelperR6(int32_t offset, Label* L); void BranchShortHelperR6(int32_t offset, Label* L);
void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot); void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot);

View File

@ -1560,7 +1560,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
// Helper function for memory load/store using base register and offset. // Helper function for memory load/store using base register and offset.
void AdjustBaseAndOffset( void AdjustBaseAndOffset(
MemOperand& src, MemOperand& src, // NOLINT(runtime/references)
OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS, OffsetAccessType access_type = OffsetAccessType::SINGLE_ACCESS,
int second_access_add_to_offset = 4); int second_access_add_to_offset = 4);

View File

@ -849,9 +849,12 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void CallCFunctionHelper(Register function, int num_reg_arguments, void CallCFunctionHelper(Register function, int num_reg_arguments,
int num_double_arguments); int num_double_arguments);
bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits); bool CalculateOffset(Label* L, int32_t& offset, // NOLINT(runtime/references)
bool CalculateOffset(Label* L, int32_t& offset, OffsetSize bits, OffsetSize bits);
Register& scratch, const Operand& rt); bool CalculateOffset(Label* L, int32_t& offset, // NOLINT(runtime/references)
OffsetSize bits,
Register& scratch, // NOLINT(runtime/references)
const Operand& rt);
void BranchShortHelperR6(int32_t offset, Label* L); void BranchShortHelperR6(int32_t offset, Label* L);
void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot); void BranchShortHelper(int16_t offset, Label* L, BranchDelaySlot bdslot);

View File

@ -31,7 +31,7 @@ class MoreBit : public BitField8<bool, 7, 1> {};
class ValueBits : public BitField8<unsigned, 0, 7> {}; class ValueBits : public BitField8<unsigned, 0, 7> {};
// Helper: Add the offsets from 'other' to 'value'. Also set is_statement. // Helper: Add the offsets from 'other' to 'value'. Also set is_statement.
void AddAndSetEntry(PositionTableEntry& value, void AddAndSetEntry(PositionTableEntry& value, // NOLINT(runtime/references)
const PositionTableEntry& other) { const PositionTableEntry& other) {
value.code_offset += other.code_offset; value.code_offset += other.code_offset;
value.source_position += other.source_position; value.source_position += other.source_position;
@ -39,7 +39,7 @@ void AddAndSetEntry(PositionTableEntry& value,
} }
// Helper: Subtract the offsets from 'other' from 'value'. // Helper: Subtract the offsets from 'other' from 'value'.
void SubtractFromEntry(PositionTableEntry& value, void SubtractFromEntry(PositionTableEntry& value, // NOLINT(runtime/references)
const PositionTableEntry& other) { const PositionTableEntry& other) {
value.code_offset -= other.code_offset; value.code_offset -= other.code_offset;
value.source_position -= other.source_position; value.source_position -= other.source_position;
@ -47,7 +47,8 @@ void SubtractFromEntry(PositionTableEntry& value,
// Helper: Encode an integer. // Helper: Encode an integer.
template <typename T> template <typename T>
void EncodeInt(std::vector<byte>& bytes, T value) { void EncodeInt(std::vector<byte>& bytes, // NOLINT(runtime/references)
T value) {
using unsigned_type = typename std::make_unsigned<T>::type; using unsigned_type = typename std::make_unsigned<T>::type;
// Zig-zag encoding. // Zig-zag encoding.
static const int kShift = sizeof(T) * kBitsPerByte - 1; static const int kShift = sizeof(T) * kBitsPerByte - 1;
@ -65,7 +66,8 @@ void EncodeInt(std::vector<byte>& bytes, T value) {
} }
// Encode a PositionTableEntry. // Encode a PositionTableEntry.
void EncodeEntry(std::vector<byte>& bytes, const PositionTableEntry& entry) { void EncodeEntry(std::vector<byte>& bytes, // NOLINT(runtime/references)
const PositionTableEntry& entry) {
// We only accept ascending code offsets. // We only accept ascending code offsets.
DCHECK_GE(entry.code_offset, 0); DCHECK_GE(entry.code_offset, 0);
// Since code_offset is not negative, we use sign to encode is_statement. // Since code_offset is not negative, we use sign to encode is_statement.
@ -113,8 +115,9 @@ Vector<const byte> VectorFromByteArray(ByteArray byte_array) {
} }
#ifdef ENABLE_SLOW_DCHECKS #ifdef ENABLE_SLOW_DCHECKS
void CheckTableEquals(std::vector<PositionTableEntry>& raw_entries, void CheckTableEquals(
SourcePositionTableIterator& encoded) { std::vector<PositionTableEntry>& raw_entries, // NOLINT(runtime/references)
SourcePositionTableIterator& encoded) { // NOLINT(runtime/references)
// Brute force testing: Record all positions and decode // Brute force testing: Record all positions and decode
// the entire table to verify they are identical. // the entire table to verify they are identical.
auto raw = raw_entries.begin(); auto raw = raw_entries.begin();

View File

@ -309,9 +309,9 @@ Condition FlagsConditionToCondition(FlagsCondition condition) {
UNREACHABLE(); UNREACHABLE();
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, void EmitWordLoadPoisoningIfNeeded(
InstructionCode opcode, CodeGenerator* codegen, InstructionCode opcode,
ArmOperandConverter& i) { ArmOperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {
@ -320,9 +320,10 @@ void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen,
} }
} }
void ComputePoisonedAddressForLoad(CodeGenerator* codegen, void ComputePoisonedAddressForLoad(
InstructionCode opcode, CodeGenerator* codegen, InstructionCode opcode,
ArmOperandConverter& i, Register address) { ArmOperandConverter& i, // NOLINT(runtime/references)
Register address) {
DCHECK_EQ(kMemoryAccessPoisoned, DCHECK_EQ(kMemoryAccessPoisoned,
static_cast<MemoryAccessMode>(MiscField::decode(opcode))); static_cast<MemoryAccessMode>(MiscField::decode(opcode)));
switch (AddressingModeField::decode(opcode)) { switch (AddressingModeField::decode(opcode)) {

View File

@ -376,9 +376,9 @@ Condition FlagsConditionToCondition(FlagsCondition condition) {
UNREACHABLE(); UNREACHABLE();
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, void EmitWordLoadPoisoningIfNeeded(
InstructionCode opcode, Instruction* instr, CodeGenerator* codegen, InstructionCode opcode, Instruction* instr,
Arm64OperandConverter& i) { Arm64OperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -29,8 +29,8 @@ inline bool operator<(const CaseInfo& l, const CaseInfo& r) {
// Helper struct containing data about a table or lookup switch. // Helper struct containing data about a table or lookup switch.
class SwitchInfo { class SwitchInfo {
public: public:
SwitchInfo(ZoneVector<CaseInfo>& cases, int32_t min_value, int32_t max_value, SwitchInfo(ZoneVector<CaseInfo>& cases, // NOLINT(runtime/references)
BasicBlock* default_branch) int32_t min_value, int32_t max_value, BasicBlock* default_branch)
: cases_(cases), : cases_(cases),
min_value_(min_value), min_value_(min_value),
max_value_(max_value), max_value_(max_value),

View File

@ -496,11 +496,15 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
VectorSlotPair const& feedback, VectorSlotPair const& feedback,
Node* frame_state); Node* frame_state);
void EmitTableSwitch(const SwitchInfo& sw, InstructionOperand& index_operand); void EmitTableSwitch(
void EmitLookupSwitch(const SwitchInfo& sw, const SwitchInfo& sw,
InstructionOperand& value_operand); InstructionOperand& index_operand); // NOLINT(runtime/references)
void EmitBinarySearchSwitch(const SwitchInfo& sw, void EmitLookupSwitch(
InstructionOperand& value_operand); const SwitchInfo& sw,
InstructionOperand& value_operand); // NOLINT(runtime/references)
void EmitBinarySearchSwitch(
const SwitchInfo& sw,
InstructionOperand& value_operand); // NOLINT(runtime/references)
void TryRename(InstructionOperand* op); void TryRename(InstructionOperand* op);
int GetRename(int virtual_register); int GetRename(int virtual_register);

View File

@ -17,14 +17,17 @@ class V8_EXPORT_PRIVATE JumpThreading {
public: public:
// Compute the forwarding map of basic blocks to their ultimate destination. // Compute the forwarding map of basic blocks to their ultimate destination.
// Returns {true} if there is at least one block that is forwarded. // Returns {true} if there is at least one block that is forwarded.
static bool ComputeForwarding(Zone* local_zone, ZoneVector<RpoNumber>& result, static bool ComputeForwarding(
InstructionSequence* code, bool frame_at_start); Zone* local_zone,
ZoneVector<RpoNumber>& result, // NOLINT(runtime/references)
InstructionSequence* code, bool frame_at_start);
// Rewrite the instructions to forward jumps and branches. // Rewrite the instructions to forward jumps and branches.
// May also negate some branches. // May also negate some branches.
static void ApplyForwarding(Zone* local_zone, static void ApplyForwarding(
ZoneVector<RpoNumber>& forwarding, Zone* local_zone,
InstructionSequence* code); ZoneVector<RpoNumber>& forwarding, // NOLINT(runtime/references)
InstructionSequence* code);
}; };
} // namespace compiler } // namespace compiler

View File

@ -265,8 +265,9 @@ Condition FlagsConditionToConditionTst(FlagsCondition condition) {
UNREACHABLE(); UNREACHABLE();
} }
FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate, FPUCondition FlagsConditionToConditionCmpFPU(
FlagsCondition condition) { bool& predicate, // NOLINT(runtime/references)
FlagsCondition condition) {
switch (condition) { switch (condition) {
case kEqual: case kEqual:
predicate = true; predicate = true;
@ -302,9 +303,9 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
<< "\""; \ << "\""; \
UNIMPLEMENTED(); UNIMPLEMENTED();
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, void EmitWordLoadPoisoningIfNeeded(
InstructionCode opcode, Instruction* instr, CodeGenerator* codegen, InstructionCode opcode, Instruction* instr,
MipsOperandConverter& i) { MipsOperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -278,8 +278,9 @@ Condition FlagsConditionToConditionOvf(FlagsCondition condition) {
UNREACHABLE(); UNREACHABLE();
} }
FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate, FPUCondition FlagsConditionToConditionCmpFPU(
FlagsCondition condition) { bool& predicate, // NOLINT(runtime/references)
FlagsCondition condition) {
switch (condition) { switch (condition) {
case kEqual: case kEqual:
predicate = true; predicate = true;
@ -310,9 +311,9 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
UNREACHABLE(); UNREACHABLE();
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, void EmitWordLoadPoisoningIfNeeded(
InstructionCode opcode, Instruction* instr, CodeGenerator* codegen, InstructionCode opcode, Instruction* instr,
MipsOperandConverter& i) { MipsOperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -263,8 +263,9 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
UNREACHABLE(); UNREACHABLE();
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, Instruction* instr, void EmitWordLoadPoisoningIfNeeded(
PPCOperandConverter& i) { CodeGenerator* codegen, Instruction* instr,
PPCOperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(instr->opcode())); static_cast<MemoryAccessMode>(MiscField::decode(instr->opcode()));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -1286,11 +1286,13 @@ class LinearScanAllocator final : public RegisterAllocator {
RangeWithRegister::Equals>; RangeWithRegister::Equals>;
void MaybeUndoPreviousSplit(LiveRange* range); void MaybeUndoPreviousSplit(LiveRange* range);
void SpillNotLiveRanges(RangeWithRegisterSet& to_be_live, void SpillNotLiveRanges(
LifetimePosition position, SpillMode spill_mode); RangeWithRegisterSet& to_be_live, // NOLINT(runtime/references)
LifetimePosition position, SpillMode spill_mode);
LiveRange* AssignRegisterOnReload(LiveRange* range, int reg); LiveRange* AssignRegisterOnReload(LiveRange* range, int reg);
void ReloadLiveRanges(RangeWithRegisterSet& to_be_live, void ReloadLiveRanges(
LifetimePosition position); RangeWithRegisterSet& to_be_live, // NOLINT(runtime/references)
LifetimePosition position);
void UpdateDeferredFixedRanges(SpillMode spill_mode, InstructionBlock* block); void UpdateDeferredFixedRanges(SpillMode spill_mode, InstructionBlock* block);
bool BlockIsDeferredOrImmediatePredecessorIsNotDeferred( bool BlockIsDeferredOrImmediatePredecessorIsNotDeferred(

View File

@ -1246,8 +1246,9 @@ void AdjustStackPointerForTailCall(
} }
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, Instruction* instr, void EmitWordLoadPoisoningIfNeeded(
S390OperandConverter& i) { CodeGenerator* codegen, Instruction* instr,
S390OperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(instr->opcode())); static_cast<MemoryAccessMode>(MiscField::decode(instr->opcode()));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -447,11 +447,13 @@ void VisitTryTruncateDouble(InstructionSelector* selector, ArchOpcode opcode,
#endif #endif
template <class CanCombineWithLoad> template <class CanCombineWithLoad>
void GenerateRightOperands(InstructionSelector* selector, Node* node, void GenerateRightOperands(
Node* right, InstructionCode& opcode, InstructionSelector* selector, Node* node, Node* right,
OperandModes& operand_mode, InstructionCode& opcode, // NOLINT(runtime/references)
InstructionOperand* inputs, size_t& input_count, OperandModes& operand_mode, // NOLINT(runtime/references)
CanCombineWithLoad canCombineWithLoad) { InstructionOperand* inputs,
size_t& input_count, // NOLINT(runtime/references)
CanCombineWithLoad canCombineWithLoad) {
S390OperandGenerator g(selector); S390OperandGenerator g(selector);
if ((operand_mode & OperandMode::kAllowImmediate) && if ((operand_mode & OperandMode::kAllowImmediate) &&
@ -491,11 +493,13 @@ void GenerateRightOperands(InstructionSelector* selector, Node* node,
} }
template <class CanCombineWithLoad> template <class CanCombineWithLoad>
void GenerateBinOpOperands(InstructionSelector* selector, Node* node, void GenerateBinOpOperands(
Node* left, Node* right, InstructionCode& opcode, InstructionSelector* selector, Node* node, Node* left, Node* right,
OperandModes& operand_mode, InstructionCode& opcode, // NOLINT(runtime/references)
InstructionOperand* inputs, size_t& input_count, OperandModes& operand_mode, // NOLINT(runtime/references)
CanCombineWithLoad canCombineWithLoad) { InstructionOperand* inputs,
size_t& input_count, // NOLINT(runtime/references)
CanCombineWithLoad canCombineWithLoad) {
S390OperandGenerator g(selector); S390OperandGenerator g(selector);
// left is always register // left is always register
InstructionOperand const left_input = g.UseRegister(left); InstructionOperand const left_input = g.UseRegister(left);

View File

@ -349,7 +349,8 @@ class WasmProtectedInstructionTrap final : public WasmOutOfLineTrap {
void EmitOOLTrapIfNeeded(Zone* zone, CodeGenerator* codegen, void EmitOOLTrapIfNeeded(Zone* zone, CodeGenerator* codegen,
InstructionCode opcode, Instruction* instr, InstructionCode opcode, Instruction* instr,
X64OperandConverter& i, int pc) { X64OperandConverter& i, // NOLINT(runtime/references)
int pc) {
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessProtected) { if (access_mode == kMemoryAccessProtected) {
@ -357,9 +358,9 @@ void EmitOOLTrapIfNeeded(Zone* zone, CodeGenerator* codegen,
} }
} }
void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen, void EmitWordLoadPoisoningIfNeeded(
InstructionCode opcode, Instruction* instr, CodeGenerator* codegen, InstructionCode opcode, Instruction* instr,
X64OperandConverter& i) { X64OperandConverter& i) { // NOLINT(runtime/references)
const MemoryAccessMode access_mode = const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode)); static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) { if (access_mode == kMemoryAccessPoisoned) {

View File

@ -93,8 +93,10 @@ BytecodeAnalysis::BytecodeAnalysis(Handle<BytecodeArray> bytecode_array,
namespace { namespace {
void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness, void UpdateInLiveness(
const interpreter::BytecodeArrayAccessor& accessor) { Bytecode bytecode,
BytecodeLivenessState& in_liveness, // NOLINT(runtime/references)
const interpreter::BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode); int num_operands = Bytecodes::NumberOfOperands(bytecode);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode); const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);
@ -201,11 +203,13 @@ void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
} }
} }
void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState& out_liveness, void UpdateOutLiveness(
BytecodeLivenessState* next_bytecode_in_liveness, Bytecode bytecode,
const interpreter::BytecodeArrayAccessor& accessor, BytecodeLivenessState& out_liveness, // NOLINT(runtime/references)
Handle<BytecodeArray> bytecode_array, BytecodeLivenessState* next_bytecode_in_liveness,
const BytecodeLivenessMap& liveness_map) { const interpreter::BytecodeArrayAccessor& accessor,
Handle<BytecodeArray> bytecode_array,
const BytecodeLivenessMap& liveness_map) {
int current_offset = accessor.current_offset(); int current_offset = accessor.current_offset();
// Special case Suspend and Resume to just pass through liveness. // Special case Suspend and Resume to just pass through liveness.
@ -261,7 +265,8 @@ void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState& out_liveness,
} }
} }
void UpdateLiveness(Bytecode bytecode, BytecodeLiveness& liveness, void UpdateLiveness(Bytecode bytecode,
BytecodeLiveness& liveness, // NOLINT(runtime/references)
BytecodeLivenessState** next_bytecode_in_liveness, BytecodeLivenessState** next_bytecode_in_liveness,
const interpreter::BytecodeArrayAccessor& accessor, const interpreter::BytecodeArrayAccessor& accessor,
Handle<BytecodeArray> bytecode_array, Handle<BytecodeArray> bytecode_array,
@ -274,8 +279,10 @@ void UpdateLiveness(Bytecode bytecode, BytecodeLiveness& liveness,
*next_bytecode_in_liveness = liveness.in; *next_bytecode_in_liveness = liveness.in;
} }
void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments& assignments, void UpdateAssignments(
const interpreter::BytecodeArrayAccessor& accessor) { Bytecode bytecode,
BytecodeLoopAssignments& assignments, // NOLINT(runtime/references)
const interpreter::BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode); int num_operands = Bytecodes::NumberOfOperands(bytecode);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode); const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);

View File

@ -858,10 +858,13 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// TODO(jkummerow): The style guide wants pointers for output parameters. // TODO(jkummerow): The style guide wants pointers for output parameters.
// https://google.github.io/styleguide/cppguide.html#Output_Parameters // https://google.github.io/styleguide/cppguide.html#Output_Parameters
bool ToInt32Constant(Node* node, int32_t& out_value); bool ToInt32Constant(Node* node,
bool ToInt64Constant(Node* node, int64_t& out_value); int32_t& out_value); // NOLINT(runtime/references)
bool ToInt64Constant(Node* node,
int64_t& out_value); // NOLINT(runtime/references)
bool ToSmiConstant(Node* node, Smi* out_value); bool ToSmiConstant(Node* node, Smi* out_value);
bool ToIntPtrConstant(Node* node, intptr_t& out_value); bool ToIntPtrConstant(Node* node,
intptr_t& out_value); // NOLINT(runtime/references)
bool IsUndefinedConstant(TNode<Object> node); bool IsUndefinedConstant(TNode<Object> node);
bool IsNullConstant(TNode<Object> node); bool IsNullConstant(TNode<Object> node);

View File

@ -33,13 +33,16 @@ struct Diamond {
} }
// Place {this} after {that} in control flow order. // Place {this} after {that} in control flow order.
void Chain(Diamond& that) { branch->ReplaceInput(1, that.merge); } void Chain(Diamond& that) { // NOLINT(runtime/references)
branch->ReplaceInput(1, that.merge);
}
// Place {this} after {that} in control flow order. // Place {this} after {that} in control flow order.
void Chain(Node* that) { branch->ReplaceInput(1, that); } void Chain(Node* that) { branch->ReplaceInput(1, that); }
// Nest {this} into either the if_true or if_false branch of {that}. // Nest {this} into either the if_true or if_false branch of {that}.
void Nest(Diamond& that, bool if_true) { void Nest(Diamond& that, // NOLINT(runtime/references)
bool if_true) {
if (if_true) { if (if_true) {
branch->ReplaceInput(1, that.if_true); branch->ReplaceInput(1, that.if_true);
that.merge->ReplaceInput(0, merge); that.merge->ReplaceInput(0, merge);

View File

@ -59,7 +59,9 @@ class V8_EXPORT_PRIVATE Int64Lowering {
bool HasReplacementHigh(Node* node); bool HasReplacementHigh(Node* node);
Node* GetReplacementHigh(Node* node); Node* GetReplacementHigh(Node* node);
void PreparePhiReplacement(Node* phi); void PreparePhiReplacement(Node* phi);
void GetIndexNodes(Node* index, Node*& index_low, Node*& index_high); void GetIndexNodes(Node* index,
Node*& index_low, // NOLINT(runtime/references)
Node*& index_high); // NOLINT(runtime/references)
void ReplaceNodeWithProjections(Node* node); void ReplaceNodeWithProjections(Node* node);
void LowerMemoryBaseAndIndex(Node* node); void LowerMemoryBaseAndIndex(Node* node);

View File

@ -1095,10 +1095,10 @@ bool CanInlineArrayIteratingBuiltin(JSHeapBroker* broker,
return true; return true;
} }
bool CanInlineArrayResizingBuiltin(JSHeapBroker* broker, bool CanInlineArrayResizingBuiltin(
MapHandles const& receiver_maps, JSHeapBroker* broker, MapHandles const& receiver_maps,
std::vector<ElementsKind>& kinds, std::vector<ElementsKind>& kinds, // NOLINT(runtime/references)
bool builtin_is_push = false) { bool builtin_is_push = false) {
DCHECK_NE(0, receiver_maps.size()); DCHECK_NE(0, receiver_maps.size());
for (auto receiver_map : receiver_maps) { for (auto receiver_map : receiver_maps) {
MapRef map(broker, receiver_map); MapRef map(broker, receiver_map);

View File

@ -59,7 +59,8 @@ class JSInliner final : public AdvancedReducer {
SourcePositionTable* const source_positions_; SourcePositionTable* const source_positions_;
base::Optional<SharedFunctionInfoRef> DetermineCallTarget(Node* node); base::Optional<SharedFunctionInfoRef> DetermineCallTarget(Node* node);
FeedbackVectorRef DetermineCallContext(Node* node, Node*& context_out); FeedbackVectorRef DetermineCallContext(
Node* node, Node*& context_out); // NOLINT(runtime/references)
Node* CreateArtificialFrameState(Node* node, Node* outer_frame_state, Node* CreateArtificialFrameState(Node* node, Node* outer_frame_state,
int parameter_count, BailoutId bailout_id, int parameter_count, BailoutId bailout_id,

View File

@ -153,7 +153,8 @@ class JSTypeHintLowering {
private: private:
friend class JSSpeculativeBinopBuilder; friend class JSSpeculativeBinopBuilder;
Node* TryBuildSoftDeopt(FeedbackNexus& nexus, Node* effect, Node* control, Node* TryBuildSoftDeopt(FeedbackNexus& nexus, // NOLINT(runtime/references)
Node* effect, Node* control,
DeoptimizeReason reson) const; DeoptimizeReason reson) const;
JSGraph* jsgraph() const { return jsgraph_; } JSGraph* jsgraph() const { return jsgraph_; }

View File

@ -233,7 +233,7 @@ class V8_EXPORT_PRIVATE LoadElimination final
bool FieldsEquals(AbstractFields const& this_fields, bool FieldsEquals(AbstractFields const& this_fields,
AbstractFields const& that_fields) const; AbstractFields const& that_fields) const;
void FieldsMerge(AbstractFields& this_fields, void FieldsMerge(AbstractFields& this_fields, // NOLINT(runtime/references)
AbstractFields const& that_fields, Zone* zone); AbstractFields const& that_fields, Zone* zone);
AbstractElements const* elements_ = nullptr; AbstractElements const* elements_ = nullptr;

View File

@ -728,8 +728,9 @@ class SpecialRPONumberer : public ZoneObject {
} }
}; };
int Push(ZoneVector<SpecialRPOStackFrame>& stack, int depth, int Push(
BasicBlock* child, int unvisited) { ZoneVector<SpecialRPOStackFrame>& stack, // NOLINT(runtime/references)
int depth, BasicBlock* child, int unvisited) {
if (child->rpo_number() == unvisited) { if (child->rpo_number() == unvisited) {
stack[depth].block = child; stack[depth].block = child;
stack[depth].index = 0; stack[depth].index = 0;
@ -958,8 +959,9 @@ class SpecialRPONumberer : public ZoneObject {
} }
// Computes loop membership from the backedges of the control flow graph. // Computes loop membership from the backedges of the control flow graph.
void ComputeLoopInfo(ZoneVector<SpecialRPOStackFrame>& queue, void ComputeLoopInfo(
size_t num_loops, ZoneVector<Backedge>* backedges) { ZoneVector<SpecialRPOStackFrame>& queue, // NOLINT(runtime/references)
size_t num_loops, ZoneVector<Backedge>* backedges) {
// Extend existing loop membership vectors. // Extend existing loop membership vectors.
for (LoopInfo& loop : loops_) { for (LoopInfo& loop : loops_) {
loop.members->Resize(static_cast<int>(schedule_->BasicBlockCount()), loop.members->Resize(static_cast<int>(schedule_->BasicBlockCount()),

View File

@ -200,7 +200,7 @@ class SerializerForBackgroundCompilation::Environment : public ZoneObject {
// Appends the hints for the given register range to {dst} (in order). // Appends the hints for the given register range to {dst} (in order).
void ExportRegisterHints(interpreter::Register first, size_t count, void ExportRegisterHints(interpreter::Register first, size_t count,
HintsVector& dst); HintsVector& dst); // NOLINT(runtime/references)
private: private:
friend std::ostream& operator<<(std::ostream& out, const Environment& env); friend std::ostream& operator<<(std::ostream& out, const Environment& env);

View File

@ -370,8 +370,9 @@ class SerializerForBackgroundCompilation {
bool with_spread = false); bool with_spread = false);
void ProcessApiCall(Handle<SharedFunctionInfo> target, void ProcessApiCall(Handle<SharedFunctionInfo> target,
const HintsVector& arguments); const HintsVector& arguments);
void ProcessReceiverMapForApiCall(FunctionTemplateInfoRef& target, void ProcessReceiverMapForApiCall(
Handle<Map> receiver); FunctionTemplateInfoRef& target, // NOLINT(runtime/references)
Handle<Map> receiver);
void ProcessBuiltinCall(Handle<SharedFunctionInfo> target, void ProcessBuiltinCall(Handle<SharedFunctionInfo> target,
const HintsVector& arguments); const HintsVector& arguments);
@ -405,8 +406,8 @@ class SerializerForBackgroundCompilation {
void ProcessContextAccess(const Hints& context_hints, int slot, int depth, void ProcessContextAccess(const Hints& context_hints, int slot, int depth,
ContextProcessingMode mode); ContextProcessingMode mode);
void ProcessImmutableLoad(ContextRef& context, int slot, void ProcessImmutableLoad(ContextRef& context, // NOLINT(runtime/references)
ContextProcessingMode mode); int slot, ContextProcessingMode mode);
void ProcessLdaLookupGlobalSlot(interpreter::BytecodeArrayIterator* iterator); void ProcessLdaLookupGlobalSlot(interpreter::BytecodeArrayIterator* iterator);
void ProcessLdaLookupContextSlot( void ProcessLdaLookupContextSlot(
interpreter::BytecodeArrayIterator* iterator); interpreter::BytecodeArrayIterator* iterator);

View File

@ -392,14 +392,13 @@ MachineType StateValuesAccess::iterator::type() {
} }
} }
bool StateValuesAccess::iterator::operator!=(
bool StateValuesAccess::iterator::operator!=(iterator& other) { iterator& other) { // NOLINT(runtime/references)
// We only allow comparison with end(). // We only allow comparison with end().
CHECK(other.done()); CHECK(other.done());
return !done(); return !done();
} }
StateValuesAccess::iterator& StateValuesAccess::iterator::operator++() { StateValuesAccess::iterator& StateValuesAccess::iterator::operator++() {
Advance(); Advance();
return *this; return *this;

View File

@ -92,7 +92,7 @@ class V8_EXPORT_PRIVATE StateValuesAccess {
class V8_EXPORT_PRIVATE iterator { class V8_EXPORT_PRIVATE iterator {
public: public:
// Bare minimum of operators needed for range iteration. // Bare minimum of operators needed for range iteration.
bool operator!=(iterator& other); bool operator!=(iterator& other); // NOLINT(runtime/references)
iterator& operator++(); iterator& operator++();
TypedNode operator*(); TypedNode operator*();

View File

@ -2001,8 +2001,9 @@ int LineFromOffset(Local<debug::Script> script, int offset) {
return location.GetLineNumber(); return location.GetLineNumber();
} }
void WriteLcovDataForRange(std::vector<uint32_t>& lines, int start_line, void WriteLcovDataForRange(
int end_line, uint32_t count) { std::vector<uint32_t>& lines, // NOLINT(runtime/references)
int start_line, int end_line, uint32_t count) {
// Ensure space in the array. // Ensure space in the array.
lines.resize(std::max(static_cast<size_t>(end_line + 1), lines.size()), 0); lines.resize(std::max(static_cast<size_t>(end_line + 1), lines.size()), 0);
// Boundary lines could be shared between two functions with different // Boundary lines could be shared between two functions with different
@ -2013,10 +2014,10 @@ void WriteLcovDataForRange(std::vector<uint32_t>& lines, int start_line,
for (int k = start_line + 1; k < end_line; k++) lines[k] = count; for (int k = start_line + 1; k < end_line; k++) lines[k] = count;
} }
void WriteLcovDataForNamedRange(std::ostream& sink, void WriteLcovDataForNamedRange(
std::vector<uint32_t>& lines, std::ostream& sink,
const std::string& name, int start_line, std::vector<uint32_t>& lines, // NOLINT(runtime/references)
int end_line, uint32_t count) { const std::string& name, int start_line, int end_line, uint32_t count) {
WriteLcovDataForRange(lines, start_line, end_line, count); WriteLcovDataForRange(lines, start_line, end_line, count);
sink << "FN:" << start_line + 1 << "," << name << std::endl; sink << "FN:" << start_line + 1 << "," << name << std::endl;
sink << "FNDA:" << count << "," << name << std::endl; sink << "FNDA:" << count << "," << name << std::endl;

View File

@ -68,7 +68,8 @@ bool CompareCoverageBlock(const CoverageBlock& a, const CoverageBlock& b) {
return a.start < b.start; return a.start < b.start;
} }
void SortBlockData(std::vector<CoverageBlock>& v) { void SortBlockData(
std::vector<CoverageBlock>& v) { // NOLINT(runtime/references)
// Sort according to the block nesting structure. // Sort according to the block nesting structure.
std::sort(v.begin(), v.end(), CompareCoverageBlock); std::sort(v.begin(), v.end(), CompareCoverageBlock);
} }

View File

@ -164,8 +164,9 @@ class WasmScript : public Script {
uint32_t GetFunctionHash(int function_index); uint32_t GetFunctionHash(int function_index);
}; };
V8_EXPORT_PRIVATE void GetLoadedScripts(Isolate* isolate, V8_EXPORT_PRIVATE void GetLoadedScripts(
PersistentValueVector<Script>& scripts); Isolate* isolate,
PersistentValueVector<Script>& scripts); // NOLINT(runtime/references)
MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate,
Local<String> source); Local<String> source);

View File

@ -937,10 +937,10 @@ class FunctionDataMap : public ThreadVisitor {
std::map<FuncId, FunctionData> map_; std::map<FuncId, FunctionData> map_;
}; };
bool CanPatchScript(const LiteralMap& changed, Handle<Script> script, bool CanPatchScript(
Handle<Script> new_script, const LiteralMap& changed, Handle<Script> script, Handle<Script> new_script,
FunctionDataMap& function_data_map, FunctionDataMap& function_data_map, // NOLINT(runtime/references)
debug::LiveEditResult* result) { debug::LiveEditResult* result) {
debug::LiveEditResult::Status status = debug::LiveEditResult::OK; debug::LiveEditResult::Status status = debug::LiveEditResult::OK;
for (const auto& mapping : changed) { for (const auto& mapping : changed) {
FunctionData* data = nullptr; FunctionData* data = nullptr;
@ -971,9 +971,10 @@ bool CanPatchScript(const LiteralMap& changed, Handle<Script> script,
return true; return true;
} }
bool CanRestartFrame(Isolate* isolate, Address fp, bool CanRestartFrame(
FunctionDataMap& function_data_map, Isolate* isolate, Address fp,
const LiteralMap& changed, debug::LiveEditResult* result) { FunctionDataMap& function_data_map, // NOLINT(runtime/references)
const LiteralMap& changed, debug::LiveEditResult* result) {
DCHECK_GT(fp, 0); DCHECK_GT(fp, 0);
StackFrame* restart_frame = nullptr; StackFrame* restart_frame = nullptr;
StackFrameIterator it(isolate); StackFrameIterator it(isolate);

View File

@ -112,7 +112,9 @@ class StackFrame {
INNER_JSENTRY_FRAME = (0 << kSmiTagSize) | kSmiTag, INNER_JSENTRY_FRAME = (0 << kSmiTagSize) | kSmiTag,
OUTERMOST_JSENTRY_FRAME = (1 << kSmiTagSize) | kSmiTag OUTERMOST_JSENTRY_FRAME = (1 << kSmiTagSize) | kSmiTag
}; };
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((INNER_JSENTRY_FRAME & kHeapObjectTagMask) != kHeapObjectTag); STATIC_ASSERT((INNER_JSENTRY_FRAME & kHeapObjectTagMask) != kHeapObjectTag);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((OUTERMOST_JSENTRY_FRAME & kHeapObjectTagMask) != STATIC_ASSERT((OUTERMOST_JSENTRY_FRAME & kHeapObjectTagMask) !=
kHeapObjectTag); kHeapObjectTag);

View File

@ -2512,7 +2512,8 @@ float FPAbs<float>(float a) {
} }
template <typename T> template <typename T>
static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind, T& result) { static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind,
T& result) { // NOLINT(runtime/references)
if (std::isnan(a) && std::isnan(b)) { if (std::isnan(a) && std::isnan(b)) {
result = a; result = a;
} else if (std::isnan(a)) { } else if (std::isnan(a)) {
@ -5271,7 +5272,8 @@ void Simulator::DecodeTypeMsa3R() {
} }
template <typename T_int, typename T_fp, typename T_reg> template <typename T_int, typename T_fp, typename T_reg>
void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) { void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt,
T_reg& wd) { // NOLINT(runtime/references)
const T_int all_ones = static_cast<T_int>(-1); const T_int all_ones = static_cast<T_int>(-1);
const T_fp s_element = *reinterpret_cast<T_fp*>(&ws); const T_fp s_element = *reinterpret_cast<T_fp*>(&ws);
const T_fp t_element = *reinterpret_cast<T_fp*>(&wt); const T_fp t_element = *reinterpret_cast<T_fp*>(&wt);
@ -5414,7 +5416,8 @@ void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
} }
template <typename T_int, typename T_int_dbl, typename T_reg> template <typename T_int, typename T_int_dbl, typename T_reg>
void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) { void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt,
T_reg& wd) { // NOLINT(runtime/references)
// using T_uint = typename std::make_unsigned<T_int>::type; // using T_uint = typename std::make_unsigned<T_int>::type;
using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type; using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type;
const T_int max_int = std::numeric_limits<T_int>::max(); const T_int max_int = std::numeric_limits<T_int>::max();
@ -5859,7 +5862,8 @@ static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
#undef QUIET_BIT_D #undef QUIET_BIT_D
template <typename T_int, typename T_fp, typename T_src, typename T_dst> template <typename T_int, typename T_fp, typename T_src, typename T_dst>
T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst, T_int Msa2RFInstrHelper(uint32_t opcode, T_src src,
T_dst& dst, // NOLINT(runtime/references)
Simulator* sim) { Simulator* sim) {
using T_uint = typename std::make_unsigned<T_int>::type; using T_uint = typename std::make_unsigned<T_int>::type;
switch (opcode) { switch (opcode) {

View File

@ -258,16 +258,26 @@ class Simulator : public SimulatorBase {
bool set_fcsr_round_error(float original, float rounded); bool set_fcsr_round_error(float original, float rounded);
bool set_fcsr_round64_error(double original, double rounded); bool set_fcsr_round64_error(double original, double rounded);
bool set_fcsr_round64_error(float original, float rounded); bool set_fcsr_round64_error(float original, float rounded);
void round_according_to_fcsr(double toRound, double& rounded, void round_according_to_fcsr(
int32_t& rounded_int, double fs); double toRound, double& rounded, // NOLINT(runtime/references)
void round_according_to_fcsr(float toRound, float& rounded, int32_t& rounded_int, // NOLINT(runtime/references)
int32_t& rounded_int, float fs); double fs);
void round_according_to_fcsr(
float toRound, float& rounded, // NOLINT(runtime/references)
int32_t& rounded_int, // NOLINT(runtime/references)
float fs);
template <typename Tfp, typename Tint> template <typename Tfp, typename Tint>
void round_according_to_msacsr(Tfp toRound, Tfp& rounded, Tint& rounded_int); void round_according_to_msacsr(
void round64_according_to_fcsr(double toRound, double& rounded, Tfp toRound, Tfp& rounded, // NOLINT(runtime/references)
int64_t& rounded_int, double fs); Tint& rounded_int); // NOLINT(runtime/references)
void round64_according_to_fcsr(float toRound, float& rounded, void round64_according_to_fcsr(
int64_t& rounded_int, float fs); double toRound, double& rounded, // NOLINT(runtime/references)
int64_t& rounded_int, // NOLINT(runtime/references)
double fs);
void round64_according_to_fcsr(
float toRound, float& rounded, // NOLINT(runtime/references)
int64_t& rounded_int, // NOLINT(runtime/references)
float fs);
// Special case of set_register and get_register to access the raw PC value. // Special case of set_register and get_register to access the raw PC value.
void set_pc(int32_t value); void set_pc(int32_t value);
int32_t get_pc() const; int32_t get_pc() const;

View File

@ -2507,7 +2507,8 @@ float FPAbs<float>(float a) {
} }
template <typename T> template <typename T>
static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind, T& result) { static bool FPUProcessNaNsAndZeros(T a, T b, MaxMinKind kind,
T& result) { // NOLINT(runtime/references)
if (std::isnan(a) && std::isnan(b)) { if (std::isnan(a) && std::isnan(b)) {
result = a; result = a;
} else if (std::isnan(a)) { } else if (std::isnan(a)) {
@ -5544,7 +5545,8 @@ void Simulator::DecodeTypeMsa3R() {
} }
template <typename T_int, typename T_fp, typename T_reg> template <typename T_int, typename T_fp, typename T_reg>
void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) { void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt,
T_reg& wd) { // NOLINT(runtime/references)
const T_int all_ones = static_cast<T_int>(-1); const T_int all_ones = static_cast<T_int>(-1);
const T_fp s_element = *reinterpret_cast<T_fp*>(&ws); const T_fp s_element = *reinterpret_cast<T_fp*>(&ws);
const T_fp t_element = *reinterpret_cast<T_fp*>(&wt); const T_fp t_element = *reinterpret_cast<T_fp*>(&wt);
@ -5687,7 +5689,8 @@ void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
} }
template <typename T_int, typename T_int_dbl, typename T_reg> template <typename T_int, typename T_int_dbl, typename T_reg>
void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) { void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt,
T_reg& wd) { // NOLINT(runtime/references)
// using T_uint = typename std::make_unsigned<T_int>::type; // using T_uint = typename std::make_unsigned<T_int>::type;
using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type; using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type;
const T_int max_int = std::numeric_limits<T_int>::max(); const T_int max_int = std::numeric_limits<T_int>::max();
@ -6139,7 +6142,8 @@ static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
#undef QUIET_BIT_D #undef QUIET_BIT_D
template <typename T_int, typename T_fp, typename T_src, typename T_dst> template <typename T_int, typename T_fp, typename T_src, typename T_dst>
T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst, T_int Msa2RFInstrHelper(uint32_t opcode, T_src src,
T_dst& dst, // NOLINT(runtime/references)
Simulator* sim) { Simulator* sim) {
using T_uint = typename std::make_unsigned<T_int>::type; using T_uint = typename std::make_unsigned<T_int>::type;
switch (opcode) { switch (opcode) {

View File

@ -255,17 +255,26 @@ class Simulator : public SimulatorBase {
bool set_fcsr_round64_error(double original, double rounded); bool set_fcsr_round64_error(double original, double rounded);
bool set_fcsr_round_error(float original, float rounded); bool set_fcsr_round_error(float original, float rounded);
bool set_fcsr_round64_error(float original, float rounded); bool set_fcsr_round64_error(float original, float rounded);
void round_according_to_fcsr(double toRound, double& rounded, void round_according_to_fcsr(
int32_t& rounded_int, double fs); double toRound, double& rounded, // NOLINT(runtime/references)
void round64_according_to_fcsr(double toRound, double& rounded, int32_t& rounded_int, // NOLINT(runtime/references)
int64_t& rounded_int, double fs); double fs);
void round_according_to_fcsr(float toRound, float& rounded, void round64_according_to_fcsr(
int32_t& rounded_int, float fs); double toRound, double& rounded, // NOLINT(runtime/references)
void round64_according_to_fcsr(float toRound, float& rounded, int64_t& rounded_int, // NOLINT(runtime/references)
int64_t& rounded_int, float fs); double fs);
void round_according_to_fcsr(
float toRound, float& rounded, // NOLINT(runtime/references)
int32_t& rounded_int, // NOLINT(runtime/references)
float fs);
void round64_according_to_fcsr(
float toRound, float& rounded, // NOLINT(runtime/references)
int64_t& rounded_int, // NOLINT(runtime/references)
float fs);
template <typename T_fp, typename T_int> template <typename T_fp, typename T_int>
void round_according_to_msacsr(T_fp toRound, T_fp& rounded, void round_according_to_msacsr(
T_int& rounded_int); T_fp toRound, T_fp& rounded, // NOLINT(runtime/references)
T_int& rounded_int); // NOLINT(runtime/references)
void set_fcsr_rounding_mode(FPURoundingMode mode); void set_fcsr_rounding_mode(FPURoundingMode mode);
void set_msacsr_rounding_mode(FPURoundingMode mode); void set_msacsr_rounding_mode(FPURoundingMode mode);
unsigned int get_fcsr_rounding_mode(); unsigned int get_fcsr_rounding_mode();

View File

@ -171,7 +171,8 @@ struct Heap::StrongRootsList {
class IdleScavengeObserver : public AllocationObserver { class IdleScavengeObserver : public AllocationObserver {
public: public:
IdleScavengeObserver(Heap& heap, intptr_t step_size) IdleScavengeObserver(Heap& heap, // NOLINT(runtime/references)
intptr_t step_size)
: AllocationObserver(step_size), heap_(heap) {} : AllocationObserver(step_size), heap_(heap) {}
void Step(int bytes_allocated, Address, size_t) override { void Step(int bytes_allocated, Address, size_t) override {
@ -1335,7 +1336,8 @@ intptr_t CompareWords(int size, HeapObject a, HeapObject b) {
return 0; return 0;
} }
void ReportDuplicates(int size, std::vector<HeapObject>& objects) { void ReportDuplicates(
int size, std::vector<HeapObject>& objects) { // NOLINT(runtime/references)
if (objects.size() == 0) return; if (objects.size() == 0) return;
sort(objects.begin(), objects.end(), [size](HeapObject a, HeapObject b) { sort(objects.begin(), objects.end(), [size](HeapObject a, HeapObject b) {
@ -2742,6 +2744,7 @@ STATIC_ASSERT(IsAligned(ByteArray::kHeaderSize, kDoubleAlignment));
#endif #endif
#ifdef V8_HOST_ARCH_32_BIT #ifdef V8_HOST_ARCH_32_BIT
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((HeapNumber::kValueOffset & kDoubleAlignmentMask) == kTaggedSize); STATIC_ASSERT((HeapNumber::kValueOffset & kDoubleAlignmentMask) == kTaggedSize);
#endif #endif

View File

@ -255,7 +255,9 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
private: private:
class Observer : public AllocationObserver { class Observer : public AllocationObserver {
public: public:
Observer(IncrementalMarking& incremental_marking, intptr_t step_size) Observer(
IncrementalMarking& incremental_marking, // NOLINT(runtime/references)
intptr_t step_size)
: AllocationObserver(step_size), : AllocationObserver(step_size),
incremental_marking_(incremental_marking) {} incremental_marking_(incremental_marking) {}

View File

@ -12,7 +12,7 @@ namespace internal {
class StressMarkingObserver : public AllocationObserver { class StressMarkingObserver : public AllocationObserver {
public: public:
explicit StressMarkingObserver(Heap& heap); explicit StressMarkingObserver(Heap& heap); // NOLINT(runtime/references)
void Step(int bytes_allocated, Address soon_object, size_t size) override; void Step(int bytes_allocated, Address soon_object, size_t size) override;

View File

@ -12,7 +12,7 @@ namespace internal {
class StressScavengeObserver : public AllocationObserver { class StressScavengeObserver : public AllocationObserver {
public: public:
explicit StressScavengeObserver(Heap& heap); explicit StressScavengeObserver(Heap& heap); // NOLINT(runtime/references)
void Step(int bytes_allocated, Address soon_object, size_t size) override; void Step(int bytes_allocated, Address soon_object, size_t size) override;

View File

@ -45,20 +45,29 @@ class StringUtil {
return s.find(needle); return s.find(needle);
} }
static const size_t kNotFound = String::kNotFound; static const size_t kNotFound = String::kNotFound;
static void builderAppend(StringBuilder& builder, const String& s) { static void builderAppend(
StringBuilder& builder, // NOLINT(runtime/references)
const String& s) {
builder.append(s); builder.append(s);
} }
static void builderAppend(StringBuilder& builder, UChar c) { static void builderAppend(
StringBuilder& builder, // NOLINT(runtime/references)
UChar c) {
builder.append(c); builder.append(c);
} }
static void builderAppend(StringBuilder& builder, const char* s, size_t len) { static void builderAppend(
StringBuilder& builder, // NOLINT(runtime/references)
const char* s, size_t len) {
builder.append(s, len); builder.append(s, len);
} }
static void builderAppendQuotedString(StringBuilder&, const String&); static void builderAppendQuotedString(StringBuilder&, const String&);
static void builderReserve(StringBuilder& builder, size_t capacity) { static void builderReserve(
StringBuilder& builder, // NOLINT(runtime/references)
size_t capacity) {
builder.reserveCapacity(capacity); builder.reserveCapacity(capacity);
} }
static String builderToString(StringBuilder& builder) { static String builderToString(
StringBuilder& builder) { // NOLINT(runtime/references)
return builder.toString(); return builder.toString();
} }
static std::unique_ptr<protocol::Value> parseJSON(const String16& json); static std::unique_ptr<protocol::Value> parseJSON(const String16& json);

View File

@ -496,11 +496,11 @@ void V8Console::valuesCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
info.GetReturnValue().Set(values); info.GetReturnValue().Set(values);
} }
static void setFunctionBreakpoint(ConsoleHelper& helper, int sessionId, static void setFunctionBreakpoint(
v8::Local<v8::Function> function, ConsoleHelper& helper, // NOLINT(runtime/references)
V8DebuggerAgentImpl::BreakpointSource source, int sessionId, v8::Local<v8::Function> function,
v8::Local<v8::String> condition, V8DebuggerAgentImpl::BreakpointSource source,
bool enable) { v8::Local<v8::String> condition, bool enable) {
V8InspectorSessionImpl* session = helper.session(sessionId); V8InspectorSessionImpl* session = helper.session(sessionId);
if (session == nullptr) return; if (session == nullptr) return;
if (!session->debuggerAgent()->enabled()) return; if (!session->debuggerAgent()->enabled()) return;

View File

@ -24,7 +24,7 @@ static const int kMaxAsyncTaskStacks = 128 * 1024;
static const int kNoBreakpointId = 0; static const int kNoBreakpointId = 0;
template <typename Map> template <typename Map>
void cleanupExpiredWeakPointers(Map& map) { void cleanupExpiredWeakPointers(Map& map) { // NOLINT(runtime/references)
for (auto it = map.begin(); it != map.end();) { for (auto it = map.begin(); it != map.end();) {
if (it->second.expired()) { if (it->second.expired()) {
it = map.erase(it); it = map.erase(it);

View File

@ -107,7 +107,8 @@ bool wrapEvaluateResultAsync(InjectedScript* injectedScript,
} }
void innerCallFunctionOn( void innerCallFunctionOn(
V8InspectorSessionImpl* session, InjectedScript::Scope& scope, V8InspectorSessionImpl* session,
InjectedScript::Scope& scope, // NOLINT(runtime/references)
v8::Local<v8::Value> recv, const String16& expression, v8::Local<v8::Value> recv, const String16& expression,
Maybe<protocol::Array<protocol::Runtime::CallArgument>> optionalArguments, Maybe<protocol::Array<protocol::Runtime::CallArgument>> optionalArguments,
bool silent, WrapMode wrapMode, bool userGesture, bool awaitPromise, bool silent, WrapMode wrapMode, bool userGesture, bool awaitPromise,

View File

@ -228,7 +228,9 @@ static const UChar32 offsetsFromUTF8[6] = {0x00000000UL,
static_cast<UChar32>(0xFA082080UL), static_cast<UChar32>(0xFA082080UL),
static_cast<UChar32>(0x82082080UL)}; static_cast<UChar32>(0x82082080UL)};
static inline UChar32 readUTF8Sequence(const char*& sequence, size_t length) { static inline UChar32 readUTF8Sequence(
const char*& sequence, // NOLINT(runtime/references)
size_t length) {
UChar32 character = 0; UChar32 character = 0;
// The cases all fall through. // The cases all fall through.
@ -334,7 +336,8 @@ ConversionResult convertUTF8ToUTF16(const char** sourceStart,
// Helper to write a three-byte UTF-8 code point to the buffer, caller must // Helper to write a three-byte UTF-8 code point to the buffer, caller must
// check room is available. // check room is available.
static inline void putUTF8Triple(char*& buffer, UChar ch) { static inline void putUTF8Triple(char*& buffer, // NOLINT(runtime/references)
UChar ch) {
*buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0); *buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0);
*buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80); *buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80);
*buffer++ = static_cast<char>((ch & 0x3F) | 0x80); *buffer++ = static_cast<char>((ch & 0x3F) | 0x80);

View File

@ -241,8 +241,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
// Build jump to targets[value], where // Build jump to targets[value], where
// start_index <= value < start_index + size. // start_index <= value < start_index + size.
void BuildIndexedJump(Register value, size_t start_index, size_t size, void BuildIndexedJump(
ZoneVector<BytecodeLabel>& targets); Register value, size_t start_index, size_t size,
ZoneVector<BytecodeLabel>& targets); // NOLINT(runtime/references)
void BuildNewLocalActivationContext(); void BuildNewLocalActivationContext();
void BuildLocalActivationContextInitialization(); void BuildLocalActivationContextInitialization();

View File

@ -1123,10 +1123,10 @@ void Logger::SetterCallbackEvent(Name name, Address entry_point) {
namespace { namespace {
void AppendCodeCreateHeader(Log::MessageBuilder& msg, void AppendCodeCreateHeader(
CodeEventListener::LogEventsAndTags tag, Log::MessageBuilder& msg, // NOLINT(runtime/references)
AbstractCode::Kind kind, uint8_t* address, int size, CodeEventListener::LogEventsAndTags tag, AbstractCode::Kind kind,
base::ElapsedTimer* timer) { uint8_t* address, int size, base::ElapsedTimer* timer) {
msg << kLogEventsNames[CodeEventListener::CODE_CREATION_EVENT] msg << kLogEventsNames[CodeEventListener::CODE_CREATION_EVENT]
<< Logger::kNext << kLogEventsNames[tag] << Logger::kNext << kind << Logger::kNext << kLogEventsNames[tag] << Logger::kNext << kind
<< Logger::kNext << timer->Elapsed().InMicroseconds() << Logger::kNext << Logger::kNext << timer->Elapsed().InMicroseconds() << Logger::kNext
@ -1134,9 +1134,10 @@ void AppendCodeCreateHeader(Log::MessageBuilder& msg,
<< Logger::kNext; << Logger::kNext;
} }
void AppendCodeCreateHeader(Log::MessageBuilder& msg, void AppendCodeCreateHeader(
CodeEventListener::LogEventsAndTags tag, Log::MessageBuilder& msg, // NOLINT(runtime/references)
AbstractCode code, base::ElapsedTimer* timer) { CodeEventListener::LogEventsAndTags tag, AbstractCode code,
base::ElapsedTimer* timer) {
AppendCodeCreateHeader(msg, tag, code.kind(), AppendCodeCreateHeader(msg, tag, code.kind(),
reinterpret_cast<uint8_t*>(code.InstructionStart()), reinterpret_cast<uint8_t*>(code.InstructionStart()),
code.InstructionSize(), timer); code.InstructionSize(), timer);
@ -1336,8 +1337,9 @@ void Logger::CodeMoveEvent(AbstractCode from, AbstractCode to) {
namespace { namespace {
void CodeLinePosEvent(JitLogger* jit_logger, Address code_start, void CodeLinePosEvent(
SourcePositionTableIterator& iter) { JitLogger* jit_logger, Address code_start,
SourcePositionTableIterator& iter) { // NOLINT(runtime/references)
if (jit_logger) { if (jit_logger) {
void* jit_handler_data = jit_logger->StartCodePosInfoEvent(); void* jit_handler_data = jit_logger->StartCodePosInfoEvent();
for (; !iter.done(); iter.Advance()) { for (; !iter.done(); iter.Advance()) {
@ -1415,9 +1417,10 @@ void Logger::SuspectReadEvent(Name name, Object obj) {
} }
namespace { namespace {
void AppendFunctionMessage(Log::MessageBuilder& msg, const char* reason, void AppendFunctionMessage(
int script_id, double time_delta, int start_position, Log::MessageBuilder& msg, // NOLINT(runtime/references)
int end_position, base::ElapsedTimer* timer) { const char* reason, int script_id, double time_delta, int start_position,
int end_position, base::ElapsedTimer* timer) {
msg << "function" << Logger::kNext << reason << Logger::kNext << script_id msg << "function" << Logger::kNext << reason << Logger::kNext << script_id
<< Logger::kNext << start_position << Logger::kNext << end_position << Logger::kNext << start_position << Logger::kNext << end_position
<< Logger::kNext << time_delta << Logger::kNext << Logger::kNext << time_delta << Logger::kNext

View File

@ -565,6 +565,7 @@ class FeedbackMetadata : public HeapObject {
// Verify that an empty hash field looks like a tagged object, but can't // Verify that an empty hash field looks like a tagged object, but can't
// possibly be confused with a pointer. // possibly be confused with a pointer.
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((Name::kEmptyHashField & kHeapObjectTag) == kHeapObjectTag); STATIC_ASSERT((Name::kEmptyHashField & kHeapObjectTag) == kHeapObjectTag);
STATIC_ASSERT(Name::kEmptyHashField == 0x3); STATIC_ASSERT(Name::kEmptyHashField == 0x3);
// Verify that a set hash field will not look like a tagged object. // Verify that a set hash field will not look like a tagged object.

View File

@ -34,11 +34,16 @@ enum StringRepresentationTag {
}; };
const uint32_t kIsIndirectStringMask = 1 << 0; const uint32_t kIsIndirectStringMask = 1 << 0;
const uint32_t kIsIndirectStringTag = 1 << 0; const uint32_t kIsIndirectStringTag = 1 << 0;
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); STATIC_ASSERT((kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((kSlicedStringTag & kIsIndirectStringMask) == STATIC_ASSERT((kSlicedStringTag & kIsIndirectStringMask) ==
kIsIndirectStringTag); kIsIndirectStringTag);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((kThinStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); STATIC_ASSERT((kThinStringTag & kIsIndirectStringMask) == kIsIndirectStringTag);
// For strings, bit 3 indicates whether the string consists of two-byte // For strings, bit 3 indicates whether the string consists of two-byte
@ -377,6 +382,7 @@ enum InstanceType : uint16_t {
constexpr InstanceType LAST_STRING_TYPE = constexpr InstanceType LAST_STRING_TYPE =
static_cast<InstanceType>(FIRST_NONSTRING_TYPE - 1); static_cast<InstanceType>(FIRST_NONSTRING_TYPE - 1);
// NOLINTNEXTLINE(runtime/references) (false positive)
STATIC_ASSERT((FIRST_NONSTRING_TYPE & kIsNotStringMask) != kStringTag); STATIC_ASSERT((FIRST_NONSTRING_TYPE & kIsNotStringMask) != kStringTag);
STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType);
STATIC_ASSERT(JS_API_OBJECT_TYPE == Internals::kJSApiObjectType); STATIC_ASSERT(JS_API_OBJECT_TYPE == Internals::kJSApiObjectType);

View File

@ -938,7 +938,7 @@ icu::Calendar* CreateCalendar(Isolate* isolate, const icu::Locale& icu_locale,
std::unique_ptr<icu::SimpleDateFormat> CreateICUDateFormat( std::unique_ptr<icu::SimpleDateFormat> CreateICUDateFormat(
const icu::Locale& icu_locale, const icu::UnicodeString& skeleton, const icu::Locale& icu_locale, const icu::UnicodeString& skeleton,
icu::DateTimePatternGenerator& generator) { icu::DateTimePatternGenerator& generator) { // NOLINT(runtime/references)
// See https://github.com/tc39/ecma402/issues/225 . The best pattern // See https://github.com/tc39/ecma402/issues/225 . The best pattern
// generation needs to be done in the base locale according to the // generation needs to be done in the base locale according to the
// current spec however odd it may be. See also crbug.com/826549 . // current spec however odd it may be. See also crbug.com/826549 .
@ -968,9 +968,9 @@ std::unique_ptr<icu::SimpleDateFormat> CreateICUDateFormat(
class DateFormatCache { class DateFormatCache {
public: public:
icu::SimpleDateFormat* Create(const icu::Locale& icu_locale, icu::SimpleDateFormat* Create(
const icu::UnicodeString& skeleton, const icu::Locale& icu_locale, const icu::UnicodeString& skeleton,
icu::DateTimePatternGenerator& generator) { icu::DateTimePatternGenerator& generator) { // NOLINT(runtime/references)
std::string key; std::string key;
skeleton.toUTF8String<std::string>(key); skeleton.toUTF8String<std::string>(key);
key += ":"; key += ":";
@ -999,7 +999,7 @@ class DateFormatCache {
std::unique_ptr<icu::SimpleDateFormat> CreateICUDateFormatFromCache( std::unique_ptr<icu::SimpleDateFormat> CreateICUDateFormatFromCache(
const icu::Locale& icu_locale, const icu::UnicodeString& skeleton, const icu::Locale& icu_locale, const icu::UnicodeString& skeleton,
icu::DateTimePatternGenerator& generator) { icu::DateTimePatternGenerator& generator) { // NOLINT(runtime/references)
static base::LazyInstance<DateFormatCache>::type cache = static base::LazyInstance<DateFormatCache>::type cache =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
return std::unique_ptr<icu::SimpleDateFormat>( return std::unique_ptr<icu::SimpleDateFormat>(
@ -1135,7 +1135,8 @@ icu::UnicodeString ReplaceSkeleton(const icu::UnicodeString input,
std::unique_ptr<icu::SimpleDateFormat> DateTimeStylePattern( std::unique_ptr<icu::SimpleDateFormat> DateTimeStylePattern(
JSDateTimeFormat::DateTimeStyle date_style, JSDateTimeFormat::DateTimeStyle date_style,
JSDateTimeFormat::DateTimeStyle time_style, const icu::Locale& icu_locale, JSDateTimeFormat::DateTimeStyle time_style, const icu::Locale& icu_locale,
Intl::HourCycle hc, icu::DateTimePatternGenerator& generator) { Intl::HourCycle hc,
icu::DateTimePatternGenerator& generator) { // NOLINT(runtime/references)
std::unique_ptr<icu::SimpleDateFormat> result; std::unique_ptr<icu::SimpleDateFormat> result;
if (date_style != JSDateTimeFormat::DateTimeStyle::kUndefined) { if (date_style != JSDateTimeFormat::DateTimeStyle::kUndefined) {
if (time_style != JSDateTimeFormat::DateTimeStyle::kUndefined) { if (time_style != JSDateTimeFormat::DateTimeStyle::kUndefined) {

View File

@ -1093,7 +1093,8 @@ Maybe<bool> SetPropertyWithInterceptorInternal(
Maybe<bool> DefinePropertyWithInterceptorInternal( Maybe<bool> DefinePropertyWithInterceptorInternal(
LookupIterator* it, Handle<InterceptorInfo> interceptor, LookupIterator* it, Handle<InterceptorInfo> interceptor,
Maybe<ShouldThrow> should_throw, PropertyDescriptor& desc) { Maybe<ShouldThrow> should_throw,
PropertyDescriptor& desc) { // NOLINT(runtime/references)
Isolate* isolate = it->isolate(); Isolate* isolate = it->isolate();
// Make sure that the top context does not change when doing callbacks or // Make sure that the top context does not change when doing callbacks or
// interceptor calls. // interceptor calls.

View File

@ -1644,11 +1644,11 @@ class PreParser : public ParserBase<PreParser> {
return PreParserStatement::Jump(); return PreParserStatement::Jump();
} }
V8_INLINE void AddFormalParameter(PreParserFormalParameters* parameters, V8_INLINE void AddFormalParameter(
PreParserExpression& pattern, PreParserFormalParameters* parameters,
const PreParserExpression& initializer, PreParserExpression& pattern, // NOLINT(runtime/references)
int initializer_end_position, const PreParserExpression& initializer, int initializer_end_position,
bool is_rest) { bool is_rest) {
DeclarationScope* scope = parameters->scope; DeclarationScope* scope = parameters->scope;
scope->RecordParameter(is_rest); scope->RecordParameter(is_rest);
parameters->UpdateArityAndFunctionLength(!initializer.IsNull(), is_rest); parameters->UpdateArityAndFunctionLength(!initializer.IsNull(), is_rest);

View File

@ -31,7 +31,8 @@ V8_INLINE constexpr bool operator<(RootIndex lhs, RootIndex rhs) {
return static_cast<type>(lhs) < static_cast<type>(rhs); return static_cast<type>(lhs) < static_cast<type>(rhs);
} }
V8_INLINE RootIndex operator++(RootIndex& index) { V8_INLINE RootIndex
operator++(RootIndex& index) { // NOLINT(runtime/references)
using type = typename std::underlying_type<RootIndex>::type; using type = typename std::underlying_type<RootIndex>::type;
index = static_cast<RootIndex>(static_cast<type>(index) + 1); index = static_cast<RootIndex>(static_cast<type>(index) + 1);
return index; return index;

View File

@ -150,8 +150,9 @@ inline void SetHomeObject(Isolate* isolate, JSFunction method,
// shared name. // shared name.
template <typename Dictionary> template <typename Dictionary>
MaybeHandle<Object> GetMethodAndSetHomeObjectAndName( MaybeHandle<Object> GetMethodAndSetHomeObjectAndName(
Isolate* isolate, Arguments& args, Smi index, Handle<JSObject> home_object, Isolate* isolate, Arguments& args, // NOLINT(runtime/references)
Handle<String> name_prefix, Handle<Object> key) { Smi index, Handle<JSObject> home_object, Handle<String> name_prefix,
Handle<Object> key) {
int int_index = index.value(); int int_index = index.value();
// Class constructor and prototype values do not require post processing. // Class constructor and prototype values do not require post processing.
@ -185,9 +186,10 @@ MaybeHandle<Object> GetMethodAndSetHomeObjectAndName(
// This is a simplified version of GetMethodWithSharedNameAndSetHomeObject() // This is a simplified version of GetMethodWithSharedNameAndSetHomeObject()
// function above that is used when it's guaranteed that the method has // function above that is used when it's guaranteed that the method has
// shared name. // shared name.
Object GetMethodWithSharedNameAndSetHomeObject(Isolate* isolate, Object GetMethodWithSharedNameAndSetHomeObject(
Arguments& args, Object index, Isolate* isolate,
JSObject home_object) { Arguments& args, // NOLINT(runtime/references)
Object index, JSObject home_object) {
DisallowHeapAllocation no_gc; DisallowHeapAllocation no_gc;
int int_index = Smi::ToInt(index); int int_index = Smi::ToInt(index);
@ -226,7 +228,8 @@ Handle<Dictionary> ShallowCopyDictionaryTemplate(
template <typename Dictionary> template <typename Dictionary>
bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary, bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary,
Handle<JSObject> receiver, Arguments& args, Handle<JSObject> receiver,
Arguments& args, // NOLINT(runtime/references)
bool* install_name_accessor = nullptr) { bool* install_name_accessor = nullptr) {
Handle<Name> name_string = isolate->factory()->name_string(); Handle<Name> name_string = isolate->factory()->name_string();
@ -284,7 +287,7 @@ bool AddDescriptorsByTemplate(
Isolate* isolate, Handle<Map> map, Isolate* isolate, Handle<Map> map,
Handle<DescriptorArray> descriptors_template, Handle<DescriptorArray> descriptors_template,
Handle<NumberDictionary> elements_dictionary_template, Handle<NumberDictionary> elements_dictionary_template,
Handle<JSObject> receiver, Arguments& args) { Handle<JSObject> receiver, Arguments& args) { // NOLINT(runtime/references)
int nof_descriptors = descriptors_template->number_of_descriptors(); int nof_descriptors = descriptors_template->number_of_descriptors();
Handle<DescriptorArray> descriptors = Handle<DescriptorArray> descriptors =
@ -391,7 +394,8 @@ bool AddDescriptorsByTemplate(
Handle<NameDictionary> properties_dictionary_template, Handle<NameDictionary> properties_dictionary_template,
Handle<NumberDictionary> elements_dictionary_template, Handle<NumberDictionary> elements_dictionary_template,
Handle<FixedArray> computed_properties, Handle<JSObject> receiver, Handle<FixedArray> computed_properties, Handle<JSObject> receiver,
bool install_name_accessor, Arguments& args) { bool install_name_accessor,
Arguments& args) { // NOLINT(runtime/references)
int computed_properties_length = computed_properties->length(); int computed_properties_length = computed_properties->length();
// Shallow-copy properties template. // Shallow-copy properties template.
@ -476,7 +480,8 @@ bool InitClassPrototype(Isolate* isolate,
Handle<ClassBoilerplate> class_boilerplate, Handle<ClassBoilerplate> class_boilerplate,
Handle<JSObject> prototype, Handle<JSObject> prototype,
Handle<HeapObject> prototype_parent, Handle<HeapObject> prototype_parent,
Handle<JSFunction> constructor, Arguments& args) { Handle<JSFunction> constructor,
Arguments& args) { // NOLINT(runtime/references)
Handle<Map> map(prototype->map(), isolate); Handle<Map> map(prototype->map(), isolate);
map = Map::CopyDropDescriptors(isolate, map); map = Map::CopyDropDescriptors(isolate, map);
map->set_is_prototype_map(true); map->set_is_prototype_map(true);
@ -523,7 +528,8 @@ bool InitClassPrototype(Isolate* isolate,
bool InitClassConstructor(Isolate* isolate, bool InitClassConstructor(Isolate* isolate,
Handle<ClassBoilerplate> class_boilerplate, Handle<ClassBoilerplate> class_boilerplate,
Handle<HeapObject> constructor_parent, Handle<HeapObject> constructor_parent,
Handle<JSFunction> constructor, Arguments& args) { Handle<JSFunction> constructor,
Arguments& args) { // NOLINT(runtime/references)
Handle<Map> map(constructor->map(), isolate); Handle<Map> map(constructor->map(), isolate);
map = Map::CopyDropDescriptors(isolate, map); map = Map::CopyDropDescriptors(isolate, map);
DCHECK(map->is_prototype_map()); DCHECK(map->is_prototype_map());
@ -572,11 +578,10 @@ bool InitClassConstructor(Isolate* isolate,
} }
} }
MaybeHandle<Object> DefineClass(Isolate* isolate, MaybeHandle<Object> DefineClass(
Handle<ClassBoilerplate> class_boilerplate, Isolate* isolate, Handle<ClassBoilerplate> class_boilerplate,
Handle<Object> super_class, Handle<Object> super_class, Handle<JSFunction> constructor,
Handle<JSFunction> constructor, Arguments& args) { // NOLINT(runtime/references)
Arguments& args) {
Handle<Object> prototype_parent; Handle<Object> prototype_parent;
Handle<HeapObject> constructor_parent; Handle<HeapObject> constructor_parent;

View File

@ -26,7 +26,9 @@ namespace internal {
namespace { namespace {
void AdvanceToOffsetForTracing( void AdvanceToOffsetForTracing(
interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) { interpreter::BytecodeArrayIterator&
bytecode_iterator, // NOLINT(runtime/references)
int offset) {
while (bytecode_iterator.current_offset() + while (bytecode_iterator.current_offset() +
bytecode_iterator.current_bytecode_size() <= bytecode_iterator.current_bytecode_size() <=
offset) { offset) {
@ -39,7 +41,8 @@ void AdvanceToOffsetForTracing(
} }
void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input, void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input,
interpreter::BytecodeArrayIterator& bytecode_iterator, interpreter::BytecodeArrayIterator&
bytecode_iterator, // NOLINT(runtime/references)
Handle<Object> accumulator) { Handle<Object> accumulator) {
static const char kAccumulator[] = "accumulator"; static const char kAccumulator[] = "accumulator";
static const int kRegFieldWidth = static_cast<int>(sizeof(kAccumulator) - 1); static const int kRegFieldWidth = static_cast<int>(sizeof(kAccumulator) - 1);

View File

@ -53,7 +53,7 @@ JsonValue ReadMessage() {
return ParseJson(content).value; return ParseJson(content).value;
} }
void WriteMessage(JsonValue& message) { void WriteMessage(JsonValue& message) { // NOLINT(runtime/references)
std::string content = SerializeToString(message); std::string content = SerializeToString(message);
Logger::Log("[outgoing] ", content, "\n\n"); Logger::Log("[outgoing] ", content, "\n\n");
@ -330,7 +330,8 @@ void HandleDocumentSymbolRequest(DocumentSymbolRequest request,
} // namespace } // namespace
void HandleMessage(JsonValue& raw_message, MessageWriter writer) { void HandleMessage(JsonValue& raw_message, // NOLINT(runtime/references)
MessageWriter writer) {
Request<bool> request(raw_message); Request<bool> request(raw_message);
// We ignore responses for now. They are matched to requests // We ignore responses for now. They are matched to requests

View File

@ -26,7 +26,9 @@ namespace ls {
// To allow unit testing, the "sending" function is configurable. // To allow unit testing, the "sending" function is configurable.
using MessageWriter = std::function<void(JsonValue&)>; using MessageWriter = std::function<void(JsonValue&)>;
V8_EXPORT_PRIVATE void HandleMessage(JsonValue& raw_message, MessageWriter); V8_EXPORT_PRIVATE void HandleMessage(
JsonValue& raw_message, // NOLINT(runtime/references)
MessageWriter);
// Called when a compilation run finishes. Exposed for testability. // Called when a compilation run finishes. Exposed for testability.
V8_EXPORT_PRIVATE void CompilationFinished(TorqueCompilerResult result, V8_EXPORT_PRIVATE void CompilationFinished(TorqueCompilerResult result,

View File

@ -14,7 +14,7 @@ namespace torque {
namespace ls { namespace ls {
JsonValue ReadMessage(); JsonValue ReadMessage();
void WriteMessage(JsonValue& message); void WriteMessage(JsonValue& message); // NOLINT(runtime/references)
} // namespace ls } // namespace ls
} // namespace torque } // namespace torque

View File

@ -391,7 +391,8 @@ base::Optional<ParseResult> MakeImplicitParameterList(
return ParseResult{ImplicitParameters{kind, parameters}}; return ParseResult{ImplicitParameters{kind, parameters}};
} }
void AddParameter(ParameterList* parameter_list, NameAndTypeExpression& param) { void AddParameter(ParameterList* parameter_list,
NameAndTypeExpression& param) { // NOLINT(runtime/references)
if (!IsLowerCamelCase(param.name->value)) { if (!IsLowerCamelCase(param.name->value)) {
NamingConventionError("Parameter", param.name, "lowerCamelCase"); NamingConventionError("Parameter", param.name, "lowerCamelCase");
} }

View File

@ -416,7 +416,8 @@ class LiftoffCompiler {
DCHECK_EQ(__ num_locals(), __ cache_state()->stack_height()); DCHECK_EQ(__ num_locals(), __ cache_state()->stack_height());
} }
void GenerateOutOfLineCode(OutOfLineCode& ool) { void GenerateOutOfLineCode(
OutOfLineCode& ool) { // NOLINT(runtime/references)
__ bind(ool.label.get()); __ bind(ool.label.get());
const bool is_stack_check = ool.stub == WasmCode::kWasmStackGuard; const bool is_stack_check = ool.stub == WasmCode::kWasmStackGuard;
const bool is_mem_out_of_bounds = const bool is_mem_out_of_bounds =
@ -1245,8 +1246,9 @@ class LiftoffCompiler {
} }
} }
void SetLocalFromStackSlot(LiftoffAssembler::VarState& dst_slot, void SetLocalFromStackSlot(
uint32_t local_index) { LiftoffAssembler::VarState& dst_slot, // NOLINT(runtime/references)
uint32_t local_index) {
auto& state = *__ cache_state(); auto& state = *__ cache_state();
ValueType type = dst_slot.type(); ValueType type = dst_slot.type();
if (dst_slot.is_reg()) { if (dst_slot.is_reg()) {
@ -1297,8 +1299,10 @@ class LiftoffCompiler {
SetLocal(imm.index, true); SetLocal(imm.index, true);
} }
Register GetGlobalBaseAndOffset(const WasmGlobal* global, Register GetGlobalBaseAndOffset(
LiftoffRegList& pinned, uint32_t* offset) { const WasmGlobal* global,
LiftoffRegList& pinned, // NOLINT(runtime/references)
uint32_t* offset) {
Register addr = pinned.set(__ GetUnusedRegister(kGpReg)).gp(); Register addr = pinned.set(__ GetUnusedRegister(kGpReg)).gp();
if (global->mutability && global->imported) { if (global->mutability && global->imported) {
LOAD_INSTANCE_FIELD(addr, ImportedMutableGlobals, kSystemPointerSize); LOAD_INSTANCE_FIELD(addr, ImportedMutableGlobals, kSystemPointerSize);
@ -1340,13 +1344,15 @@ class LiftoffCompiler {
__ Store(addr, no_reg, offset, reg, type, {}, nullptr, true); __ Store(addr, no_reg, offset, reg, type, {}, nullptr, true);
} }
void GetTable(FullDecoder* decoder, const Value& index, Value* result, void GetTable(
TableIndexImmediate<validate>& imm) { FullDecoder* decoder, const Value& index, Value* result,
TableIndexImmediate<validate>& imm) { // NOLINT(runtime/references)
unsupported(decoder, kAnyRef, "table_get"); unsupported(decoder, kAnyRef, "table_get");
} }
void SetTable(FullDecoder* decoder, const Value& index, const Value& value, void SetTable(
TableIndexImmediate<validate>& imm) { FullDecoder* decoder, const Value& index, const Value& value,
TableIndexImmediate<validate>& imm) { // NOLINT(runtime/references)
unsupported(decoder, kAnyRef, "table_set"); unsupported(decoder, kAnyRef, "table_set");
} }
@ -1414,7 +1420,8 @@ class LiftoffCompiler {
// Generate a branch table case, potentially reusing previously generated // Generate a branch table case, potentially reusing previously generated
// stack transfer code. // stack transfer code.
void GenerateBrCase(FullDecoder* decoder, uint32_t br_depth, void GenerateBrCase(FullDecoder* decoder, uint32_t br_depth,
std::map<uint32_t, MovableLabel>& br_targets) { std::map<uint32_t, MovableLabel>&
br_targets) { // NOLINT(runtime/references)
MovableLabel& label = br_targets[br_depth]; MovableLabel& label = br_targets[br_depth];
if (label.get()->is_bound()) { if (label.get()->is_bound()) {
__ jmp(label.get()); __ jmp(label.get());
@ -1428,8 +1435,10 @@ class LiftoffCompiler {
// TODO(wasm): Generate a real branch table (like TF TableSwitch). // TODO(wasm): Generate a real branch table (like TF TableSwitch).
void GenerateBrTable(FullDecoder* decoder, LiftoffRegister tmp, void GenerateBrTable(FullDecoder* decoder, LiftoffRegister tmp,
LiftoffRegister value, uint32_t min, uint32_t max, LiftoffRegister value, uint32_t min, uint32_t max,
BranchTableIterator<validate>& table_iterator, BranchTableIterator<validate>&
std::map<uint32_t, MovableLabel>& br_targets) { table_iterator, // NOLINT(runtime/references)
std::map<uint32_t, MovableLabel>&
br_targets) { // NOLINT(runtime/references)
DCHECK_LT(min, max); DCHECK_LT(min, max);
// Check base case. // Check base case.
if (max == min + 1) { if (max == min + 1) {
@ -1636,8 +1645,9 @@ class LiftoffCompiler {
safepoint_table_builder_.DefineSafepoint(&asm_, Safepoint::kNoLazyDeopt); safepoint_table_builder_.DefineSafepoint(&asm_, Safepoint::kNoLazyDeopt);
} }
Register AddMemoryMasking(Register index, uint32_t* offset, Register AddMemoryMasking(
LiftoffRegList& pinned) { Register index, uint32_t* offset,
LiftoffRegList& pinned) { // NOLINT(runtime/references)
if (!FLAG_untrusted_code_mitigations || env_->use_trap_handler) { if (!FLAG_untrusted_code_mitigations || env_->use_trap_handler) {
return index; return index;
} }
@ -2037,7 +2047,9 @@ class LiftoffCompiler {
unsupported(decoder, kBulkMemory, "table.copy"); unsupported(decoder, kBulkMemory, "table.copy");
} }
void TableGrow(FullDecoder* decoder, const TableIndexImmediate<validate>& imm, void TableGrow(FullDecoder* decoder, const TableIndexImmediate<validate>& imm,
Value& value, Value& delta, Value* result) { Value& value, // NOLINT(runtime/references)
Value& delta, // NOLINT(runtime/references)
Value* result) {
unsupported(decoder, kAnyRef, "table.grow"); unsupported(decoder, kAnyRef, "table.grow");
} }
void TableSize(FullDecoder* decoder, const TableIndexImmediate<validate>& imm, void TableSize(FullDecoder* decoder, const TableIndexImmediate<validate>& imm,
@ -2045,7 +2057,8 @@ class LiftoffCompiler {
unsupported(decoder, kAnyRef, "table.size"); unsupported(decoder, kAnyRef, "table.size");
} }
void TableFill(FullDecoder* decoder, const TableIndexImmediate<validate>& imm, void TableFill(FullDecoder* decoder, const TableIndexImmediate<validate>& imm,
Value& start, Value& value, Value& count) { Value& start, Value& value, // NOLINT(runtime/references)
Value& count) { // NOLINT(runtime/references)
unsupported(decoder, kAnyRef, "table.fill"); unsupported(decoder, kAnyRef, "table.fill");
} }

View File

@ -1235,8 +1235,9 @@ void LiftoffAssembler::emit_i64_set_cond(Condition cond, Register dst,
namespace liftoff { namespace liftoff {
inline FPUCondition ConditionToConditionCmpFPU(bool& predicate, inline FPUCondition ConditionToConditionCmpFPU(
Condition condition) { bool& predicate, // NOLINT(runtime/references)
Condition condition) {
switch (condition) { switch (condition) {
case kEqual: case kEqual:
predicate = true; predicate = true;

View File

@ -1094,8 +1094,9 @@ void LiftoffAssembler::emit_i64_set_cond(Condition cond, Register dst,
namespace liftoff { namespace liftoff {
inline FPUCondition ConditionToConditionCmpFPU(bool& predicate, inline FPUCondition ConditionToConditionCmpFPU(
Condition condition) { bool& predicate, // NOLINT(runtime/references)
Condition condition) {
switch (condition) { switch (condition) {
case kEqual: case kEqual:
predicate = true; predicate = true;

View File

@ -45,7 +45,7 @@ namespace bin {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Encoding // Encoding
void encode_header(char*& ptr) { void encode_header(char*& ptr) { // NOLINT(runtime/references)
std::memcpy(ptr, std::memcpy(ptr,
"\x00" "\x00"
"asm\x01\x00\x00\x00", "asm\x01\x00\x00\x00",
@ -53,7 +53,8 @@ void encode_header(char*& ptr) {
ptr += 8; ptr += 8;
} }
void encode_size32(char*& ptr, size_t n) { void encode_size32(char*& ptr, // NOLINT(runtime/references)
size_t n) {
assert(n <= 0xffffffff); assert(n <= 0xffffffff);
for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) {
*ptr++ = (n & 0x7f) | (i == 4 ? 0x00 : 0x80); *ptr++ = (n & 0x7f) | (i == 4 ? 0x00 : 0x80);
@ -61,7 +62,8 @@ void encode_size32(char*& ptr, size_t n) {
} }
} }
void encode_valtype(char*& ptr, const ValType* type) { void encode_valtype(char*& ptr, // NOLINT(runtime/references)
const ValType* type) {
switch (type->kind()) { switch (type->kind()) {
case I32: case I32:
*ptr++ = 0x7f; *ptr++ = 0x7f;
@ -105,7 +107,8 @@ auto zero_size(const ValType* type) -> size_t {
} }
} }
void encode_const_zero(char*& ptr, const ValType* type) { void encode_const_zero(char*& ptr, // NOLINT(runtime/references)
const ValType* type) {
switch (type->kind()) { switch (type->kind()) {
case I32: case I32:
*ptr++ = 0x41; *ptr++ = 0x41;
@ -171,7 +174,7 @@ auto wrapper(const FuncType* type) -> vec<byte_t> {
// Numbers // Numbers
auto u32(const byte_t*& pos) -> uint32_t { auto u32(const byte_t*& pos) -> uint32_t { // NOLINT(runtime/references)
uint32_t n = 0; uint32_t n = 0;
uint32_t shift = 0; uint32_t shift = 0;
byte_t b; byte_t b;
@ -183,7 +186,7 @@ auto u32(const byte_t*& pos) -> uint32_t {
return n; return n;
} }
auto u64(const byte_t*& pos) -> uint64_t { auto u64(const byte_t*& pos) -> uint64_t { // NOLINT(runtime/references)
uint64_t n = 0; uint64_t n = 0;
uint64_t shift = 0; uint64_t shift = 0;
byte_t b; byte_t b;
@ -195,11 +198,13 @@ auto u64(const byte_t*& pos) -> uint64_t {
return n; return n;
} }
void u32_skip(const byte_t*& pos) { bin::u32(pos); } void u32_skip(const byte_t*& pos) { // NOLINT(runtime/references)
bin::u32(pos);
}
// Names // Names
auto name(const byte_t*& pos) -> Name { auto name(const byte_t*& pos) -> Name { // NOLINT(runtime/references)
auto size = bin::u32(pos); auto size = bin::u32(pos);
auto start = pos; auto start = pos;
auto name = Name::make_uninitialized(size); auto name = Name::make_uninitialized(size);
@ -210,7 +215,8 @@ auto name(const byte_t*& pos) -> Name {
// Types // Types
auto valtype(const byte_t*& pos) -> own<wasm::ValType*> { auto valtype(const byte_t*& pos) // NOLINT(runtime/references)
-> own<wasm::ValType*> {
switch (*pos++) { switch (*pos++) {
case i::wasm::kLocalI32: case i::wasm::kLocalI32:
return ValType::make(I32); return ValType::make(I32);
@ -231,11 +237,12 @@ auto valtype(const byte_t*& pos) -> own<wasm::ValType*> {
return {}; return {};
} }
auto mutability(const byte_t*& pos) -> Mutability { auto mutability(const byte_t*& pos) // NOLINT(runtime/references)
-> Mutability {
return *pos++ ? VAR : CONST; return *pos++ ? VAR : CONST;
} }
auto limits(const byte_t*& pos) -> Limits { auto limits(const byte_t*& pos) -> Limits { // NOLINT(runtime/references)
auto tag = *pos++; auto tag = *pos++;
auto min = bin::u32(pos); auto min = bin::u32(pos);
if ((tag & 0x01) == 0) { if ((tag & 0x01) == 0) {
@ -246,14 +253,16 @@ auto limits(const byte_t*& pos) -> Limits {
} }
} }
auto stacktype(const byte_t*& pos) -> vec<ValType*> { auto stacktype(const byte_t*& pos) // NOLINT(runtime/references)
-> vec<ValType*> {
size_t size = bin::u32(pos); size_t size = bin::u32(pos);
auto v = vec<ValType*>::make_uninitialized(size); auto v = vec<ValType*>::make_uninitialized(size);
for (uint32_t i = 0; i < size; ++i) v[i] = bin::valtype(pos); for (uint32_t i = 0; i < size; ++i) v[i] = bin::valtype(pos);
return v; return v;
} }
auto functype(const byte_t*& pos) -> own<FuncType*> { auto functype(const byte_t*& pos) // NOLINT(runtime/references)
-> own<FuncType*> {
assert(*pos == i::wasm::kWasmFunctionTypeCode); assert(*pos == i::wasm::kWasmFunctionTypeCode);
++pos; ++pos;
auto params = bin::stacktype(pos); auto params = bin::stacktype(pos);
@ -261,26 +270,29 @@ auto functype(const byte_t*& pos) -> own<FuncType*> {
return FuncType::make(std::move(params), std::move(results)); return FuncType::make(std::move(params), std::move(results));
} }
auto globaltype(const byte_t*& pos) -> own<GlobalType*> { auto globaltype(const byte_t*& pos) // NOLINT(runtime/references)
-> own<GlobalType*> {
auto content = bin::valtype(pos); auto content = bin::valtype(pos);
auto mutability = bin::mutability(pos); auto mutability = bin::mutability(pos);
return GlobalType::make(std::move(content), mutability); return GlobalType::make(std::move(content), mutability);
} }
auto tabletype(const byte_t*& pos) -> own<TableType*> { auto tabletype(const byte_t*& pos) // NOLINT(runtime/references)
-> own<TableType*> {
auto elem = bin::valtype(pos); auto elem = bin::valtype(pos);
auto limits = bin::limits(pos); auto limits = bin::limits(pos);
return TableType::make(std::move(elem), limits); return TableType::make(std::move(elem), limits);
} }
auto memorytype(const byte_t*& pos) -> own<MemoryType*> { auto memorytype(const byte_t*& pos) // NOLINT(runtime/references)
-> own<MemoryType*> {
auto limits = bin::limits(pos); auto limits = bin::limits(pos);
return MemoryType::make(limits); return MemoryType::make(limits);
} }
// Expressions // Expressions
void expr_skip(const byte_t*& pos) { void expr_skip(const byte_t*& pos) { // NOLINT(runtime/references)
switch (*pos++) { switch (*pos++) {
case i::wasm::kExprI32Const: case i::wasm::kExprI32Const:
case i::wasm::kExprI64Const: case i::wasm::kExprI64Const:
@ -842,7 +854,8 @@ struct FuncTypeImpl : ExternTypeImpl {
vec<ValType*> params; vec<ValType*> params;
vec<ValType*> results; vec<ValType*> results;
FuncTypeImpl(vec<ValType*>& params, vec<ValType*>& results) FuncTypeImpl(vec<ValType*>& params, // NOLINT(runtime/references)
vec<ValType*>& results) // NOLINT(runtime/references)
: ExternTypeImpl(EXTERN_FUNC), : ExternTypeImpl(EXTERN_FUNC),
params(std::move(params)), params(std::move(params)),
results(std::move(results)) {} results(std::move(results)) {}
@ -895,7 +908,8 @@ struct GlobalTypeImpl : ExternTypeImpl {
own<ValType*> content; own<ValType*> content;
Mutability mutability; Mutability mutability;
GlobalTypeImpl(own<ValType*>& content, Mutability mutability) GlobalTypeImpl(own<ValType*>& content, // NOLINT(runtime/references)
Mutability mutability)
: ExternTypeImpl(EXTERN_GLOBAL), : ExternTypeImpl(EXTERN_GLOBAL),
content(std::move(content)), content(std::move(content)),
mutability(mutability) {} mutability(mutability) {}
@ -947,7 +961,8 @@ struct TableTypeImpl : ExternTypeImpl {
own<ValType*> element; own<ValType*> element;
Limits limits; Limits limits;
TableTypeImpl(own<ValType*>& element, Limits limits) TableTypeImpl(own<ValType*>& element, // NOLINT(runtime/references)
Limits limits)
: ExternTypeImpl(EXTERN_TABLE), : ExternTypeImpl(EXTERN_TABLE),
element(std::move(element)), element(std::move(element)),
limits(limits) {} limits(limits) {}
@ -1039,7 +1054,9 @@ struct ImportTypeImpl {
Name name; Name name;
own<ExternType*> type; own<ExternType*> type;
ImportTypeImpl(Name& module, Name& name, own<ExternType*>& type) ImportTypeImpl(Name& module, // NOLINT(runtime/references)
Name& name, // NOLINT(runtime/references)
own<ExternType*>& type) // NOLINT(runtime/references)
: module(std::move(module)), : module(std::move(module)),
name(std::move(name)), name(std::move(name)),
type(std::move(type)) {} type(std::move(type)) {}
@ -1082,7 +1099,8 @@ struct ExportTypeImpl {
Name name; Name name;
own<ExternType*> type; own<ExternType*> type;
ExportTypeImpl(Name& name, own<ExternType*>& type) ExportTypeImpl(Name& name, // NOLINT(runtime/references)
own<ExternType*>& type) // NOLINT(runtime/references)
: name(std::move(name)), type(std::move(type)) {} : name(std::move(name)), type(std::move(type)) {}
~ExportTypeImpl() {} ~ExportTypeImpl() {}

View File

@ -45,7 +45,7 @@ BytecodeIterator::BytecodeIterator(const byte* start, const byte* end,
DecodeResult VerifyWasmCode(AccountingAllocator* allocator, DecodeResult VerifyWasmCode(AccountingAllocator* allocator,
const WasmFeatures& enabled, const WasmFeatures& enabled,
const WasmModule* module, WasmFeatures* detected, const WasmModule* module, WasmFeatures* detected,
FunctionBody& body) { FunctionBody& body) { // NOLINT(runtime/references)
Zone zone(allocator, ZONE_NAME); Zone zone(allocator, ZONE_NAME);
WasmFullDecoder<Decoder::kValidate, EmptyInterface> decoder( WasmFullDecoder<Decoder::kValidate, EmptyInterface> decoder(
&zone, module, enabled, detected, body); &zone, module, enabled, detected, body);

View File

@ -34,11 +34,10 @@ struct FunctionBody {
: sig(sig), offset(offset), start(start), end(end) {} : sig(sig), offset(offset), start(start), end(end) {}
}; };
V8_EXPORT_PRIVATE DecodeResult VerifyWasmCode(AccountingAllocator* allocator, V8_EXPORT_PRIVATE DecodeResult
const WasmFeatures& enabled, VerifyWasmCode(AccountingAllocator* allocator, const WasmFeatures& enabled,
const WasmModule* module, const WasmModule* module, WasmFeatures* detected,
WasmFeatures* detected, FunctionBody& body); // NOLINT(runtime/references)
FunctionBody& body);
enum PrintLocals { kPrintLocals, kOmitLocals }; enum PrintLocals { kPrintLocals, kOmitLocals };
V8_EXPORT_PRIVATE V8_EXPORT_PRIVATE

View File

@ -131,8 +131,8 @@ ValueType TypeOf(const WasmModule* module, const WasmInitExpr& expr) {
// Reads a length-prefixed string, checking that it is within bounds. Returns // Reads a length-prefixed string, checking that it is within bounds. Returns
// the offset of the string, and the length as an out parameter. // the offset of the string, and the length as an out parameter.
WireBytesRef consume_string(Decoder& decoder, bool validate_utf8, WireBytesRef consume_string(Decoder& decoder, // NOLINT(runtime/references)
const char* name) { bool validate_utf8, const char* name) {
uint32_t length = decoder.consume_u32v("string length"); uint32_t length = decoder.consume_u32v("string length");
uint32_t offset = decoder.pc_offset(); uint32_t offset = decoder.pc_offset();
const byte* string_start = decoder.pc(); const byte* string_start = decoder.pc();
@ -151,7 +151,7 @@ WireBytesRef consume_string(Decoder& decoder, bool validate_utf8,
// Automatically skips all unknown sections. // Automatically skips all unknown sections.
class WasmSectionIterator { class WasmSectionIterator {
public: public:
explicit WasmSectionIterator(Decoder& decoder) explicit WasmSectionIterator(Decoder& decoder) // NOLINT(runtime/references)
: decoder_(decoder), : decoder_(decoder),
section_code_(kUnknownSectionCode), section_code_(kUnknownSectionCode),
section_start_(decoder.pc()), section_start_(decoder.pc()),
@ -1389,7 +1389,9 @@ class ModuleDecoderImpl : public Decoder {
} }
template <typename T> template <typename T>
uint32_t consume_index(const char* name, std::vector<T>& vector, T** ptr) { uint32_t consume_index(const char* name,
std::vector<T>& vector, // NOLINT(runtime/references)
T** ptr) {
const byte* pos = pc_; const byte* pos = pc_;
uint32_t index = consume_u32v(name); uint32_t index = consume_u32v(name);
if (index >= vector.size()) { if (index >= vector.size()) {
@ -1985,7 +1987,7 @@ std::vector<CustomSectionOffset> DecodeCustomSections(const byte* start,
namespace { namespace {
bool FindNameSection(Decoder& decoder) { bool FindNameSection(Decoder& decoder) { // NOLINT(runtime/references)
static constexpr int kModuleHeaderSize = 8; static constexpr int kModuleHeaderSize = 8;
decoder.consume_bytes(kModuleHeaderSize, "module header"); decoder.consume_bytes(kModuleHeaderSize, "module header");

View File

@ -144,7 +144,9 @@ class ModuleDecoder {
// If a SectionCode other than kUnknownSectionCode is returned, the decoder // If a SectionCode other than kUnknownSectionCode is returned, the decoder
// will point right after the identifier string. Otherwise, the position is // will point right after the identifier string. Otherwise, the position is
// undefined. // undefined.
static SectionCode IdentifyUnknownSection(Decoder& decoder, const byte* end); static SectionCode IdentifyUnknownSection(
Decoder& decoder, // NOLINT(runtime/references)
const byte* end);
private: private:
const WasmFeatures enabled_features_; const WasmFeatures enabled_features_;

View File

@ -1663,7 +1663,8 @@ class ThreadImpl {
} }
template <typename ctype, typename mtype> template <typename ctype, typename mtype>
bool ExecuteLoad(Decoder* decoder, InterpreterCode* code, pc_t pc, int& len, bool ExecuteLoad(Decoder* decoder, InterpreterCode* code, pc_t pc,
int& len, // NOLINT(runtime/references)
MachineRepresentation rep) { MachineRepresentation rep) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc), MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc),
sizeof(ctype)); sizeof(ctype));
@ -1690,7 +1691,8 @@ class ThreadImpl {
} }
template <typename ctype, typename mtype> template <typename ctype, typename mtype>
bool ExecuteStore(Decoder* decoder, InterpreterCode* code, pc_t pc, int& len, bool ExecuteStore(Decoder* decoder, InterpreterCode* code, pc_t pc,
int& len, // NOLINT(runtime/references)
MachineRepresentation rep) { MachineRepresentation rep) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc), MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc),
sizeof(ctype)); sizeof(ctype));
@ -1735,7 +1737,8 @@ class ThreadImpl {
template <typename type, typename op_type> template <typename type, typename op_type>
bool ExtractAtomicOpParams(Decoder* decoder, InterpreterCode* code, bool ExtractAtomicOpParams(Decoder* decoder, InterpreterCode* code,
Address& address, pc_t pc, int& len, Address& address, // NOLINT(runtime/references)
pc_t pc, int& len, // NOLINT(runtime/references)
type* val = nullptr, type* val2 = nullptr) { type* val = nullptr, type* val2 = nullptr) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc + 1), MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc + 1),
sizeof(type)); sizeof(type));
@ -1752,7 +1755,8 @@ class ThreadImpl {
} }
bool ExecuteNumericOp(WasmOpcode opcode, Decoder* decoder, bool ExecuteNumericOp(WasmOpcode opcode, Decoder* decoder,
InterpreterCode* code, pc_t pc, int& len) { InterpreterCode* code, pc_t pc,
int& len) { // NOLINT(runtime/references)
switch (opcode) { switch (opcode) {
case kExprI32SConvertSatF32: case kExprI32SConvertSatF32:
Push(WasmValue(ExecuteConvertSaturate<int32_t>(Pop().to<float>()))); Push(WasmValue(ExecuteConvertSaturate<int32_t>(Pop().to<float>())));
@ -1916,7 +1920,8 @@ class ThreadImpl {
} }
bool ExecuteAtomicOp(WasmOpcode opcode, Decoder* decoder, bool ExecuteAtomicOp(WasmOpcode opcode, Decoder* decoder,
InterpreterCode* code, pc_t pc, int& len) { InterpreterCode* code, pc_t pc,
int& len) { // NOLINT(runtime/references)
#if V8_TARGET_BIG_ENDIAN #if V8_TARGET_BIG_ENDIAN
constexpr bool kBigEndian = true; constexpr bool kBigEndian = true;
#else #else
@ -2123,7 +2128,7 @@ class ThreadImpl {
} }
bool ExecuteSimdOp(WasmOpcode opcode, Decoder* decoder, InterpreterCode* code, bool ExecuteSimdOp(WasmOpcode opcode, Decoder* decoder, InterpreterCode* code,
pc_t pc, int& len) { pc_t pc, int& len) { // NOLINT(runtime/references)
switch (opcode) { switch (opcode) {
#define SPLAT_CASE(format, sType, valType, num) \ #define SPLAT_CASE(format, sType, valType, num) \
case kExpr##format##Splat: { \ case kExpr##format##Splat: { \

View File

@ -26,7 +26,8 @@ namespace {
// Emit a section code and the size as a padded varint that can be patched // Emit a section code and the size as a padded varint that can be patched
// later. // later.
size_t EmitSection(SectionCode code, ZoneBuffer& buffer) { size_t EmitSection(SectionCode code,
ZoneBuffer& buffer) { // NOLINT(runtime/references)
// Emit the section code. // Emit the section code.
buffer.write_u8(code); buffer.write_u8(code);
@ -35,7 +36,8 @@ size_t EmitSection(SectionCode code, ZoneBuffer& buffer) {
} }
// Patch the size of a section after it's finished. // Patch the size of a section after it's finished.
void FixupSection(ZoneBuffer& buffer, size_t start) { void FixupSection(ZoneBuffer& buffer, // NOLINT(runtime/references)
size_t start) {
buffer.patch_u32v(start, static_cast<uint32_t>(buffer.offset() - start - buffer.patch_u32v(start, static_cast<uint32_t>(buffer.offset() - start -
kPaddedVarInt32Size)); kPaddedVarInt32Size));
} }

View File

@ -187,9 +187,10 @@ class V8_EXPORT_PRIVATE WasmFunctionBuilder : public ZoneObject {
} }
void DeleteCodeAfter(size_t position); void DeleteCodeAfter(size_t position);
void WriteSignature(ZoneBuffer& buffer) const; void WriteSignature(ZoneBuffer& buffer) const; // NOLINT(runtime/references)
void WriteBody(ZoneBuffer& buffer) const; void WriteBody(ZoneBuffer& buffer) const; // NOLINT(runtime/references)
void WriteAsmWasmOffsetTable(ZoneBuffer& buffer) const; void WriteAsmWasmOffsetTable(
ZoneBuffer& buffer) const; // NOLINT(runtime/references)
WasmModuleBuilder* builder() const { return builder_; } WasmModuleBuilder* builder() const { return builder_; }
uint32_t func_index() { return func_index_; } uint32_t func_index() { return func_index_; }
@ -246,8 +247,9 @@ class V8_EXPORT_PRIVATE WasmModuleBuilder : public ZoneObject {
void SetHasSharedMemory(); void SetHasSharedMemory();
// Writing methods. // Writing methods.
void WriteTo(ZoneBuffer& buffer) const; void WriteTo(ZoneBuffer& buffer) const; // NOLINT(runtime/references)
void WriteAsmJsOffsetTable(ZoneBuffer& buffer) const; void WriteAsmJsOffsetTable(
ZoneBuffer& buffer) const; // NOLINT(runtime/references)
Zone* zone() { return zone_; } Zone* zone() { return zone_; }

View File

@ -18,8 +18,8 @@ namespace wasm {
namespace { namespace {
PRINTF_FORMAT(3, 0) PRINTF_FORMAT(3, 0)
void VPrintFToString(std::string& str, size_t str_offset, const char* format, void VPrintFToString(std::string& str, // NOLINT(runtime/references)
va_list args) { size_t str_offset, const char* format, va_list args) {
DCHECK_LE(str_offset, str.size()); DCHECK_LE(str_offset, str.size());
size_t len = str_offset + strlen(format); size_t len = str_offset + strlen(format);
// Allocate increasingly large buffers until the message fits. // Allocate increasingly large buffers until the message fits.
@ -39,8 +39,8 @@ void VPrintFToString(std::string& str, size_t str_offset, const char* format,
} }
PRINTF_FORMAT(3, 4) PRINTF_FORMAT(3, 4)
void PrintFToString(std::string& str, size_t str_offset, const char* format, void PrintFToString(std::string& str, // NOLINT(runtime/references)
...) { size_t str_offset, const char* format, ...) {
va_list args; va_list args;
va_start(args, format); va_start(args, format);
VPrintFToString(str, str_offset, format, args); VPrintFToString(str, str_offset, format, args);

View File

@ -47,7 +47,7 @@ class ZoneAllocator {
template <typename U> template <typename U>
friend class ZoneAllocator; friend class ZoneAllocator;
T* address(T& x) const { return &x; } T* address(T& x) const { return &x; } // NOLINT(runtime/references)
const T* address(const T& x) const { return &x; } const T* address(const T& x) const { return &x; }
T* allocate(size_t n, const void* hint = nullptr) { T* allocate(size_t n, const void* hint = nullptr) {

View File

@ -21,7 +21,8 @@ namespace {
using Label = CodeAssemblerLabel; using Label = CodeAssemblerLabel;
using Variable = CodeAssemblerVariable; using Variable = CodeAssemblerVariable;
Node* SmiTag(CodeAssembler& m, Node* value) { Node* SmiTag(CodeAssembler& m, // NOLINT(runtime/references)
Node* value) {
int32_t constant_value; int32_t constant_value;
if (m.ToInt32Constant(value, constant_value) && if (m.ToInt32Constant(value, constant_value) &&
Smi::IsValid(constant_value)) { Smi::IsValid(constant_value)) {
@ -30,22 +31,25 @@ Node* SmiTag(CodeAssembler& m, Node* value) {
return m.WordShl(value, m.IntPtrConstant(kSmiShiftSize + kSmiTagSize)); return m.WordShl(value, m.IntPtrConstant(kSmiShiftSize + kSmiTagSize));
} }
Node* UndefinedConstant(CodeAssembler& m) { Node* UndefinedConstant(CodeAssembler& m) { // NOLINT(runtime/references)
return m.LoadRoot(RootIndex::kUndefinedValue); return m.LoadRoot(RootIndex::kUndefinedValue);
} }
Node* SmiFromInt32(CodeAssembler& m, Node* value) { Node* SmiFromInt32(CodeAssembler& m, // NOLINT(runtime/references)
Node* value) {
value = m.ChangeInt32ToIntPtr(value); value = m.ChangeInt32ToIntPtr(value);
return m.BitcastWordToTaggedSigned( return m.BitcastWordToTaggedSigned(
m.WordShl(value, kSmiShiftSize + kSmiTagSize)); m.WordShl(value, kSmiShiftSize + kSmiTagSize));
} }
Node* LoadObjectField(CodeAssembler& m, Node* object, int offset, Node* LoadObjectField(CodeAssembler& m, // NOLINT(runtime/references)
Node* object, int offset,
MachineType type = MachineType::AnyTagged()) { MachineType type = MachineType::AnyTagged()) {
return m.Load(type, object, m.IntPtrConstant(offset - kHeapObjectTag)); return m.Load(type, object, m.IntPtrConstant(offset - kHeapObjectTag));
} }
Node* LoadMap(CodeAssembler& m, Node* object) { Node* LoadMap(CodeAssembler& m, // NOLINT(runtime/references)
Node* object) {
return LoadObjectField(m, object, JSObject::kMapOffset); return LoadObjectField(m, object, JSObject::kMapOffset);
} }
@ -131,7 +135,8 @@ TEST(SimpleTailCallRuntime2Arg) {
namespace { namespace {
Handle<JSFunction> CreateSumAllArgumentsFunction(FunctionTester& ft) { Handle<JSFunction> CreateSumAllArgumentsFunction(
FunctionTester& ft) { // NOLINT(runtime/references)
const char* source = const char* source =
"(function() {\n" "(function() {\n"
" var sum = 0 + this;\n" " var sum = 0 + this;\n"

View File

@ -109,8 +109,8 @@ class TestCode : public HandleAndZoneScope {
} }
}; };
void VerifyForwarding(TestCode& code, // NOLINT(runtime/references)
void VerifyForwarding(TestCode& code, int count, int* expected) { int count, int* expected) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone local_zone(&allocator, ZONE_NAME); Zone local_zone(&allocator, ZONE_NAME);
ZoneVector<RpoNumber> result(&local_zone); ZoneVector<RpoNumber> result(&local_zone);
@ -122,7 +122,6 @@ void VerifyForwarding(TestCode& code, int count, int* expected) {
} }
} }
TEST(FwEmpty1) { TEST(FwEmpty1) {
TestCode code; TestCode code;
@ -611,8 +610,8 @@ void RunPermutedDiamond(int* permutation, int size) {
TEST(FwPermuted_diamond) { RunAllPermutations<4>(RunPermutedDiamond); } TEST(FwPermuted_diamond) { RunAllPermutations<4>(RunPermutedDiamond); }
void ApplyForwarding(TestCode& code, // NOLINT(runtime/references)
void ApplyForwarding(TestCode& code, int size, int* forward) { int size, int* forward) {
code.sequence_.RecomputeAssemblyOrderForTesting(); code.sequence_.RecomputeAssemblyOrderForTesting();
ZoneVector<RpoNumber> vector(code.main_zone()); ZoneVector<RpoNumber> vector(code.main_zone());
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -621,8 +620,8 @@ void ApplyForwarding(TestCode& code, int size, int* forward) {
JumpThreading::ApplyForwarding(code.main_zone(), vector, &code.sequence_); JumpThreading::ApplyForwarding(code.main_zone(), vector, &code.sequence_);
} }
void CheckJump(TestCode& code, // NOLINT(runtime/references)
void CheckJump(TestCode& code, int pos, int target) { int pos, int target) {
Instruction* instr = code.sequence_.InstructionAt(pos); Instruction* instr = code.sequence_.InstructionAt(pos);
CHECK_EQ(kArchJmp, instr->arch_opcode()); CHECK_EQ(kArchJmp, instr->arch_opcode());
CHECK_EQ(1, static_cast<int>(instr->InputCount())); CHECK_EQ(1, static_cast<int>(instr->InputCount()));
@ -631,8 +630,8 @@ void CheckJump(TestCode& code, int pos, int target) {
CHECK_EQ(target, code.sequence_.InputRpo(instr, 0).ToInt()); CHECK_EQ(target, code.sequence_.InputRpo(instr, 0).ToInt());
} }
void CheckNop(TestCode& code, // NOLINT(runtime/references)
void CheckNop(TestCode& code, int pos) { int pos) {
Instruction* instr = code.sequence_.InstructionAt(pos); Instruction* instr = code.sequence_.InstructionAt(pos);
CHECK_EQ(kArchNop, instr->arch_opcode()); CHECK_EQ(kArchNop, instr->arch_opcode());
CHECK_EQ(0, static_cast<int>(instr->InputCount())); CHECK_EQ(0, static_cast<int>(instr->InputCount()));
@ -640,8 +639,8 @@ void CheckNop(TestCode& code, int pos) {
CHECK_EQ(0, static_cast<int>(instr->TempCount())); CHECK_EQ(0, static_cast<int>(instr->TempCount()));
} }
void CheckBranch(TestCode& code, // NOLINT(runtime/references)
void CheckBranch(TestCode& code, int pos, int t1, int t2) { int pos, int t1, int t2) {
Instruction* instr = code.sequence_.InstructionAt(pos); Instruction* instr = code.sequence_.InstructionAt(pos);
CHECK_EQ(2, static_cast<int>(instr->InputCount())); CHECK_EQ(2, static_cast<int>(instr->InputCount()));
CHECK_EQ(0, static_cast<int>(instr->OutputCount())); CHECK_EQ(0, static_cast<int>(instr->OutputCount()));
@ -650,15 +649,14 @@ void CheckBranch(TestCode& code, int pos, int t1, int t2) {
CHECK_EQ(t2, code.sequence_.InputRpo(instr, 1).ToInt()); CHECK_EQ(t2, code.sequence_.InputRpo(instr, 1).ToInt());
} }
void CheckAssemblyOrder(TestCode& code, // NOLINT(runtime/references)
void CheckAssemblyOrder(TestCode& code, int size, int* expected) { int size, int* expected) {
int i = 0; int i = 0;
for (auto const block : code.sequence_.instruction_blocks()) { for (auto const block : code.sequence_.instruction_blocks()) {
CHECK_EQ(expected[i++], block->ao_number().ToInt()); CHECK_EQ(expected[i++], block->ao_number().ToInt());
} }
} }
TEST(Rewire1) { TEST(Rewire1) {
TestCode code; TestCode code;

View File

@ -199,7 +199,7 @@ struct While {
} }
void chain(Node* control) { loop->ReplaceInput(0, control); } void chain(Node* control) { loop->ReplaceInput(0, control); }
void nest(While& that) { void nest(While& that) { // NOLINT(runtime/references)
that.loop->ReplaceInput(1, exit); that.loop->ReplaceInput(1, exit);
this->loop->ReplaceInput(0, that.if_true); this->loop->ReplaceInput(0, that.if_true);
} }
@ -212,7 +212,8 @@ struct Counter {
Node* phi; Node* phi;
Node* add; Node* add;
Counter(While& w, int32_t b, int32_t k) Counter(While& w, // NOLINT(runtime/references)
int32_t b, int32_t k)
: base(w.t.jsgraph.Int32Constant(b)), inc(w.t.jsgraph.Int32Constant(k)) { : base(w.t.jsgraph.Int32Constant(b)), inc(w.t.jsgraph.Int32Constant(k)) {
Build(w); Build(w);
} }
@ -233,7 +234,7 @@ struct StoreLoop {
Node* phi; Node* phi;
Node* store; Node* store;
explicit StoreLoop(While& w) explicit StoreLoop(While& w) // NOLINT(runtime/references)
: base(w.t.graph.start()), val(w.t.jsgraph.Int32Constant(13)) { : base(w.t.graph.start()), val(w.t.jsgraph.Int32Constant(13)) {
Build(w); Build(w);
} }

View File

@ -43,7 +43,8 @@ CallDescriptor* CreateCallDescriptor(Zone* zone, int return_count,
return compiler::GetWasmCallDescriptor(zone, builder.Build()); return compiler::GetWasmCallDescriptor(zone, builder.Build());
} }
Node* MakeConstant(RawMachineAssembler& m, MachineType type, int value) { Node* MakeConstant(RawMachineAssembler& m, // NOLINT(runtime/references)
MachineType type, int value) {
switch (type.representation()) { switch (type.representation()) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
return m.Int32Constant(static_cast<int32_t>(value)); return m.Int32Constant(static_cast<int32_t>(value));
@ -58,7 +59,8 @@ Node* MakeConstant(RawMachineAssembler& m, MachineType type, int value) {
} }
} }
Node* Add(RawMachineAssembler& m, MachineType type, Node* a, Node* b) { Node* Add(RawMachineAssembler& m, // NOLINT(runtime/references)
MachineType type, Node* a, Node* b) {
switch (type.representation()) { switch (type.representation()) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
return m.Int32Add(a, b); return m.Int32Add(a, b);
@ -73,7 +75,8 @@ Node* Add(RawMachineAssembler& m, MachineType type, Node* a, Node* b) {
} }
} }
Node* Sub(RawMachineAssembler& m, MachineType type, Node* a, Node* b) { Node* Sub(RawMachineAssembler& m, // NOLINT(runtime/references)
MachineType type, Node* a, Node* b) {
switch (type.representation()) { switch (type.representation()) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
return m.Int32Sub(a, b); return m.Int32Sub(a, b);
@ -88,7 +91,8 @@ Node* Sub(RawMachineAssembler& m, MachineType type, Node* a, Node* b) {
} }
} }
Node* Mul(RawMachineAssembler& m, MachineType type, Node* a, Node* b) { Node* Mul(RawMachineAssembler& m, // NOLINT(runtime/references)
MachineType type, Node* a, Node* b) {
switch (type.representation()) { switch (type.representation()) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
return m.Int32Mul(a, b); return m.Int32Mul(a, b);
@ -103,7 +107,8 @@ Node* Mul(RawMachineAssembler& m, MachineType type, Node* a, Node* b) {
} }
} }
Node* ToInt32(RawMachineAssembler& m, MachineType type, Node* a) { Node* ToInt32(RawMachineAssembler& m, // NOLINT(runtime/references)
MachineType type, Node* a) {
switch (type.representation()) { switch (type.representation()) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
return a; return a;

View File

@ -327,28 +327,34 @@ class ArgsBuffer {
return kTypes; return kTypes;
} }
Node* MakeConstant(RawMachineAssembler& raw, int32_t value) { Node* MakeConstant(RawMachineAssembler& raw, // NOLINT(runtime/references)
int32_t value) {
return raw.Int32Constant(value); return raw.Int32Constant(value);
} }
Node* MakeConstant(RawMachineAssembler& raw, int64_t value) { Node* MakeConstant(RawMachineAssembler& raw, // NOLINT(runtime/references)
int64_t value) {
return raw.Int64Constant(value); return raw.Int64Constant(value);
} }
Node* MakeConstant(RawMachineAssembler& raw, float32 value) { Node* MakeConstant(RawMachineAssembler& raw, // NOLINT(runtime/references)
float32 value) {
return raw.Float32Constant(value); return raw.Float32Constant(value);
} }
Node* MakeConstant(RawMachineAssembler& raw, float64 value) { Node* MakeConstant(RawMachineAssembler& raw, // NOLINT(runtime/references)
float64 value) {
return raw.Float64Constant(value); return raw.Float64Constant(value);
} }
Node* LoadInput(RawMachineAssembler& raw, Node* base, int index) { Node* LoadInput(RawMachineAssembler& raw, // NOLINT(runtime/references)
Node* base, int index) {
Node* offset = raw.Int32Constant(index * sizeof(CType)); Node* offset = raw.Int32Constant(index * sizeof(CType));
return raw.Load(MachineTypeForC<CType>(), base, offset); return raw.Load(MachineTypeForC<CType>(), base, offset);
} }
Node* StoreOutput(RawMachineAssembler& raw, Node* value) { Node* StoreOutput(RawMachineAssembler& raw, // NOLINT(runtime/references)
Node* value) {
Node* base = raw.PointerConstant(&output); Node* base = raw.PointerConstant(&output);
Node* offset = raw.Int32Constant(0); Node* offset = raw.Int32Constant(0);
return raw.Store(MachineTypeForC<CType>().representation(), base, offset, return raw.Store(MachineTypeForC<CType>().representation(), base, offset,
@ -710,9 +716,9 @@ static uint32_t coeff[] = {1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73,
79, 83, 89, 97, 101, 103, 107, 109, 113}; 79, 83, 89, 97, 101, 103, 107, 109, 113};
static void Build_Int32_WeightedSum(
static void Build_Int32_WeightedSum(CallDescriptor* desc, CallDescriptor* desc,
RawMachineAssembler& raw) { RawMachineAssembler& raw) { // NOLINT(runtime/references)
Node* result = raw.Int32Constant(0); Node* result = raw.Int32Constant(0);
for (int i = 0; i < ParamCount(desc); i++) { for (int i = 0; i < ParamCount(desc); i++) {
Node* term = raw.Int32Mul(raw.Parameter(i), raw.Int32Constant(coeff[i])); Node* term = raw.Int32Mul(raw.Parameter(i), raw.Int32Constant(coeff[i]));
@ -721,7 +727,6 @@ static void Build_Int32_WeightedSum(CallDescriptor* desc,
raw.Return(result); raw.Return(result);
} }
static int32_t Compute_Int32_WeightedSum(CallDescriptor* desc, int32_t* input) { static int32_t Compute_Int32_WeightedSum(CallDescriptor* desc, int32_t* input) {
uint32_t result = 0; uint32_t result = 0;
for (int i = 0; i < ParamCount(desc); i++) { for (int i = 0; i < ParamCount(desc); i++) {
@ -767,13 +772,13 @@ TEST_INT32_WEIGHTEDSUM(11)
TEST_INT32_WEIGHTEDSUM(17) TEST_INT32_WEIGHTEDSUM(17)
TEST_INT32_WEIGHTEDSUM(19) TEST_INT32_WEIGHTEDSUM(19)
template <int which> template <int which>
static void Build_Select(CallDescriptor* desc, RawMachineAssembler& raw) { static void Build_Select(
CallDescriptor* desc,
RawMachineAssembler& raw) { // NOLINT(runtime/references)
raw.Return(raw.Parameter(which)); raw.Return(raw.Parameter(which));
} }
template <typename CType, int which> template <typename CType, int which>
static CType Compute_Select(CallDescriptor* desc, CType* inputs) { static CType Compute_Select(CallDescriptor* desc, CType* inputs) {
return inputs[which]; return inputs[which];
@ -943,10 +948,10 @@ TEST(Float64Select_stack_params_return_reg) {
} }
} }
template <typename CType, int which> template <typename CType, int which>
static void Build_Select_With_Call(CallDescriptor* desc, static void Build_Select_With_Call(
RawMachineAssembler& raw) { CallDescriptor* desc,
RawMachineAssembler& raw) { // NOLINT(runtime/references)
Handle<Code> inner = Handle<Code>::null(); Handle<Code> inner = Handle<Code>::null();
int num_params = ParamCount(desc); int num_params = ParamCount(desc);
CHECK_LE(num_params, kMaxParamCount); CHECK_LE(num_params, kMaxParamCount);
@ -977,7 +982,6 @@ static void Build_Select_With_Call(CallDescriptor* desc,
} }
} }
TEST(Float64StackParamsToStackParams) { TEST(Float64StackParamsToStackParams) {
int rarray[] = {GetRegConfig()->GetAllocatableDoubleCode(0)}; int rarray[] = {GetRegConfig()->GetAllocatableDoubleCode(0)};
Allocator params(nullptr, 0, nullptr, 0); Allocator params(nullptr, 0, nullptr, 0);

View File

@ -31,8 +31,9 @@ void CheckInvariantsOfAbortedPage(Page* page) {
CHECK(!page->IsFlagSet(Page::COMPACTION_WAS_ABORTED)); CHECK(!page->IsFlagSet(Page::COMPACTION_WAS_ABORTED));
} }
void CheckAllObjectsOnPage(std::vector<Handle<FixedArray>>& handles, void CheckAllObjectsOnPage(
Page* page) { std::vector<Handle<FixedArray>>& handles, // NOLINT(runtime/references)
Page* page) {
for (Handle<FixedArray> fixed_array : handles) { for (Handle<FixedArray> fixed_array : handles) {
CHECK(Page::FromHeapObject(*fixed_array) == page); CHECK(Page::FromHeapObject(*fixed_array) == page);
} }

View File

@ -43,7 +43,8 @@ v8::Isolate* NewIsolateForPagePromotion(int min_semi_space_size = 8,
return isolate; return isolate;
} }
Page* FindLastPageInNewSpace(std::vector<Handle<FixedArray>>& handles) { Page* FindLastPageInNewSpace(
std::vector<Handle<FixedArray>>& handles) { // NOLINT(runtime/references)
for (auto rit = handles.rbegin(); rit != handles.rend(); ++rit) { for (auto rit = handles.rbegin(); rit != handles.rend(); ++rit) {
// One deref gets the Handle, the second deref gets the FixedArray. // One deref gets the Handle, the second deref gets the FixedArray.
Page* candidate = Page::FromHeapObject(**rit); Page* candidate = Page::FromHeapObject(**rit);

View File

@ -70,7 +70,8 @@ class BytecodeExpectationsPrinter final {
const BytecodeArrayIterator& bytecode_iterator, const BytecodeArrayIterator& bytecode_iterator,
int parameter_count) const; int parameter_count) const;
void PrintSourcePosition(std::ostream& stream, // NOLINT void PrintSourcePosition(std::ostream& stream, // NOLINT
SourcePositionTableIterator& source_iterator, SourcePositionTableIterator&
source_iterator, // NOLINT(runtime/references)
int bytecode_offset) const; int bytecode_offset) const;
void PrintV8String(std::ostream& stream, // NOLINT void PrintV8String(std::ostream& stream, // NOLINT
i::String string) const; i::String string) const;

View File

@ -131,21 +131,22 @@ std::string BuildActual(const BytecodeExpectationsPrinter& printer,
} }
// inplace left trim // inplace left trim
static inline void ltrim(std::string& str) { static inline void ltrim(std::string& str) { // NOLINT(runtime/references)
str.erase(str.begin(), str.erase(str.begin(),
std::find_if(str.begin(), str.end(), std::find_if(str.begin(), str.end(),
[](unsigned char ch) { return !std::isspace(ch); })); [](unsigned char ch) { return !std::isspace(ch); }));
} }
// inplace right trim // inplace right trim
static inline void rtrim(std::string& str) { static inline void rtrim(std::string& str) { // NOLINT(runtime/references)
str.erase(std::find_if(str.rbegin(), str.rend(), str.erase(std::find_if(str.rbegin(), str.rend(),
[](unsigned char ch) { return !std::isspace(ch); }) [](unsigned char ch) { return !std::isspace(ch); })
.base(), .base(),
str.end()); str.end());
} }
static inline std::string trim(std::string& str) { static inline std::string trim(
std::string& str) { // NOLINT(runtime/references)
ltrim(str); ltrim(str);
rtrim(str); rtrim(str);
return str; return str;

View File

@ -1485,19 +1485,18 @@ TEST(InterpreterCall) {
} }
} }
static BytecodeArrayBuilder& SetRegister(BytecodeArrayBuilder& builder, static BytecodeArrayBuilder& SetRegister(
Register reg, int value, BytecodeArrayBuilder& builder, // NOLINT(runtime/references)
Register scratch) { Register reg, int value, Register scratch) {
return builder.StoreAccumulatorInRegister(scratch) return builder.StoreAccumulatorInRegister(scratch)
.LoadLiteral(Smi::FromInt(value)) .LoadLiteral(Smi::FromInt(value))
.StoreAccumulatorInRegister(reg) .StoreAccumulatorInRegister(reg)
.LoadAccumulatorWithRegister(scratch); .LoadAccumulatorWithRegister(scratch);
} }
static BytecodeArrayBuilder& IncrementRegister(BytecodeArrayBuilder& builder, static BytecodeArrayBuilder& IncrementRegister(
Register reg, int value, BytecodeArrayBuilder& builder, // NOLINT(runtime/references)
Register scratch, Register reg, int value, Register scratch, int slot_index) {
int slot_index) {
return builder.StoreAccumulatorInRegister(scratch) return builder.StoreAccumulatorInRegister(scratch)
.LoadLiteral(Smi::FromInt(value)) .LoadLiteral(Smi::FromInt(value))
.BinaryOperation(Token::Value::ADD, reg, slot_index) .BinaryOperation(Token::Value::ADD, reg, slot_index)

View File

@ -242,9 +242,10 @@ TEST(TestTracingController) {
i::V8::SetPlatformForTesting(old_platform); i::V8::SetPlatformForTesting(old_platform);
} }
void GetJSONStrings(std::vector<std::string>& ret, std::string str, void GetJSONStrings(
std::string param, std::string start_delim, std::vector<std::string>& ret, // NOLINT(runtime/references)
std::string end_delim) { std::string str, std::string param, std::string start_delim,
std::string end_delim) {
size_t pos = str.find(param); size_t pos = str.find(param);
while (pos != std::string::npos) { while (pos != std::string::npos) {
size_t start_pos = str.find(start_delim, pos + param.length()); size_t start_pos = str.find(start_delim, pos + param.length());

View File

@ -3390,7 +3390,8 @@ TEST(ARMv8_vminmax_f32) {
} }
template <typename T, typename Inputs, typename Results> template <typename T, typename Inputs, typename Results>
static GeneratedCode<F_ppiii> GenerateMacroFloatMinMax(MacroAssembler& assm) { static GeneratedCode<F_ppiii> GenerateMacroFloatMinMax(
MacroAssembler& assm) { // NOLINT(runtime/references)
T a = T::from_code(0); // d0/s0 T a = T::from_code(0); // d0/s0
T b = T::from_code(1); // d1/s1 T b = T::from_code(1); // d1/s1
T c = T::from_code(2); // d2/s2 T c = T::from_code(2); // d2/s2

View File

@ -4825,8 +4825,9 @@ TEST(r6_beqzc) {
} }
} }
void load_elements_of_vector(MacroAssembler& assm, const uint64_t elements[], void load_elements_of_vector(
MSARegister w, Register t0, Register t1) { MacroAssembler& assm, // NOLINT(runtime/references)
const uint64_t elements[], MSARegister w, Register t0, Register t1) {
__ li(t0, static_cast<uint32_t>(elements[0] & 0xFFFFFFFF)); __ li(t0, static_cast<uint32_t>(elements[0] & 0xFFFFFFFF));
__ li(t1, static_cast<uint32_t>((elements[0] >> 32) & 0xFFFFFFFF)); __ li(t1, static_cast<uint32_t>((elements[0] >> 32) & 0xFFFFFFFF));
__ insert_w(w, 0, t0); __ insert_w(w, 0, t0);
@ -4837,8 +4838,9 @@ void load_elements_of_vector(MacroAssembler& assm, const uint64_t elements[],
__ insert_w(w, 3, t1); __ insert_w(w, 3, t1);
} }
inline void store_elements_of_vector(MacroAssembler& assm, MSARegister w, inline void store_elements_of_vector(
Register a) { MacroAssembler& assm, // NOLINT(runtime/references)
MSARegister w, Register a) {
__ st_d(w, MemOperand(a, 0)); __ st_d(w, MemOperand(a, 0));
} }

View File

@ -5430,8 +5430,9 @@ TEST(r6_beqzc) {
} }
} }
void load_elements_of_vector(MacroAssembler& assm, const uint64_t elements[], void load_elements_of_vector(
MSARegister w, Register t0, Register t1) { MacroAssembler& assm, // NOLINT(runtime/references)
const uint64_t elements[], MSARegister w, Register t0, Register t1) {
__ li(t0, static_cast<uint32_t>(elements[0] & 0xFFFFFFFF)); __ li(t0, static_cast<uint32_t>(elements[0] & 0xFFFFFFFF));
__ li(t1, static_cast<uint32_t>((elements[0] >> 32) & 0xFFFFFFFF)); __ li(t1, static_cast<uint32_t>((elements[0] >> 32) & 0xFFFFFFFF));
__ insert_w(w, 0, t0); __ insert_w(w, 0, t0);
@ -5442,8 +5443,9 @@ void load_elements_of_vector(MacroAssembler& assm, const uint64_t elements[],
__ insert_w(w, 3, t1); __ insert_w(w, 3, t1);
} }
inline void store_elements_of_vector(MacroAssembler& assm, MSARegister w, inline void store_elements_of_vector(
Register a) { MacroAssembler& assm, // NOLINT(runtime/references)
MSARegister w, Register a) {
__ st_d(w, MemOperand(a, 0)); __ st_d(w, MemOperand(a, 0));
} }

View File

@ -1436,7 +1436,8 @@ struct CheckNormalize {
// //
template <typename TestConfig, typename Checker> template <typename TestConfig, typename Checker>
static void TestReconfigureProperty_CustomPropertyAfterTargetMap( static void TestReconfigureProperty_CustomPropertyAfterTargetMap(
TestConfig& config, Checker& checker) { TestConfig& config, // NOLINT(runtime/references)
Checker& checker) { // NOLINT(runtime/references)
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
@ -1513,7 +1514,6 @@ static void TestReconfigureProperty_CustomPropertyAfterTargetMap(
checker.Check(isolate, map1, new_map, expectations1); checker.Check(isolate, map1, new_map, expectations1);
} }
TEST(ReconfigureDataFieldAttribute_SameDataConstantAfterTargetMap) { TEST(ReconfigureDataFieldAttribute_SameDataConstantAfterTargetMap) {
CcTest::InitializeVM(); CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate()); v8::HandleScope scope(CcTest::isolate());
@ -1526,14 +1526,18 @@ TEST(ReconfigureDataFieldAttribute_SameDataConstantAfterTargetMap) {
js_func_ = factory->NewFunctionForTest(factory->empty_string()); js_func_ = factory->NewFunctionForTest(factory->empty_string());
} }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
// Add the same data constant property at both transition tree branches. // Add the same data constant property at both transition tree branches.
return expectations.AddDataConstant(map, NONE, js_func_); return expectations.AddDataConstant(map, NONE, js_func_);
} }
void UpdateExpectations(int property_index, Expectations& expectations) { void UpdateExpectations(
int property_index,
Expectations& expectations) { // NOLINT(runtime/references)
// Expectations stay the same. // Expectations stay the same.
} }
}; };
@ -1571,14 +1575,18 @@ TEST(ReconfigureDataFieldAttribute_DataConstantToDataFieldAfterTargetMap) {
factory->NewFunction(sloppy_map, info, isolate->native_context()); factory->NewFunction(sloppy_map, info, isolate->native_context());
} }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
Handle<JSFunction> js_func = branch_id == 1 ? js_func1_ : js_func2_; Handle<JSFunction> js_func = branch_id == 1 ? js_func1_ : js_func2_;
return expectations.AddDataConstant(map, NONE, js_func); return expectations.AddDataConstant(map, NONE, js_func);
} }
void UpdateExpectations(int property_index, Expectations& expectations) { void UpdateExpectations(
int property_index,
Expectations& expectations) { // NOLINT(runtime/references)
expectations.SetDataField(property_index, PropertyConstness::kConst, expectations.SetDataField(property_index, PropertyConstness::kConst,
Representation::HeapObject(), function_type_); Representation::HeapObject(), function_type_);
} }
@ -1604,8 +1612,10 @@ TEST(ReconfigureDataFieldAttribute_DataConstantToAccConstantAfterTargetMap) {
pair_ = CreateAccessorPair(true, true); pair_ = CreateAccessorPair(true, true);
} }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
if (branch_id == 1) { if (branch_id == 1) {
return expectations.AddDataConstant(map, NONE, js_func_); return expectations.AddDataConstant(map, NONE, js_func_);
@ -1614,7 +1624,10 @@ TEST(ReconfigureDataFieldAttribute_DataConstantToAccConstantAfterTargetMap) {
} }
} }
void UpdateExpectations(int property_index, Expectations& expectations) {} void UpdateExpectations(
int property_index,
Expectations& expectations // NOLINT(runtime/references)
) {}
}; };
TestConfig config; TestConfig config;
@ -1632,15 +1645,19 @@ TEST(ReconfigureDataFieldAttribute_SameAccessorConstantAfterTargetMap) {
Handle<AccessorPair> pair_; Handle<AccessorPair> pair_;
TestConfig() { pair_ = CreateAccessorPair(true, true); } TestConfig() { pair_ = CreateAccessorPair(true, true); }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
// Add the same accessor constant property at both transition tree // Add the same accessor constant property at both transition tree
// branches. // branches.
return expectations.AddAccessorConstant(map, NONE, pair_); return expectations.AddAccessorConstant(map, NONE, pair_);
} }
void UpdateExpectations(int property_index, Expectations& expectations) { void UpdateExpectations(
int property_index,
Expectations& expectations) { // NOLINT(runtime/references)
// Two branches are "compatible" so the |map1| should NOT be deprecated. // Two branches are "compatible" so the |map1| should NOT be deprecated.
} }
}; };
@ -1663,14 +1680,18 @@ TEST(ReconfigureDataFieldAttribute_AccConstantToAccFieldAfterTargetMap) {
pair2_ = CreateAccessorPair(true, true); pair2_ = CreateAccessorPair(true, true);
} }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
Handle<AccessorPair> pair = branch_id == 1 ? pair1_ : pair2_; Handle<AccessorPair> pair = branch_id == 1 ? pair1_ : pair2_;
return expectations.AddAccessorConstant(map, NONE, pair); return expectations.AddAccessorConstant(map, NONE, pair);
} }
void UpdateExpectations(int property_index, Expectations& expectations) { void UpdateExpectations(
int property_index,
Expectations& expectations) { // NOLINT(runtime/references)
if (IS_ACCESSOR_FIELD_SUPPORTED) { if (IS_ACCESSOR_FIELD_SUPPORTED) {
expectations.SetAccessorField(property_index); expectations.SetAccessorField(property_index);
} else { } else {
@ -1701,8 +1722,10 @@ TEST(ReconfigureDataFieldAttribute_AccConstantToDataFieldAfterTargetMap) {
Handle<AccessorPair> pair_; Handle<AccessorPair> pair_;
TestConfig() { pair_ = CreateAccessorPair(true, true); } TestConfig() { pair_ = CreateAccessorPair(true, true); }
Handle<Map> AddPropertyAtBranch(int branch_id, Expectations& expectations, Handle<Map> AddPropertyAtBranch(
Handle<Map> map) { int branch_id,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
CHECK(branch_id == 1 || branch_id == 2); CHECK(branch_id == 1 || branch_id == 2);
if (branch_id == 1) { if (branch_id == 1) {
return expectations.AddAccessorConstant(map, NONE, pair_); return expectations.AddAccessorConstant(map, NONE, pair_);
@ -1714,7 +1737,10 @@ TEST(ReconfigureDataFieldAttribute_AccConstantToDataFieldAfterTargetMap) {
} }
} }
void UpdateExpectations(int property_index, Expectations& expectations) {} void UpdateExpectations(
int property_index,
Expectations& expectations // NOLINT(runtime/references)
) {}
}; };
TestConfig config; TestConfig config;
@ -2115,8 +2141,9 @@ TEST(ReconfigurePropertySplitMapTransitionsOverflow) {
// fixed. // fixed.
template <typename TestConfig> template <typename TestConfig>
static void TestGeneralizeFieldWithSpecialTransition( static void TestGeneralizeFieldWithSpecialTransition(
TestConfig& config, const CRFTData& from, const CRFTData& to, TestConfig& config, // NOLINT(runtime/references)
const CRFTData& expected, bool expected_deprecation) { const CRFTData& from, const CRFTData& to, const CRFTData& expected,
bool expected_deprecation) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Expectations expectations(isolate); Expectations expectations(isolate);
@ -2357,7 +2384,9 @@ TEST(PrototypeTransitionFromMapOwningDescriptor) {
prototype_ = factory->NewJSObjectFromMap(Map::Create(isolate, 0)); prototype_ = factory->NewJSObjectFromMap(Map::Create(isolate, 0));
} }
Handle<Map> Transition(Handle<Map> map, Expectations& expectations) { Handle<Map> Transition(
Handle<Map> map,
Expectations& expectations) { // NOLINT(runtime/references)
return Map::TransitionToPrototype(CcTest::i_isolate(), map, prototype_); return Map::TransitionToPrototype(CcTest::i_isolate(), map, prototype_);
} }
// TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed. // TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed.
@ -2397,7 +2426,9 @@ TEST(PrototypeTransitionFromMapNotOwningDescriptor) {
prototype_ = factory->NewJSObjectFromMap(Map::Create(isolate, 0)); prototype_ = factory->NewJSObjectFromMap(Map::Create(isolate, 0));
} }
Handle<Map> Transition(Handle<Map> map, Expectations& expectations) { Handle<Map> Transition(
Handle<Map> map,
Expectations& expectations) { // NOLINT(runtime/references)
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
@ -2453,7 +2484,9 @@ struct TransitionToDataFieldOperator {
heap_type_(heap_type), heap_type_(heap_type),
value_(value) {} value_(value) {}
Handle<Map> DoTransition(Expectations& expectations, Handle<Map> map) { Handle<Map> DoTransition(
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
return expectations.TransitionToDataField( return expectations.TransitionToDataField(
map, attributes_, constness_, representation_, heap_type_, value_); map, attributes_, constness_, representation_, heap_type_, value_);
} }
@ -2503,8 +2536,10 @@ struct ReconfigureAsDataPropertyOperator {
attributes_(attributes), attributes_(attributes),
heap_type_(heap_type) {} heap_type_(heap_type) {}
Handle<Map> DoTransition(Isolate* isolate, Expectations& expectations, Handle<Map> DoTransition(
Handle<Map> map) { Isolate* isolate,
Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map) {
expectations.SetDataField(descriptor_, PropertyConstness::kMutable, expectations.SetDataField(descriptor_, PropertyConstness::kMutable,
representation_, heap_type_); representation_, heap_type_);
return Map::ReconfigureExistingProperty(isolate, map, descriptor_, kData, return Map::ReconfigureExistingProperty(isolate, map, descriptor_, kData,
@ -2549,8 +2584,9 @@ struct FieldGeneralizationChecker {
attributes_(attributes), attributes_(attributes),
heap_type_(heap_type) {} heap_type_(heap_type) {}
void Check(Isolate* isolate, Expectations& expectations2, Handle<Map> map1, void Check(Isolate* isolate,
Handle<Map> map2) { Expectations& expectations2, // NOLINT(runtime/references)
Handle<Map> map1, Handle<Map> map2) {
CHECK(!map2->is_deprecated()); CHECK(!map2->is_deprecated());
CHECK(map1->is_deprecated()); CHECK(map1->is_deprecated());
@ -2568,8 +2604,9 @@ struct FieldGeneralizationChecker {
// Checks that existing transition was taken as is. // Checks that existing transition was taken as is.
struct SameMapChecker { struct SameMapChecker {
void Check(Isolate* isolate, Expectations& expectations, Handle<Map> map1, void Check(Isolate* isolate,
Handle<Map> map2) { Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map1, Handle<Map> map2) {
CHECK(!map2->is_deprecated()); CHECK(!map2->is_deprecated());
CHECK_EQ(*map1, *map2); CHECK_EQ(*map1, *map2);
CHECK(expectations.Check(*map2)); CHECK(expectations.Check(*map2));
@ -2580,7 +2617,8 @@ struct SameMapChecker {
// Checks that both |map1| and |map2| should stays non-deprecated, this is // Checks that both |map1| and |map2| should stays non-deprecated, this is
// the case when property kind is change. // the case when property kind is change.
struct PropertyKindReconfigurationChecker { struct PropertyKindReconfigurationChecker {
void Check(Expectations& expectations, Handle<Map> map1, Handle<Map> map2) { void Check(Expectations& expectations, // NOLINT(runtime/references)
Handle<Map> map1, Handle<Map> map2) {
CHECK(!map1->is_deprecated()); CHECK(!map1->is_deprecated());
CHECK(!map2->is_deprecated()); CHECK(!map2->is_deprecated());
CHECK_NE(*map1, *map2); CHECK_NE(*map1, *map2);
@ -2605,8 +2643,10 @@ struct PropertyKindReconfigurationChecker {
// where "p4A" and "p4B" differ only in the attributes. // where "p4A" and "p4B" differ only in the attributes.
// //
template <typename TransitionOp1, typename TransitionOp2, typename Checker> template <typename TransitionOp1, typename TransitionOp2, typename Checker>
static void TestTransitionTo(TransitionOp1& transition_op1, static void TestTransitionTo(
TransitionOp2& transition_op2, Checker& checker) { TransitionOp1& transition_op1, // NOLINT(runtime/references)
TransitionOp2& transition_op2, // NOLINT(runtime/references)
Checker& checker) { // NOLINT(runtime/references)
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Handle<FieldType> any_type = FieldType::Any(isolate); Handle<FieldType> any_type = FieldType::Any(isolate);
@ -2632,7 +2672,6 @@ static void TestTransitionTo(TransitionOp1& transition_op1,
checker.Check(isolate, expectations2, map1, map2); checker.Check(isolate, expectations2, map1, map2);
} }
TEST(TransitionDataFieldToDataField) { TEST(TransitionDataFieldToDataField) {
CcTest::InitializeVM(); CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate()); v8::HandleScope scope(CcTest::isolate());

View File

@ -3428,7 +3428,8 @@ TEST(AddressToTraceMap) {
} }
static const v8::AllocationProfile::Node* FindAllocationProfileNode( static const v8::AllocationProfile::Node* FindAllocationProfileNode(
v8::Isolate* isolate, v8::AllocationProfile& profile, v8::Isolate* isolate,
v8::AllocationProfile& profile, // NOLINT(runtime/references)
const Vector<const char*>& names) { const Vector<const char*>& names) {
v8::AllocationProfile::Node* node = profile.GetRootNode(); v8::AllocationProfile::Node* node = profile.GetRootNode();
for (int i = 0; node != nullptr && i < names.length(); ++i) { for (int i = 0; node != nullptr && i < names.length(); ++i) {

View File

@ -669,7 +669,8 @@ static const char* line_number_test_source_profile_time_functions =
"bar_at_the_second_line();\n" "bar_at_the_second_line();\n"
"function lazy_func_at_6th_line() {}"; "function lazy_func_at_6th_line() {}";
int GetFunctionLineNumber(CpuProfiler& profiler, LocalContext& env, int GetFunctionLineNumber(CpuProfiler& profiler, // NOLINT(runtime/references)
LocalContext& env, // NOLINT(runtime/references)
const char* name) { const char* name) {
CodeMap* code_map = profiler.generator()->code_map(); CodeMap* code_map = profiler.generator()->code_map();
i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast( i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(

View File

@ -98,7 +98,8 @@ class TestSerializer {
return v8_isolate; return v8_isolate;
} }
static v8::Isolate* NewIsolateFromBlob(StartupBlobs& blobs) { static v8::Isolate* NewIsolateFromBlob(
StartupBlobs& blobs) { // NOLINT(runtime/references)
SnapshotData startup_snapshot(blobs.startup); SnapshotData startup_snapshot(blobs.startup);
SnapshotData read_only_snapshot(blobs.read_only); SnapshotData read_only_snapshot(blobs.read_only);
ReadOnlyDeserializer read_only_deserializer(&read_only_snapshot); ReadOnlyDeserializer read_only_deserializer(&read_only_snapshot);
@ -203,14 +204,13 @@ Vector<const uint8_t> ConstructSource(Vector<const uint8_t> head,
source_length); source_length);
} }
static v8::Isolate* Deserialize(
static v8::Isolate* Deserialize(StartupBlobs& blobs) { StartupBlobs& blobs) { // NOLINT(runtime/references)
v8::Isolate* isolate = TestSerializer::NewIsolateFromBlob(blobs); v8::Isolate* isolate = TestSerializer::NewIsolateFromBlob(blobs);
CHECK(isolate); CHECK(isolate);
return isolate; return isolate;
} }
static void SanityCheck(v8::Isolate* v8_isolate) { static void SanityCheck(v8::Isolate* v8_isolate) {
Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
v8::HandleScope scope(v8_isolate); v8::HandleScope scope(v8_isolate);

Some files were not shown because too many files have changed in this diff Show More