!10282 ai 代码检视告警清除

Merge pull request !10282 from caolili123/master
This commit is contained in:
openharmony_ci 2024-11-19 00:40:26 +00:00 committed by Gitee
commit 3914589dbb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 7 additions and 3 deletions

View File

@ -433,6 +433,7 @@ void GCStats::RecordStatisticBeforeGC(TriggerGCType gcType, GCReason reason)
void GCStats::RecordStatisticAfterGC()
{
ASSERT(heap_ != nullptr);
SetRecordData(RecordData::END_OBJ_SIZE, heap_->GetHeapObjectSize());
SetRecordData(RecordData::END_COMMIT_SIZE, heap_->GetCommittedSize());

View File

@ -21,6 +21,7 @@
namespace panda::ecmascript {
MemController::MemController(Heap *heap) : heap_(heap), allocTimeMs_(GetSystemTimeInMs())
{
ASSERT(heap != nullptr);
minAllocLimitGrowingStep_ = heap->GetEcmaVM()->GetEcmaParamConfiguration().GetMinAllocLimitGrowingStep();
}
@ -209,6 +210,7 @@ void MemController::StopCalculationAfterGC(TriggerGCType gcType)
void MemController::RecordAfterConcurrentMark(MarkType markType, const ConcurrentMarker *marker)
{
ASSERT(marker != nullptr);
double duration = marker->GetDuration();
if (markType == MarkType::MARK_FULL) {
recordedConcurrentMarks_.Push(MakeBytesAndDuration(marker->GetHeapObjectSize(), duration));

View File

@ -21,6 +21,7 @@ namespace panda::ecmascript {
RegExpCachedChunk::RegExpCachedChunk(JSThread *JSThread) : jsThread_(JSThread)
{
ASSERT(jsThread_ != nullptr);
allocator_ = jsThread_->GetNativeAreaAllocator();
currentArea_ = jsThread_->GetOrCreateRegExpCache();
ptr_ = currentArea_->GetBegin();

View File

@ -120,7 +120,7 @@ void VerifyObjectVisitor::VerifyObjectSlotLegal(ObjectSlot slot, TaggedObject *o
LogErrorForObjSlot(heap_, "Heap verify detected an invalid value.",
object, slot, value.GetTaggedWeakRef());
}
if (!heap_->IsAlive(value.GetTaggedWeakRef())) {
if (!heap_->IsAlive(value.GetTaggedWeakRef()) && failCount_ != nullptr) {
LogErrorForObjSlot(heap_, "Heap verify detected a dead weak object.",
object, slot, value.GetTaggedWeakRef());
++(*failCount_);
@ -139,7 +139,7 @@ void VerifyObjectVisitor::VerifyHeapObjectSlotLegal(ObjectSlot slot,
LogErrorForObjSlot(heap_, "Heap verify detected an invalid value.",
object, slot, slotValue.GetTaggedObject());
}
if (!heap_->IsAlive(slotValue.GetTaggedObject())) {
if (!heap_->IsAlive(slotValue.GetTaggedObject()) && failCount_ != nullptr) {
LogErrorForObjSlot(heap_, "Heap verify detected a dead object.",
object, slot, slotValue.GetTaggedObject());
++(*failCount_);
@ -417,7 +417,7 @@ void VerifyObjectVisitor::operator()(TaggedObject *obj, JSTaggedValue value)
TaggedObject *object = value.GetRawTaggedObject();
auto region = Region::ObjectAddressToRange(object);
if (region->InGeneralOldSpace()) { // LCOV_EXCL_START
if (region->InGeneralOldSpace() && failCount_ != nullptr) { // LCOV_EXCL_START
LOG_GC(ERROR) << "Heap object(" << slot.GetTaggedType() << ") old to new rset fail: value("
<< slot.GetTaggedObject() << "/"
<< JSHClass::DumpJSType(slot.GetTaggedObject()->GetClass()->GetObjectType())