diff --git a/runtime/.clang-tidy b/runtime/.clang-tidy index 633aabfa36a..15dc4993b1e 100644 --- a/runtime/.clang-tidy +++ b/runtime/.clang-tidy @@ -1 +1 @@ -Checks: -*,readability-implicit-bool-conversion +Checks: -*,readability-implicit-bool-conversion,bugprone-argument-comment diff --git a/runtime/bin/elf_loader.cc b/runtime/bin/elf_loader.cc index 1ba6f00696b..3727f3f9482 100644 --- a/runtime/bin/elf_loader.cc +++ b/runtime/bin/elf_loader.cc @@ -487,7 +487,7 @@ DART_EXPORT Dart_LoadedElf* Dart_LoadELF_Memory( return nullptr; } std::unique_ptr elf( - new LoadedElf(std::move(mappable), /*file_offset=*/0)); + new LoadedElf(std::move(mappable), /*elf_data_offset=*/0)); if (!elf->Load() || !elf->ResolveSymbols(vm_snapshot_data, vm_snapshot_instrs, diff --git a/runtime/bin/main_impl.cc b/runtime/bin/main_impl.cc index 0096d05bf10..6dee82c7960 100644 --- a/runtime/bin/main_impl.cc +++ b/runtime/bin/main_impl.cc @@ -220,7 +220,7 @@ static bool OnIsolateInitialize(void** child_callback_data, char** error) { const bool isolate_run_app_snapshot = isolate_group_data->RunFromAppSnapshot(); Dart_Handle result = SetupCoreLibraries(isolate, isolate_data, - /*group_start=*/false, + /*is_isolate_group_start=*/false, /*is_kernel_isolate=*/false, /*resolved_packages_config=*/nullptr); if (Dart_IsError(result)) goto failed; diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc index b7c39c456fd..2a894bb00b3 100644 --- a/runtime/bin/run_vm_tests.cc +++ b/runtime/bin/run_vm_tests.cc @@ -149,7 +149,8 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri, // Load embedder specific bits and return. if (!bin::VmService::Setup("127.0.0.1", 0, - /*dev_mode=*/false, /*auth_disabled=*/true, + /*dev_mode_server=*/false, + /*auth_codes_disabled=*/true, /*write_service_info_filename=*/"", /*trace_loading=*/false, /*deterministic=*/true, /*enable_service_port_fallback=*/false, diff --git a/runtime/bin/secure_socket_filter.cc b/runtime/bin/secure_socket_filter.cc index 622d3aad43e..8be564a9931 100644 --- a/runtime/bin/secure_socket_filter.cc +++ b/runtime/bin/secure_socket_filter.cc @@ -162,12 +162,13 @@ void FUNCTION_NAME(SecureSocket_NewX509CertificateWrapper)( Dart_NativeArguments args) { // This is to be used only in conjunction with certificate trust evaluator // running asynchronously, which is only used on mac/ios at the moment. -#if !defined(DART_HOST_OS_MACOS) - FATAL("This is to be used only on mac/ios platforms"); -#endif +#if defined(DART_HOST_OS_MACOS) intptr_t x509_pointer = DartUtils::GetNativeIntptrArgument(args, 0); X509* x509 = reinterpret_cast(x509_pointer); Dart_SetReturnValue(args, X509Helper::WrappedX509Certificate(x509)); +#else + FATAL("This is to be used only on mac/ios platforms"); +#endif } void FUNCTION_NAME(SecureSocket_GetSelectedProtocol)( diff --git a/runtime/bin/snapshot_utils.cc b/runtime/bin/snapshot_utils.cc index 906056456a6..038d87aec93 100644 --- a/runtime/bin/snapshot_utils.cc +++ b/runtime/bin/snapshot_utils.cc @@ -945,7 +945,7 @@ void Snapshot::GenerateAppAOTAsAssembly(const char* snapshot_filename) { snapshot_filename); } Dart_Handle result = Dart_CreateAppAOTSnapshotAsAssembly( - StreamingWriteCallback, file, /*strip=*/false, + StreamingWriteCallback, file, /*stripped=*/false, /*debug_callback_data=*/nullptr); if (Dart_IsError(result)) { ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result)); diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc index 1852c510360..649b080394b 100644 --- a/runtime/lib/regexp.cc +++ b/runtime/lib/regexp.cc @@ -167,7 +167,7 @@ static ObjectPtr ExecuteMatch(Zone* zone, } #endif return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index, - /*sticky=*/sticky, zone); + /*is_sticky=*/sticky, zone); } DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 0, 3) { diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc index 3d1038aa603..4a02c56a0e3 100644 --- a/runtime/platform/utils.cc +++ b/runtime/platform/utils.cc @@ -359,27 +359,23 @@ void* Utils::LoadDynamicLibrary(const char* library_path, void* Utils::ResolveSymbolInDynamicLibrary(void* library_handle, const char* symbol, char** error) { - void* result = nullptr; - #if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) dlerror(); // Clear any errors. - result = dlsym(library_handle, symbol); + void* result = dlsym(library_handle, symbol); // Note: nullptr might be a valid return from dlsym. Must call dlerror // to differentiate. GetLastErrorAsString(error); return result; #elif defined(DART_HOST_OS_WINDOWS) SetLastError(0); - result = reinterpret_cast( + void* result = reinterpret_cast( GetProcAddress(reinterpret_cast(library_handle), symbol)); -#endif - if (result == nullptr) { GetLastErrorAsString(error); } - return result; +#endif } void Utils::UnloadDynamicLibrary(void* library_handle, char** error) { diff --git a/runtime/vm/app_snapshot.cc b/runtime/vm/app_snapshot.cc index 754a79cf523..35420b24dc7 100644 --- a/runtime/vm/app_snapshot.cc +++ b/runtime/vm/app_snapshot.cc @@ -3624,8 +3624,6 @@ class RODataSerializationCluster is_canonical, is_canonical && IsStringClassId(cid), ImageWriter::TagObjectTypeAsReadOnly(zone, type)), - zone_(zone), - cid_(cid), type_(type) {} ~RODataSerializationCluster() {} @@ -3675,8 +3673,6 @@ class RODataSerializationCluster } private: - Zone* zone_; - const intptr_t cid_; const char* const type_; }; #endif // !DART_PRECOMPILED_RUNTIME && !DART_COMPRESSED_POINTERS diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h index de4fe662edc..4f5c8b6ee1b 100644 --- a/runtime/vm/code_descriptors.h +++ b/runtime/vm/code_descriptors.h @@ -182,8 +182,8 @@ struct InstructionSource { // Treat an instruction source without inlining id information as unset. InstructionSource() : InstructionSource(TokenPosition::kNoSource) {} explicit InstructionSource(TokenPosition pos) : InstructionSource(pos, -1) {} - InstructionSource(TokenPosition pos, intptr_t id) - : token_pos(pos), inlining_id(id) {} + InstructionSource(TokenPosition pos, intptr_t inlining_id) + : token_pos(pos), inlining_id(inlining_id) {} const TokenPosition token_pos; const intptr_t inlining_id; diff --git a/runtime/vm/compiler/aot/aot_call_specializer.cc b/runtime/vm/compiler/aot/aot_call_specializer.cc index 79bd4164d9b..6f3f550905e 100644 --- a/runtime/vm/compiler/aot/aot_call_specializer.cc +++ b/runtime/vm/compiler/aot/aot_call_specializer.cc @@ -907,7 +907,7 @@ void AotCallSpecializer::VisitInstanceCall(InstanceCallInstr* instr) { // the computed single_target. ic_data = ICData::New(function, instr->function_name(), args_desc_array, DeoptId::kNone, - /* args_tested = */ 1, ICData::kOptimized); + /*num_args_tested=*/1, ICData::kOptimized); for (intptr_t j = 0; j < i; j++) { ic_data.AddReceiverCheck(class_ids[j], single_target); } @@ -928,7 +928,7 @@ void AotCallSpecializer::VisitInstanceCall(InstanceCallInstr* instr) { const ICData& ic_data = ICData::Handle( ICData::New(flow_graph()->function(), instr->function_name(), args_desc_array, DeoptId::kNone, - /* args_tested = */ 1, ICData::kOptimized)); + /*num_args_tested=*/1, ICData::kOptimized)); cls = single_target.Owner(); ic_data.AddReceiverCheck(cls.id(), single_target); instr->set_ic_data(&ic_data); diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h index 376c7f50298..338eca0a9bf 100644 --- a/runtime/vm/compiler/assembler/assembler_arm64.h +++ b/runtime/vm/compiler/assembler/assembler_arm64.h @@ -1007,19 +1007,25 @@ class Assembler : public AssemblerBase { EmitLoadStoreReg(STR, rt, a, sz); } - void ldp(Register rt, Register rt2, Address a, OperandSize sz = kEightBytes) { - ASSERT((rt != CSP) && (rt != R31)); + void ldp(Register low, + Register high, + Address a, + OperandSize sz = kEightBytes) { + ASSERT((low != CSP) && (low != R31)); ASSERT((a.type() == Address::PairOffset) || (a.type() == Address::PairPostIndex) || (a.type() == Address::PairPreIndex)); - EmitLoadStoreRegPair(LDP, rt, rt2, a, sz); + EmitLoadStoreRegPair(LDP, low, high, a, sz); } - void stp(Register rt, Register rt2, Address a, OperandSize sz = kEightBytes) { - ASSERT((rt != CSP) && (rt != R31)); + void stp(Register low, + Register high, + Address a, + OperandSize sz = kEightBytes) { + ASSERT((low != CSP) && (low != R31)); ASSERT((a.type() == Address::PairOffset) || (a.type() == Address::PairPostIndex) || (a.type() == Address::PairPreIndex)); - EmitLoadStoreRegPair(STP, rt, rt2, a, sz); + EmitLoadStoreRegPair(STP, low, high, a, sz); } void fldp(VRegister rt, VRegister rt2, Address a, OperandSize sz) { ASSERT((a.type() == Address::PairOffset) || diff --git a/runtime/vm/compiler/assembler/assembler_x64.cc b/runtime/vm/compiler/assembler/assembler_x64.cc index 343bfaf2bed..b6b7ca7c8f0 100644 --- a/runtime/vm/compiler/assembler/assembler_x64.cc +++ b/runtime/vm/compiler/assembler/assembler_x64.cc @@ -660,7 +660,7 @@ void Assembler::testq(Register reg, const Immediate& imm) { if (reg >= 4) { // We need the Rex byte to give access to the SIL and DIL registers (the // low bytes of RSI and RDI). - EmitRegisterREX(reg, REX_NONE, /* force = */ true); + EmitRegisterREX(reg, REX_NONE, /*force_emit=*/true); } if (reg == RAX) { EmitUint8(0xA8); diff --git a/runtime/vm/compiler/assembler/disassembler_x86.cc b/runtime/vm/compiler/assembler/disassembler_x86.cc index 3c6b147dd24..7a9c9dc5d01 100644 --- a/runtime/vm/compiler/assembler/disassembler_x86.cc +++ b/runtime/vm/compiler/assembler/disassembler_x86.cc @@ -515,8 +515,6 @@ int DisassemblerX64::PrintImmediate(uint8_t* data, break; default: UNREACHABLE(); - value = 0; // Initialize variables on all paths to satisfy the compiler. - count = 0; } PrintImmediateValue(value, sign_extend, count); return count; @@ -1223,7 +1221,7 @@ bool DisassemblerX64::DecodeInstructionType(uint8_t** data) { (*data) += 1 + imm_bytes; Print("mov%s %s,", operand_size_code(), NameOfCPURegister(base_reg(current & 0x07))); - PrintImmediateValue(addr, /* signed = */ false, imm_bytes); + PrintImmediateValue(addr, /*signed_value=*/false, imm_bytes); break; } diff --git a/runtime/vm/compiler/backend/constant_propagator_test.cc b/runtime/vm/compiler/backend/constant_propagator_test.cc index e9fd0450f26..b74b296034e 100644 --- a/runtime/vm/compiler/backend/constant_propagator_test.cc +++ b/runtime/vm/compiler/backend/constant_propagator_test.cc @@ -262,25 +262,25 @@ ISOLATE_UNIT_TEST_CASE(ConstantPropagator_Regress35371) { return op; }; - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/1, /*lhs=*/2, make_int64_add, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/1, /*rhs=*/2, make_int64_add, FoldingResult::FoldsTo(3)); - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt64, /*lhs=*/1, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt64, /*rhs=*/1, make_int64_add, FoldingResult::FoldsTo(kMinInt64)); - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/1, /*lhs=*/2, make_int32_add, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/1, /*rhs=*/2, make_int32_add, FoldingResult::FoldsTo(3)); - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32 - 1, /*lhs=*/1, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32 - 1, /*rhs=*/1, make_int32_add, FoldingResult::FoldsTo(kMaxInt32)); // Overflow of int32 representation and operation is not marked as // truncating. - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32, /*lhs=*/1, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32, /*rhs=*/1, make_int32_add, FoldingResult::NoFold()); // Overflow of int32 representation and operation is marked as truncating. - ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32, /*lhs=*/1, + ConstantPropagatorUnboxedOpTest(thread, /*lhs=*/kMaxInt32, /*rhs=*/1, make_int32_truncating_add, FoldingResult::FoldsTo(kMinInt32)); } diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc index 12d3afc30c0..6f2a5a4764e 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc @@ -1991,7 +1991,7 @@ const CallTargets* FlowGraphCompiler::ResolveCallTargetsForReceiverCid( if (!LookupMethodFor(cid, selector, args_desc, &fn)) return nullptr; CallTargets* targets = new (zone) CallTargets(zone); - targets->Add(new (zone) TargetInfo(cid, cid, &fn, /* count = */ 1, + targets->Add(new (zone) TargetInfo(cid, cid, &fn, /*count_arg=*/1, StaticTypeExactnessState::NotTracking())); return targets; diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc index 701dd07cb1c..a51241278dd 100644 --- a/runtime/vm/compiler/backend/il.cc +++ b/runtime/vm/compiler/backend/il.cc @@ -4893,7 +4893,7 @@ LocationSummary* NativeParameterInstr::MakeLocationSummary(Zone* zone, ? Location::RequiresRegister() : Location::RequiresFpuRegister(); } - return LocationSummary::Make(zone, /*num_inputs=*/0, output, + return LocationSummary::Make(zone, /*input_count=*/0, output, LocationSummary::kNoCall); } @@ -7404,8 +7404,8 @@ LocationSummary* FfiCallInstr::MakeLocationSummaryInternal( is_leaf_ ? LocationSummary::kNativeLeafCall : LocationSummary::kCall; LocationSummary* summary = new (zone) LocationSummary( - zone, /*num_inputs=*/InputCount(), - /*num_temps=*/Utils::CountOneBitsWord(temps), contains_call); + zone, InputCount(), + /*temp_count=*/Utils::CountOneBitsWord(temps), contains_call); intptr_t reg_i = 0; for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) { @@ -7473,7 +7473,7 @@ void FfiCallInstr::EmitParamMoves(FlowGraphCompiler* compiler, // Moves for arguments. compiler::ffi::FrameRebase rebase(compiler->zone(), /*old_base=*/FPREG, /*new_base=*/saved_fp, - /*stack_delta=*/0); + /*stack_delta_in_bytes=*/0); intptr_t def_index = 0; for (intptr_t arg_index = 0; arg_index < marshaller_.num_args(); arg_index++) { @@ -8090,8 +8090,8 @@ LocationSummary* LeafRuntimeCallInstr::MakeLocationSummaryInternal( Zone* zone, const RegList temps) const { LocationSummary* summary = - new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(), - /*num_temps=*/Utils::CountOneBitsWord(temps), + new (zone) LocationSummary(zone, InputCount(), + /*temp_count=*/Utils::CountOneBitsWord(temps), LocationSummary::kNativeLeafCall); intptr_t reg_i = 0; @@ -8174,7 +8174,7 @@ void LeafRuntimeCallInstr::EmitParamMoves(FlowGraphCompiler* compiler, ConstantTemporaryAllocator temp_alloc(temp0); compiler::ffi::FrameRebase rebase(compiler->zone(), /*old_base=*/FPREG, /*new_base=*/saved_fp, - /*stack_delta=*/0); + /*stack_delta_in_bytes=*/0); __ Comment("EmitParamMoves"); const auto& argument_locations = diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc index 5bed00be349..d48ed88ee8d 100644 --- a/runtime/vm/compiler/backend/il_arm.cc +++ b/runtime/vm/compiler/backend/il_arm.cc @@ -2116,7 +2116,7 @@ LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, const bool can_be_constant = index()->BindsToConstant() && compiler::Assembler::AddressCanHoldConstantIndex( - index()->BoundConstant(), /*load=*/true, IsUntagged(), class_id(), + index()->BoundConstant(), /*is_load=*/true, IsUntagged(), class_id(), index_scale(), &needs_base); // We don't need to check if [needs_base] is true, since we use TMP as the // temp register in this case and so don't need to allocate a temp register. @@ -2289,7 +2289,7 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, const bool can_be_constant = index()->BindsToConstant() && compiler::Assembler::AddressCanHoldConstantIndex( - index()->BoundConstant(), /*load=*/false, IsUntagged(), class_id(), + index()->BoundConstant(), /*is_load=*/false, IsUntagged(), class_id(), index_scale(), &needs_base); if (can_be_constant) { if (!directly_addressable) { @@ -6893,8 +6893,8 @@ void IntConverterInstr::EmitNativeCode(FlowGraphCompiler* compiler) { LocationSummary* BitCastInstr::MakeLocationSummary(Zone* zone, bool opt) const { LocationSummary* summary = - new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(), - /*num_temps=*/0, LocationSummary::kNoCall); + new (zone) LocationSummary(zone, InputCount(), + /*temp_count=*/0, LocationSummary::kNoCall); switch (from()) { case kUnboxedInt32: summary->set_in(0, Location::RequiresRegister()); diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc index 6f8088e3a0a..e90b911dda8 100644 --- a/runtime/vm/compiler/backend/il_arm64.cc +++ b/runtime/vm/compiler/backend/il_arm64.cc @@ -5896,8 +5896,8 @@ void IntConverterInstr::EmitNativeCode(FlowGraphCompiler* compiler) { LocationSummary* BitCastInstr::MakeLocationSummary(Zone* zone, bool opt) const { LocationSummary* summary = - new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(), - /*num_temps=*/0, LocationSummary::kNoCall); + new (zone) LocationSummary(zone, InputCount(), + /*temp_count=*/0, LocationSummary::kNoCall); switch (from()) { case kUnboxedInt32: case kUnboxedInt64: diff --git a/runtime/vm/compiler/backend/il_riscv.cc b/runtime/vm/compiler/backend/il_riscv.cc index e51b9b17a96..4e22c0b1e28 100644 --- a/runtime/vm/compiler/backend/il_riscv.cc +++ b/runtime/vm/compiler/backend/il_riscv.cc @@ -6643,8 +6643,8 @@ void IntConverterInstr::EmitNativeCode(FlowGraphCompiler* compiler) { LocationSummary* BitCastInstr::MakeLocationSummary(Zone* zone, bool opt) const { LocationSummary* summary = - new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(), - /*num_temps=*/0, LocationSummary::kNoCall); + new (zone) LocationSummary(zone, InputCount(), + /*temp_count=*/0, LocationSummary::kNoCall); switch (from()) { case kUnboxedInt32: summary->set_in(0, Location::RequiresRegister()); diff --git a/runtime/vm/compiler/backend/il_test.cc b/runtime/vm/compiler/backend/il_test.cc index 6da20c7a1e7..3083bcd3433 100644 --- a/runtime/vm/compiler/backend/il_test.cc +++ b/runtime/vm/compiler/backend/il_test.cc @@ -1370,7 +1370,7 @@ ISOLATE_UNIT_TEST_CASE(IL_Canonicalize_InstanceCallWithNoICDataInAOT) { // length_call <- InstanceCall('get:length', array, ICData[]) length_call = builder.AddDefinition(new InstanceCallInstr( InstructionSource(), Symbols::GetLength(), Token::kGET, - /*args=*/{new Value(array)}, 0, Array::empty_array(), 1, + /*arguments=*/{new Value(array)}, 0, Array::empty_array(), 1, /*deopt_id=*/42)); length_call->EnsureICData(H.flow_graph()); // Return(load) diff --git a/runtime/vm/compiler/backend/il_test_helper.cc b/runtime/vm/compiler/backend/il_test_helper.cc index acfde5c3f7b..b285886b3ed 100644 --- a/runtime/vm/compiler/backend/il_test_helper.cc +++ b/runtime/vm/compiler/backend/il_test_helper.cc @@ -87,8 +87,7 @@ ObjectPtr Invoke(const Library& lib, const char* name) { Dart_Handle result; { TransitionVMToNative transition(thread); - result = - Dart_Invoke(api_lib, NewString(name), /*argc=*/0, /*argv=*/nullptr); + result = Dart_Invoke(api_lib, NewString(name), 0, nullptr); EXPECT_VALID(result); } return Api::UnwrapHandle(result); diff --git a/runtime/vm/compiler/backend/inliner.cc b/runtime/vm/compiler/backend/inliner.cc index e3a093a34da..d8315a833f6 100644 --- a/runtime/vm/compiler/backend/inliner.cc +++ b/runtime/vm/compiler/backend/inliner.cc @@ -1312,7 +1312,7 @@ class CallSiteInliner : public ValueObject { kernel::FlowGraphBuilder builder( parsed_function, ic_data_array, /*context_level_array=*/nullptr, exit_collector, - /*optimized=*/true, Compiler::kNoOSRDeoptId, + /*optimizing=*/true, Compiler::kNoOSRDeoptId, caller_graph_->max_block_id() + 1, entry_kind == Code::EntryKind::kUnchecked, &call_data->caller); { diff --git a/runtime/vm/compiler/call_specializer.cc b/runtime/vm/compiler/call_specializer.cc index 67f21afae1d..ff48b84b163 100644 --- a/runtime/vm/compiler/call_specializer.cc +++ b/runtime/vm/compiler/call_specializer.cc @@ -331,7 +331,7 @@ bool CallSpecializer::TryStringLengthOneEquality(InstanceCallInstr* call, right_val = new (Z) Value(right_instr->char_code()->definition()); to_remove_right = right_instr; } else { - AddChecksForArgNr(call, right, /* arg_number = */ 1); + AddChecksForArgNr(call, right, /* argument_number = */ 1); // String-to-char-code instructions returns -1 (illegal charcode) if // string is not of length one. StringToCharCodeInstr* char_code_right = new (Z) @@ -427,8 +427,8 @@ bool CallSpecializer::TryReplaceWithEqualityOp(InstanceCallInstr* call, // we can still emit the optimized Smi equality operation but need to add // checks for null or Smi. if (binary_feedback.OperandsAreSmiOrNull()) { - AddChecksForArgNr(call, left, /* arg_number = */ 0); - AddChecksForArgNr(call, right, /* arg_number = */ 1); + AddChecksForArgNr(call, left, /* argument_number = */ 0); + AddChecksForArgNr(call, right, /* argument_number = */ 1); representation = kTagged; } else { @@ -442,7 +442,7 @@ bool CallSpecializer::TryReplaceWithEqualityOp(InstanceCallInstr* call, StrictCompareInstr* comp = new (Z) StrictCompareInstr(call->source(), Token::kEQ_STRICT, new (Z) Value(left), new (Z) Value(right), - /* number_check = */ false, DeoptId::kNone); + /*needs_number_check=*/false, DeoptId::kNone); ReplaceCall(call, comp); return true; } @@ -969,8 +969,8 @@ bool CallSpecializer::InlineSimdBinaryOp(InstanceCallInstr* call, Definition* const left = call->ArgumentAt(0); Definition* const right = call->ArgumentAt(1); // Type check left and right. - AddChecksForArgNr(call, left, /* arg_number = */ 0); - AddChecksForArgNr(call, right, /* arg_number = */ 1); + AddChecksForArgNr(call, left, /* argument_number = */ 0); + AddChecksForArgNr(call, right, /* argument_number = */ 1); // Replace call. SimdOpInstr* op = SimdOpInstr::Create( SimdOpInstr::KindForOperator(cid, op_kind), new (Z) Value(left), @@ -1211,7 +1211,7 @@ bool CallSpecializer::TryOptimizeInstanceOfUsingStaticTypes( type.IsNullType() ? Token::kEQ_STRICT : Token::kNE_STRICT, left_value->CopyWithType(Z), new (Z) Value(flow_graph()->constant_null()), - /* number_check = */ false, DeoptId::kNone); + /*needs_number_check=*/false, DeoptId::kNone); if (FLAG_trace_strong_mode_types) { THR_Print("[Strong mode] replacing %s with %s (%s < %s)\n", call->ToCString(), replacement->ToCString(), diff --git a/runtime/vm/compiler/ffi/marshaller.cc b/runtime/vm/compiler/ffi/marshaller.cc index dc854b792ca..4598b5d7d69 100644 --- a/runtime/vm/compiler/ffi/marshaller.cc +++ b/runtime/vm/compiler/ffi/marshaller.cc @@ -824,7 +824,7 @@ class CallbackArgumentTranslator : public ValueObject { FrameRebase rebase( zone, /*old_base=*/SPREG, /*new_base=*/SPREG, - /*stack_delta=*/(argument_slots_required_ + stack_delta) * + /*stack_delta_in_bytes=*/(argument_slots_required_ + stack_delta) * compiler::target::kWordSize); return rebase.Rebase(arg); } diff --git a/runtime/vm/compiler/ffi/native_calling_convention_test.cc b/runtime/vm/compiler/ffi/native_calling_convention_test.cc index 5be3304d8cb..ac5cd5fcdfc 100644 --- a/runtime/vm/compiler/ffi/native_calling_convention_test.cc +++ b/runtime/vm/compiler/ffi/native_calling_convention_test.cc @@ -541,7 +541,7 @@ UNIT_TEST_CASE_WITH_ZONE(NativeCallingConvention_struct8bytesPackedx10) { member_types.Add(&int8_type); member_types.Add(&int8_type); const auto& struct_type = - NativeStructType::FromNativeTypes(Z, member_types, /*packing=*/1); + NativeStructType::FromNativeTypes(Z, member_types, /*member_packing=*/1); EXPECT_EQ(8, struct_type.SizeInBytes()); EXPECT(struct_type.ContainsUnalignedMembers()); @@ -580,7 +580,7 @@ UNIT_TEST_CASE_WITH_ZONE(NativeCallingConvention_structPacked) { member_types.Add(&int8_type); member_types.Add(&double_type); const auto& struct_type = - NativeStructType::FromNativeTypes(Z, member_types, /*packing=*/1); + NativeStructType::FromNativeTypes(Z, member_types, /*member_packing=*/1); EXPECT_EQ(9, struct_type.SizeInBytes()); EXPECT(struct_type.ContainsUnalignedMembers()); diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index bfe9492435d..4f5070778f1 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -352,7 +352,7 @@ Fragment StreamingFlowGraphBuilder::BuildInitializers( ReadCanonicalNameReference(); instructions += BuildFieldInitializer( Field::ZoneHandle(Z, initializer_fields[i]->ptr()), - /*only_for_size_effects=*/false); + /*only_for_side_effects=*/false); break; } case kAssertInitializer: { @@ -371,7 +371,7 @@ Fragment StreamingFlowGraphBuilder::BuildInitializers( intptr_t argument_count; instructions += BuildArguments( &argument_names, &argument_count, - /* positional_parameter_count = */ nullptr); // read arguments. + /*positional_argument_count=*/nullptr); // read arguments. argument_count += 1; Class& parent_klass = GetSuperOrDie(); @@ -397,7 +397,7 @@ Fragment StreamingFlowGraphBuilder::BuildInitializers( intptr_t argument_count; instructions += BuildArguments( &argument_names, &argument_count, - /* positional_parameter_count = */ nullptr); // read arguments. + /*positional_argument_count=*/nullptr); // read arguments. argument_count += 1; const Function& target = Function::ZoneHandle( @@ -876,7 +876,7 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraphOfFunction( prologue += type_args_handling; prologue += explicit_type_checks; extra_entry = B->BuildSharedUncheckedEntryPoint( - /*shared_prologue_linked_in=*/prologue, + /*prologue_from_normal_entry=*/prologue, /*skippable_checks=*/implicit_type_checks, /*redefinitions_if_skipped=*/implicit_redefinitions, /*body=*/body); @@ -2385,7 +2385,7 @@ Fragment StreamingFlowGraphBuilder::BuildInstanceSet(TokenPosition* p) { instructions += StaticCall(position, direct_call.target_, 2, Array::null_array(), ICData::kNoRebind, /*result_type=*/nullptr, - /*type_args_count=*/0, + /*type_args_len=*/0, /*use_unchecked_entry=*/is_unchecked_call); } else { const intptr_t kTypeArgsLen = 0; @@ -2397,7 +2397,7 @@ Fragment StreamingFlowGraphBuilder::BuildInstanceSet(TokenPosition* p) { Function::null_function(), /*result_type=*/nullptr, /*use_unchecked_entry=*/is_unchecked_call, &call_site_attributes, - /*receiver_not_smi=*/false, is_call_on_this); + /*receiver_is_not_smi=*/false, is_call_on_this); } instructions += Drop(); // Drop result of the setter invocation. @@ -2452,7 +2452,7 @@ Fragment StreamingFlowGraphBuilder::BuildDynamicSet(TokenPosition* p) { instructions += StaticCall(position, *direct_call_target, 2, Array::null_array(), ICData::kNoRebind, /*result_type=*/nullptr, - /*type_args_count=*/0, + /*type_args_len=*/0, /*use_unchecked_entry=*/is_unchecked_call); } else { const intptr_t kTypeArgsLen = 0; @@ -3328,7 +3328,7 @@ Fragment StreamingFlowGraphBuilder::BuildSuperMethodInvocation( StaticCall(position, Function::ZoneHandle(Z, function.ptr()), argument_count, argument_names, ICData::kSuper, &result_type, type_args_len, - /*use_unchecked_entry_point=*/true); + /*use_unchecked_entry=*/true); } } @@ -6074,8 +6074,8 @@ Fragment StreamingFlowGraphBuilder::BuildLoadStoreAbiSpecificInt( if (at_index) { code += BuildExpression(); // Argument 3: index code += IntConstant(native_type->SizeInBytes()); - code += B->BinaryIntegerOp(Token::kMUL, kTagged, /* truncate= */ true); - code += B->BinaryIntegerOp(Token::kADD, kTagged, /* truncate= */ true); + code += B->BinaryIntegerOp(Token::kMUL, kTagged, /*is_truncating=*/true); + code += B->BinaryIntegerOp(Token::kADD, kTagged, /*is_truncating=*/true); } if (is_store) { code += BuildExpression(); // Argument 4: value diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc index e29d16c8960..811f8e9a0a1 100644 --- a/runtime/vm/compiler/frontend/kernel_to_il.cc +++ b/runtime/vm/compiler/frontend/kernel_to_il.cc @@ -1986,7 +1986,7 @@ Fragment FlowGraphBuilder::BuildTypedDataViewFactoryConstructor( // and thus already checked (e.g., the implementation of the // UnmodifiableXListView constructors). - body += AllocateObject(token_pos, view_class, /*arg_count=*/0); + body += AllocateObject(token_pos, view_class, /*argument_count=*/0); LocalVariable* view_object = MakeTemporary(); body += LoadLocal(view_object); @@ -3808,7 +3808,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodForwarder( body += IntConstant(function.NumParameters()); } body += LoadLocal(argument_count_var); - body += SmiBinaryOp(Token::kADD, /* truncate= */ true); + body += SmiBinaryOp(Token::kADD, /*is_truncating=*/true); LocalVariable* argument_count = MakeTemporary(); // We are generating code like the following: @@ -3871,7 +3871,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodForwarder( loop_body += LoadLocal(index); loop_body += LoadLocal(argument_count); loop_body += LoadLocal(index); - loop_body += SmiBinaryOp(Token::kSUB, /*truncate=*/true); + loop_body += SmiBinaryOp(Token::kSUB, /*is_truncating=*/true); loop_body += LoadFpRelativeSlot(compiler::target::kWordSize * compiler::target::frame_layout.param_end_from_fp, @@ -3881,7 +3881,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodForwarder( // ++i loop_body += LoadLocal(index); loop_body += IntConstant(1); - loop_body += SmiBinaryOp(Token::kADD, /*truncate=*/true); + loop_body += SmiBinaryOp(Token::kADD, /*is_truncating=*/true); loop_body += StoreLocal(TokenPosition::kNoSource, index); loop_body += Drop(); @@ -5312,7 +5312,7 @@ Fragment FlowGraphBuilder::FfiNativeLookupAddress( CachableIdempotentCall(TokenPosition::kNoSource, kUntagged, ffi_resolver, /*argument_count=*/3, /*argument_names=*/Array::null_array(), - /*type_args_count=*/0); + /*type_args_len=*/0); return body; #else // !defined(TARGET_ARCH_IA32) // IA32 only has JIT and no pool. This function will only be compiled if diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc index 49523562696..e8b88bec096 100644 --- a/runtime/vm/compiler/frontend/prologue_builder.cc +++ b/runtime/vm/compiler/frontend/prologue_builder.cc @@ -127,7 +127,7 @@ Fragment PrologueBuilder::BuildParameterHandling() { copy_args_prologue += LoadLocal(count_var); copy_args_prologue += IntConstant(min_num_pos_args); - copy_args_prologue += SmiBinaryOp(Token::kSUB, /* truncate= */ true); + copy_args_prologue += SmiBinaryOp(Token::kSUB, /*is_truncating=*/true); optional_count_var = MakeTemporary(); } @@ -219,7 +219,7 @@ Fragment PrologueBuilder::BuildParameterHandling() { compiler::target::ArgumentsDescriptor::named_entry_size() / compiler::target::kCompressedWordSize); copy_args_prologue += LoadLocal(optional_count_vars_processed); - copy_args_prologue += SmiBinaryOp(Token::kMUL, /* truncate= */ true); + copy_args_prologue += SmiBinaryOp(Token::kMUL, /*is_truncating=*/true); LocalVariable* tuple_diff = MakeTemporary(); // Let's load position from arg descriptor (to see which parameter is the @@ -239,11 +239,11 @@ Fragment PrologueBuilder::BuildParameterHandling() { compiler::target::ArgumentsDescriptor::position_offset()) / compiler::target::kCompressedWordSize); good += LoadLocal(tuple_diff); - good += SmiBinaryOp(Token::kADD, /* truncate= */ true); + good += SmiBinaryOp(Token::kADD, /*is_truncating=*/true); good += LoadIndexed( kArrayCid, /*index_scale*/ compiler::target::kCompressedWordSize); } - good += SmiBinaryOp(Token::kSUB, /* truncate= */ true); + good += SmiBinaryOp(Token::kSUB, /*is_truncating=*/true); good += LoadFpRelativeSlot( compiler::target::kWordSize * compiler::target::frame_layout.param_end_from_fp, @@ -257,7 +257,7 @@ Fragment PrologueBuilder::BuildParameterHandling() { // Increase processed optional variable count. good += LoadLocal(optional_count_vars_processed); good += IntConstant(1); - good += SmiBinaryOp(Token::kADD, /* truncate= */ true); + good += SmiBinaryOp(Token::kADD, /*is_truncating=*/true); good += StoreLocalRaw(TokenPosition::kNoSource, optional_count_vars_processed); good += Drop(); @@ -275,7 +275,7 @@ Fragment PrologueBuilder::BuildParameterHandling() { compiler::target::ArgumentsDescriptor::name_offset()) / compiler::target::kCompressedWordSize); copy_args_prologue += LoadLocal(tuple_diff); - copy_args_prologue += SmiBinaryOp(Token::kADD, /* truncate= */ true); + copy_args_prologue += SmiBinaryOp(Token::kADD, /*is_truncating=*/true); copy_args_prologue += LoadIndexed( kArrayCid, /*index_scale*/ compiler::target::kCompressedWordSize); diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc index 188cbdb5138..e7ee046f022 100644 --- a/runtime/vm/compiler/frontend/scope_builder.cc +++ b/runtime/vm/compiler/frontend/scope_builder.cc @@ -310,8 +310,8 @@ ScopeBuildingResult* ScopeBuilder::BuildScopes() { Symbols::Value(), AbstractType::ZoneHandle(Z, function.ParameterTypeAt(pos)), LocalVariable::kNoKernelOffset, /*is_late=*/false, - /*inferred_type=*/nullptr, - /*inferred_arg_type=*/field.is_covariant() + /*inferred_type_md=*/nullptr, + /*inferred_arg_type_md=*/field.is_covariant() ? nullptr : &inferred_field_type); } else { diff --git a/runtime/vm/compiler/relocation_test.cc b/runtime/vm/compiler/relocation_test.cc index 3515c5e525c..600202c8e3e 100644 --- a/runtime/vm/compiler/relocation_test.cc +++ b/runtime/vm/compiler/relocation_test.cc @@ -60,7 +60,7 @@ struct RelocatorTestHelper { CodePtr AllocationInstruction(uintptr_t size) { const auto& instructions = Instructions::Handle(Instructions::New( - size, /*has_monomorphic=*/false, /*should_be_aligned=*/false)); + size, /*has_monomorphic_entry=*/false, /*should_be_aligned=*/false)); uword addr = instructions.PayloadStart(); for (uintptr_t i = 0; i < (size / 4); ++i) { @@ -223,7 +223,7 @@ struct RelocatorTestHelper { } auto& instructions = Instructions::Handle(Instructions::New( - size, /*has_monomorphic=*/false, /*should_be_aligned=*/false)); + size, /*has_monomorphic_entry=*/false, /*should_be_aligned=*/false)); { uword addr = instructions.PayloadStart(); for (intptr_t i = 0; i < commands->length(); ++i) { diff --git a/runtime/vm/compiler/stub_code_compiler.cc b/runtime/vm/compiler/stub_code_compiler.cc index dfe9ca4a4a7..5a79702041d 100644 --- a/runtime/vm/compiler/stub_code_compiler.cc +++ b/runtime/vm/compiler/stub_code_compiler.cc @@ -165,7 +165,7 @@ void StubCodeCompiler::GenerateInitLateStaticFieldStub() { } void StubCodeCompiler::GenerateInitLateFinalStaticFieldStub() { - GenerateInitLateStaticFieldStub(/*is_final=*/true, /*shared=*/false); + GenerateInitLateStaticFieldStub(/*is_final=*/true, /*is_shared=*/false); } void StubCodeCompiler::GenerateInitSharedLateStaticFieldStub() { @@ -173,7 +173,7 @@ void StubCodeCompiler::GenerateInitSharedLateStaticFieldStub() { } void StubCodeCompiler::GenerateInitSharedLateFinalStaticFieldStub() { - GenerateInitLateStaticFieldStub(/*is_final=*/true, /*shared=*/true); + GenerateInitLateStaticFieldStub(/*is_final=*/true, /*is_shared=*/true); } void StubCodeCompiler::GenerateInitInstanceFieldStub() { @@ -1365,7 +1365,7 @@ void StubCodeCompiler::GenerateAllocateGrowableArrayStub() { __ Comment("Inline allocation of GrowableList"); __ TryAllocateObject(kGrowableObjectArrayCid, instance_size, &slow_case, Assembler::kNearJump, AllocateObjectABI::kResultReg, - /*temp_reg=*/AllocateObjectABI::kTagsReg); + /*temp=*/AllocateObjectABI::kTagsReg); __ StoreIntoObjectNoBarrier( AllocateObjectABI::kResultReg, FieldAddress(AllocateObjectABI::kResultReg, @@ -2731,7 +2731,7 @@ void StubCodeCompiler::InsertBSSRelocation(BSS::Relocation reloc) { pc_descriptors_list_->AddDescriptor( UntaggedPcDescriptors::kBSSRelocation, pc_offset, /*deopt_id=*/DeoptId::kNone, - /*root_pos=*/TokenPosition::kNoSource, + /*token_pos=*/TokenPosition::kNoSource, /*try_index=*/-1, /*yield_index=*/UntaggedPcDescriptors::kInvalidYieldIndex); } diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc index 1f2632469af..749be9cf068 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm.cc @@ -3361,7 +3361,7 @@ void StubCodeCompiler::GenerateICCallThroughCodeStub() { __ b(&miss, EQ); const intptr_t entry_length = - target::ICData::TestEntryLengthFor(1, /*tracking_exactness=*/false) * + target::ICData::TestEntryLengthFor(1, /*exactness_check=*/false) * target::kWordSize; __ AddImmediate(R8, entry_length); // Next entry. __ b(&loop); diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc index 4cac18ca30e..1ee528d6353 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm64.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc @@ -2738,7 +2738,7 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub( if (optimized == kOptimized) { GenerateOptimizedUsageCounterIncrement(); } else { - GenerateUsageCounterIncrement(/*scratch=*/R6); + GenerateUsageCounterIncrement(/*temp_reg=*/R6); } ASSERT(num_args == 1 || num_args == 2); @@ -3777,7 +3777,7 @@ void StubCodeCompiler::GenerateICCallThroughCodeStub() { __ b(&miss, EQ); const intptr_t entry_length = - target::ICData::TestEntryLengthFor(1, /*tracking_exactness=*/false) * + target::ICData::TestEntryLengthFor(1, /*exactness_check=*/false) * target::kCompressedWordSize; __ AddImmediate(R8, entry_length); // Next entry. __ b(&loop); diff --git a/runtime/vm/compiler/stub_code_compiler_riscv.cc b/runtime/vm/compiler/stub_code_compiler_riscv.cc index 21ef47fc6c8..b8cbed3de04 100644 --- a/runtime/vm/compiler/stub_code_compiler_riscv.cc +++ b/runtime/vm/compiler/stub_code_compiler_riscv.cc @@ -2334,7 +2334,7 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub( if (optimized == kOptimized) { GenerateOptimizedUsageCounterIncrement(); } else { - GenerateUsageCounterIncrement(/*scratch=*/T0); + GenerateUsageCounterIncrement(/*temp_reg=*/T0); } ASSERT(num_args == 1 || num_args == 2); @@ -3280,7 +3280,7 @@ void StubCodeCompiler::GenerateICCallThroughCodeStub() { __ BranchIf(EQ, &miss); const intptr_t entry_length = - target::ICData::TestEntryLengthFor(1, /*tracking_exactness=*/false) * + target::ICData::TestEntryLengthFor(1, /*exactness_check=*/false) * target::kCompressedWordSize; __ AddImmediate(T1, entry_length); // Next entry. __ j(&loop); diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc index 631c5fea616..e80ee335af6 100644 --- a/runtime/vm/compiler/stub_code_compiler_x64.cc +++ b/runtime/vm/compiler/stub_code_compiler_x64.cc @@ -87,7 +87,7 @@ static void WithExceptionCatchingTrampoline(Assembler* assembler, // Save & Restore the volatile CPU registers across the setjmp() call. const RegisterSet volatile_registers( CallingConventions::kVolatileCpuRegisters & ~(1 << RAX), - /*fpu_registers=*/0); + /*fpu_register_mask=*/0); const Register kSavedRspReg = R12; COMPILE_ASSERT(IsCalleeSavedRegister(kSavedRspReg)); @@ -3673,7 +3673,7 @@ void StubCodeCompiler::GenerateICCallThroughCodeStub() { __ j(ZERO, &miss, Assembler::kNearJump); const intptr_t entry_length = - target::ICData::TestEntryLengthFor(1, /*tracking_exactness=*/false) * + target::ICData::TestEntryLengthFor(1, /*exactness_check=*/false) * target::kCompressedWordSize; __ addq(R13, Immediate(entry_length)); // Next entry. __ jmp(&loop); diff --git a/runtime/vm/compiler/write_barrier_elimination.cc b/runtime/vm/compiler/write_barrier_elimination.cc index dba363ec8b8..e9e790b222f 100644 --- a/runtime/vm/compiler/write_barrier_elimination.cc +++ b/runtime/vm/compiler/write_barrier_elimination.cc @@ -248,8 +248,7 @@ void WriteBarrierElimination::IndexDefinitions(Zone* zone) { if (auto phi_use = it.Current()->instruction()->AsPhi()) { const intptr_t index = Index(phi_use); if (!large_array_allocations.Get(index)) { - large_array_allocations.Set(index, - /*can_be_create_large_array=*/true); + large_array_allocations.Set(index, true); // Can be large array. create_array_worklist.Add(phi_use); } } diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index da748c1c621..d01a96cdf5a 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -3404,9 +3404,7 @@ static ObjectPtr ThrowArgumentError(const char* exception_message) { saved_exception = &Instance::Handle(raw_exception); } Exceptions::Throw(thread, *saved_exception); - const String& message = - String::Handle(String::New("Exception was not thrown, internal error")); - return ApiError::New(message); + UNREACHABLE(); } // TODO(sgjesse): value should always be smaller then 0xff. Add error handling. diff --git a/runtime/vm/elf.cc b/runtime/vm/elf.cc index f7493d29b1a..68735cf9909 100644 --- a/runtime/vm/elf.cc +++ b/runtime/vm/elf.cc @@ -91,10 +91,10 @@ class ElfSection : public ZoneAllocated { bool allocate, bool executable, bool writable, - intptr_t align = compiler::target::kWordSize) + intptr_t alignment = compiler::target::kWordSize) : type(t), flags(EncodeFlags(allocate, executable, writable)), - alignment(align), + alignment(alignment), // Non-segments will never have a memory offset, here represented by 0. memory_offset_(allocate ? kLinearInitValue : 0) { // Only SHT_NULL sections (namely, the reserved section) are allowed to have @@ -1290,7 +1290,7 @@ void ElfWriter::FinalizeEhFrame() { Dwarf::WriteCallFrameInformationRecords(&dwarf_stream, fdes); auto* const eh_frame = new (zone_) - BitsContainer(type_, /*writable=*/false, /*executable=*/false); + BitsContainer(type_, /*executable=*/false, /*writable=*/false); eh_frame->AddPortion(dwarf_stream.buffer(), dwarf_stream.bytes_written(), dwarf_stream.relocations()); section_table_->Add(eh_frame, ".eh_frame"); diff --git a/runtime/vm/ffi_callback_metadata.cc b/runtime/vm/ffi_callback_metadata.cc index be010604b20..9fd7ec1efdd 100644 --- a/runtime/vm/ffi_callback_metadata.cc +++ b/runtime/vm/ffi_callback_metadata.cc @@ -358,7 +358,7 @@ FfiCallbackMetadata::Trampoline FfiCallbackMetadata::CreateAsyncFfiCallback( Dart_Port send_port, MetadataEntry** list_head) { ASSERT(send_function.GetFfiCallbackKind() == FfiCallbackKind::kAsyncCallback); - return CreateMetadataEntry(isolate, /*isolate_group=*/nullptr, + return CreateMetadataEntry(isolate, /*target_isolate_group=*/nullptr, TrampolineType::kAsync, GetEntryPoint(zone, send_function), static_cast(send_port), list_head); diff --git a/runtime/vm/heap/freelist_test.cc b/runtime/vm/heap/freelist_test.cc index 4a038f7b225..9fe8ecd1a04 100644 --- a/runtime/vm/heap/freelist_test.cc +++ b/runtime/vm/heap/freelist_test.cc @@ -222,7 +222,7 @@ static void TestRegress38528(intptr_t header_overlap) { free_list->Free(blob->start(), alloc_size + remainder_size); blob->Protect(VirtualMemory::kReadExecute); // not writable - Allocate(free_list.get(), alloc_size, /*protected=*/true); + Allocate(free_list.get(), alloc_size, /*is_protected=*/true); VirtualMemory::Protect(blob->address(), alloc_size, VirtualMemory::kReadExecute); reinterpret_cast(other_code)(); diff --git a/runtime/vm/heap/safepoint.cc b/runtime/vm/heap/safepoint.cc index 2b25c7b65fb..97e562864a8 100644 --- a/runtime/vm/heap/safepoint.cc +++ b/runtime/vm/heap/safepoint.cc @@ -126,7 +126,7 @@ void SafepointHandler::SafepointThreads(Thread* T, SafepointLevel level) { for (auto main_port : oob_isolates) { Isolate::SendInternalLibMessage(main_port, Isolate::kCheckForReload, - /*ignored=*/-1); + /*capability=*/-1); } // Now wait for all threads that are not already at a safepoint to check-in. diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc index 193aa802b7f..b639d6d38c6 100644 --- a/runtime/vm/isolate_reload.cc +++ b/runtime/vm/isolate_reload.cc @@ -1177,7 +1177,7 @@ char* IsolateGroupReloadContext::CompileToKernel(bool force_reload, retval = KernelIsolate::CompileToKernel( root_lib_url, nullptr, 0, modified_scripts_count, modified_scripts, /*incremental_compile=*/true, - /*snapshot_compile=*/false, + /*for_snapshot=*/false, /*embed_sources=*/true, /*package_config=*/nullptr, /*multiroot_filepaths=*/nullptr, diff --git a/runtime/vm/mach_o.cc b/runtime/vm/mach_o.cc index 5c1b0927798..027cdc38052 100644 --- a/runtime/vm/mach_o.cc +++ b/runtime/vm/mach_o.cc @@ -2556,12 +2556,15 @@ void MachOSymbolTable::Initialize(const GrowableArray& sections, intptr_t offset, intptr_t size, bool is_global) { switch (type) { case Type::Function: { - AddSymbol("", mach_o::N_BNSYM, section_index, /*desc=*/0, offset); - AddSymbol(name, mach_o::N_FUN, section_index, /*desc=*/0, offset); + AddSymbol("", mach_o::N_BNSYM, section_index, /*description=*/0, + offset); + AddSymbol(name, mach_o::N_FUN, section_index, /*description=*/0, + offset); // The size is output as an unnamed N_FUN symbol with no section // following the actual N_FUN symbol. - AddSymbol("", mach_o::N_FUN, mach_o::NO_SECT, /*desc=*/0, size); - AddSymbol("", mach_o::N_ENSYM, section_index, /*desc=*/0, + AddSymbol("", mach_o::N_FUN, mach_o::NO_SECT, /*description=*/0, + size); + AddSymbol("", mach_o::N_ENSYM, section_index, /*description=*/0, offset + size); break; @@ -2569,11 +2572,12 @@ void MachOSymbolTable::Initialize(const GrowableArray& sections, case Type::Section: case Type::Object: { if (is_global) { - AddSymbol(name, mach_o::N_GSYM, mach_o::NO_SECT, /*desc=*/0, + AddSymbol(name, mach_o::N_GSYM, mach_o::NO_SECT, + /*description=*/0, /*value=*/0); } else { AddSymbol(name, mach_o::N_STSYM, section_index, - /*desc=*/0, offset); + /*description=*/0, offset); } break; } diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc index 9be103c69a0..b42df9b136a 100644 --- a/runtime/vm/message_handler.cc +++ b/runtime/vm/message_handler.cc @@ -459,7 +459,7 @@ void MessageHandler::TaskCallback() { PausedOnExitLocked(&ml, true); // More messages may have come in while we released the monitor. status = HandleMessages(&ml, /*allow_normal_messages=*/false, - /*allow_multiple_normal_messagesfalse=*/false); + /*allow_multiple_normal_messages=*/false); if (ShouldPauseOnExit(status)) { // Still paused. ASSERT(oob_queue_->IsEmpty()); diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index ece07b0adb3..8706b7406ba 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -2655,7 +2655,7 @@ ErrorPtr Object::Init(IsolateGroup* isolate_group, isolate_group); cls = Class::New(kByteBufferCid, isolate_group, - /*register_isolate_group=*/false); + /*register_class=*/false); cls.set_instance_size_in_words(0, 0); isolate_group->class_table()->Register(cls); @@ -11890,10 +11890,7 @@ void Function::SetDeoptReasonForAll(intptr_t deopt_id, } bool Function::CheckSourceFingerprint(int32_t fp, const char* kind) const { -#if !defined(DEBUG) - return true; // Only check on debug. -#endif - +#if defined(DEBUG) #if !defined(DART_PRECOMPILED_RUNTIME) // Check that the function is marked as recognized via the vm:recognized // pragma. This is so that optimizations that change the signature will know @@ -11922,6 +11919,7 @@ bool Function::CheckSourceFingerprint(int32_t fp, const char* kind) const { THR_Print("s/0x%08x/0x%08x/\n", fp, SourceFingerprint()); return false; } +#endif // defined(DEBUG) return true; } diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc index a01b8314174..97b5ee6c998 100644 --- a/runtime/vm/object_test.cc +++ b/runtime/vm/object_test.cc @@ -5680,10 +5680,11 @@ TEST_CASE(DeoptimizeFramesWhenSettingBreakpoint) { Dart_Isolate parent = Dart_CurrentIsolate(); Dart_ExitIsolate(); char* error = nullptr; - Dart_Isolate child = Dart_CreateIsolateInGroup(parent, "child", - /*shutdown_callback=*/nullptr, - /*cleanup_callback=*/nullptr, - /*peer=*/nullptr, &error); + Dart_Isolate child = + Dart_CreateIsolateInGroup(parent, "child", + /*shutdown_callback=*/nullptr, + /*cleanup_callback=*/nullptr, + /*child_isolate_data=*/nullptr, &error); EXPECT_NE(nullptr, child); EXPECT_EQ(nullptr, error); Dart_ExitIsolate(); @@ -5796,10 +5797,11 @@ TEST_CASE(DartAPI_BreakpointLockRace) { Dart_Isolate parent = Dart_CurrentIsolate(); Dart_ExitIsolate(); char* error = nullptr; - Dart_Isolate child = Dart_CreateIsolateInGroup(parent, "child", - /*shutdown_callback=*/nullptr, - /*cleanup_callback=*/nullptr, - /*peer=*/nullptr, &error); + Dart_Isolate child = + Dart_CreateIsolateInGroup(parent, "child", + /*shutdown_callback=*/nullptr, + /*cleanup_callback=*/nullptr, + /*child_isolate_data=*/nullptr, &error); EXPECT_NE(nullptr, child); EXPECT_EQ(nullptr, error); Dart_ExitIsolate(); diff --git a/runtime/vm/regexp/regexp.cc b/runtime/vm/regexp/regexp.cc index 501924b7354..fcc979896ba 100644 --- a/runtime/vm/regexp/regexp.cc +++ b/runtime/vm/regexp/regexp.cc @@ -4464,7 +4464,7 @@ RegExpNode* RegExpAssertion::ToNode(RegExpCompiler* compiler, RegExpCharacterClass* newline_atom = new RegExpCharacterClass('n', RegExpFlags()); TextNode* newline_matcher = - new TextNode(newline_atom, /*read_backwards=*/false, + new TextNode(newline_atom, /*read_backward=*/false, ActionNode::PositiveSubmatchSuccess( stack_pointer_register, position_register, 0, // No captures inside. @@ -5350,7 +5350,7 @@ RegExpEngine::CompilationResult RegExpEngine::CompileIR( first_step_node->AddAlternative(GuardedAlternative(captured_body)); first_step_node->AddAlternative(GuardedAlternative(new (zone) TextNode( new (zone) RegExpCharacterClass('*', RegExpFlags()), - /*read_backwards=*/false, loop_node))); + /*read_backward=*/false, loop_node))); node = first_step_node; } else { node = loop_node; @@ -5460,7 +5460,7 @@ RegExpEngine::CompilationResult RegExpEngine::CompileBytecode( first_step_node->AddAlternative(GuardedAlternative(captured_body)); first_step_node->AddAlternative(GuardedAlternative(new (zone) TextNode( new (zone) RegExpCharacterClass('*', RegExpFlags()), - /*read_backwards=*/false, loop_node))); + /*read_backward=*/false, loop_node))); node = first_step_node; } else { node = loop_node; diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc index 36a1217cce8..85bdaed361f 100644 --- a/runtime/vm/service.cc +++ b/runtime/vm/service.cc @@ -1653,7 +1653,7 @@ static void ActOnIsolateGroup(JSONStream* js, IsolateGroup::RunWithIsolateGroup( isolate_group_id, [&visitor](IsolateGroup* isolate_group) { visitor(isolate_group); }, - /*if_not_found=*/[&js]() { PrintSentinel(js, kExpiredSentinel); }); + /*not_found=*/[&js]() { PrintSentinel(js, kExpiredSentinel); }); } static void GetIsolateGroup(Thread* thread, JSONStream* js) { diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc index 5258c7db4c9..42010528057 100644 --- a/runtime/vm/thread.cc +++ b/runtime/vm/thread.cc @@ -1682,7 +1682,8 @@ NoReloadScope::~NoReloadScope() { if (isolate != nullptr && Thread::IsSafepointLevelRequested( state, SafepointLevel::kGCAndDeoptAndReload)) { - isolate->SendInternalLibMessage(Isolate::kCheckForReload, /*ignored=*/-1); + isolate->SendInternalLibMessage(Isolate::kCheckForReload, + /*capability=*/-1); } } #endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) diff --git a/runtime/vm/type_testing_stubs.cc b/runtime/vm/type_testing_stubs.cc index 93d44fa74f3..e5ffc16ef53 100644 --- a/runtime/vm/type_testing_stubs.cc +++ b/runtime/vm/type_testing_stubs.cc @@ -487,7 +487,7 @@ static CheckType SubtypeChecksForClass(Zone* zone, return CheckType::kCidCheckOnly; } if (to_check.FindInstantiationOf(zone, type_class, - /*only_super_classes=*/true)) { + /*consider_only_super_classes=*/true)) { // No need to check for type argument consistency, as [to_check] is the same // as or a subclass of [type_class]. return to_check.is_finalized() @@ -659,7 +659,7 @@ void TypeTestingStubGenerator:: // c) Then we'll check each value of the type argument. compiler::Label pop_saved_registers_on_failure; const RegisterSet saved_registers( - TTSInternalRegs::kSavedTypeArgumentRegisters, /*fpu_registers=*/0); + TTSInternalRegs::kSavedTypeArgumentRegisters, /*fpu_register_mask=*/0); __ PushRegisters(saved_registers); AbstractType& type_arg = AbstractType::Handle();