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) { if (base != nullptr) {
HandleLocalReg(*base, localRa, bbInfo, false, true); HandleLocalReg(*base, localRa, bbInfo, false, true);
} }
if (!memOpnd.IsIntactIndexed()) { if (!memOpnd.IsIntactIndexed() && base != nullptr) {
HandleLocalReg(*base, localRa, bbInfo, true, true); HandleLocalReg(*base, localRa, bbInfo, true, true);
} }
if (offset != nullptr) { if (offset != nullptr) {

View File

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

View File

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

View File

@ -198,7 +198,7 @@ JSFunction *JitCompilationEnv::GetJsFunctionByMethodOffset(uint32_t methodOffset
} while (calleeOffset != currMethodOffset); } while (calleeOffset != currMethodOffset);
JSFunction *currFunc = *jsFunction_; JSFunction *currFunc = *jsFunction_;
ProfileTypeInfo *currFuncPTI = *profileTypeInfo_; 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 slotId = funcSlotChain[i].first;
uint32_t callerOffset = funcSlotChain[i].second; uint32_t callerOffset = funcSlotChain[i].second;
if (Method::Cast(currFunc->GetMethod())->GetMethodId().GetOffset() != callerOffset) { 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()) { } else if (slotValue.IsJSFunction()) {
JSFunction *callee = JSFunction::Cast(slotValue); JSFunction *callee = JSFunction::Cast(slotValue);
Method *calleeMethod = Method::Cast(callee->GetMethod()); Method *calleeMethod = Method::Cast(callee->GetMethod());
calleeMethodId = calleeMethod->GetMethodId().GetOffset(); calleeMethodId = static_cast<int>(calleeMethod->GetMethodId().GetOffset());
calleeAbcId = PGOProfiler::GetMethodAbcId(callee); calleeAbcId = PGOProfiler::GetMethodAbcId(callee);
static_cast<JitCompilationEnv *>(compilationEnv_) static_cast<JitCompilationEnv *>(compilationEnv_)
->UpdateFuncSlotIdMap(calleeMethodId, methodId_.GetOffset(), slotId); ->UpdateFuncSlotIdMap(calleeMethodId, methodId_.GetOffset(), slotId);

View File

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