cleancode-z

Issue:#IADK36

description:cleancode

Signed-off-by: zy <zy15615632452@163.com>
This commit is contained in:
zy 2024-07-17 10:32:40 +08:00
parent b10b6d5f17
commit 0214cebab3
6 changed files with 9 additions and 6 deletions

View File

@ -2084,7 +2084,7 @@ void GraphColorRegAllocator::LocalRaForEachUseOperand(const Insn &insn, LocalReg
if (base != nullptr) {
HandleLocalReg(*base, localRa, bbInfo, false, true);
}
if (!memOpnd.IsIntactIndexed()) {
if (!memOpnd.IsIntactIndexed() && base != nullptr) {
HandleLocalReg(*base, localRa, bbInfo, true, true);
}
if (offset != nullptr) {

View File

@ -1686,6 +1686,7 @@ void Emitter::EmitIntConst(const MIRSymbol &mirSymbol, MIRAggConst &aggConst, ui
EmitScalarConstant(*elemConst, false);
}
#else
ASSERT_NOT_NULL(elemConst);
EmitScalarConstant(*elemConst, false);
#endif /* USE_32BIT_REF */
Emit("\n");

View File

@ -760,8 +760,10 @@ void AddroffuncNode::Dump(int32) const
LogInfo::MapleLogger() << kOpcodeInfo.GetTableItemAt(GetOpCode()).name << " " << GetPrimTypeName(GetPrimType());
MIRFunction *func = GlobalTables::GetFunctionTable().GetFunctionFromPuidx(puIdx);
CHECK_FATAL(func != nullptr, "null ptr");
LogInfo::MapleLogger() << " &"
<< GlobalTables::GetGsymTable().GetSymbolFromStidx(func->GetStIdx().Idx())->GetName();
MIRSymbol *symbol = GlobalTables::GetGsymTable().GetSymbolFromStidx(func->GetStIdx().Idx());
if (symbol != nullptr) {
LogInfo::MapleLogger() << " &" << symbol->GetName();
}
}
void AddroflabelNode::Dump(int32) const

View File

@ -198,7 +198,7 @@ JSFunction *JitCompilationEnv::GetJsFunctionByMethodOffset(uint32_t methodOffset
} while (calleeOffset != currMethodOffset);
JSFunction *currFunc = *jsFunction_;
ProfileTypeInfo *currFuncPTI = *profileTypeInfo_;
for (int i = funcSlotChain.size() - 1; i >= 0; --i) {
for (int i = static_cast<int>(funcSlotChain.size()) - 1; i >= 0; --i) {
uint32_t slotId = funcSlotChain[i].first;
uint32_t callerOffset = funcSlotChain[i].second;
if (Method::Cast(currFunc->GetMethod())->GetMethodId().GetOffset() != callerOffset) {

View File

@ -361,7 +361,7 @@ void JITProfiler::ConvertCall(uint32_t slotId, long bcOffset)
} else if (slotValue.IsJSFunction()) {
JSFunction *callee = JSFunction::Cast(slotValue);
Method *calleeMethod = Method::Cast(callee->GetMethod());
calleeMethodId = calleeMethod->GetMethodId().GetOffset();
calleeMethodId = static_cast<int>(calleeMethod->GetMethodId().GetOffset());
calleeAbcId = PGOProfiler::GetMethodAbcId(callee);
static_cast<JitCompilationEnv *>(compilationEnv_)
->UpdateFuncSlotIdMap(calleeMethodId, methodId_.GetOffset(), slotId);

View File

@ -52,7 +52,7 @@ public:
{
LockHolder lock(jitTaskPoolMutex_);
compilerVm_ = vm;
threadId_ = compilerVm_->GetJSThread()->GetThreadId();
threadId_ = static_cast<int32_t>(compilerVm_->GetJSThread()->GetThreadId());
jitTaskPoolCV_.SignalAll();
}