!8400 Fix SetWaterLineWithoutGC data race

Merge pull request !8400 from dingwen/waterline_br
This commit is contained in:
openharmony_ci 2024-07-30 15:31:56 +00:00 committed by Gitee
commit ee5e505013
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 0 additions and 20 deletions

View File

@ -2130,7 +2130,6 @@ void Heap::NotifyFinishColdStart(bool isMainThread)
static_cast<int64_t>(config_.GetOldSpaceStepOvershootSize()) - semiRemainSize;
// overshoot size should be larger than 0.
GetNewSpace()->SetOverShootSize(std::max(overshootSize, (int64_t)0));
GetNewSpace()->SetWaterLineWithoutGC();
if (isMainThread && CheckCanTriggerConcurrentMarking()) {
markType_ = MarkType::MARK_FULL;
@ -2172,7 +2171,6 @@ void Heap::HandleExitHighSensitiveEvent()
static_cast<int64_t>(config_.GetOldSpaceStepOvershootSize()) - semiRemainSize;
// overshoot size should be larger than 0.
GetNewSpace()->SetOverShootSize(std::max(overshootSize, (int64_t)0));
GetNewSpace()->SetWaterLineWithoutGC();
// fixme: IncrementalMarking and IdleCollection is currently not enabled
TryTriggerIncrementalMarking();

View File

@ -417,23 +417,6 @@ void SemiSpace::SetWaterLine()
}
}
void SemiSpace::SetWaterLineWithoutGC()
{
waterLine_ = allocator_.GetTop();
Region *last = GetCurrentRegion();
if (last != nullptr) {
last->SetGCFlag(RegionGCFlags::HAS_AGE_MARK);
EnumerateRegions([&last](Region *current) {
if (current != last) {
current->SetGCFlag(RegionGCFlags::BELOW_AGE_MARK);
}
});
survivalObjectSize_ += allocateAfterLastGC_;
}
allocateAfterLastGC_ = 0;
}
size_t SemiSpace::GetHeapObjectSize() const
{
return survivalObjectSize_ + allocateAfterLastGC_;

View File

@ -145,7 +145,6 @@ public:
void SetOverShootSize(size_t size);
bool AdjustCapacity(size_t allocatedSizeSinceGC, JSThread *thread);
void SetWaterLine();
void SetWaterLineWithoutGC();
uintptr_t GetWaterLine() const
{