/** * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "runtime/mem/gc/epsilon/epsilon.h" #include "libpandabase/utils/logger.h" #include "runtime/include/runtime.h" #include "runtime/include/panda_vm.h" namespace panda::mem { template EpsilonGC::EpsilonGC(ObjectAllocatorBase *object_allocator, const GCSettings &settings) : GCLang(object_allocator, settings) { this->SetType(GCType::EPSILON_GC); } template void EpsilonGC::InitializeImpl() { InternalAllocatorPtr allocator = this->GetInternalAllocator(); auto barrier_set = allocator->New(allocator); ASSERT(barrier_set != nullptr); this->SetGCBarrierSet(barrier_set); LOG(DEBUG, GC) << "Epsilon GC initialized..."; } template void EpsilonGC::RunPhasesImpl([[maybe_unused]] GCTask &task) { LOG(DEBUG, GC) << "Epsilon GC RunPhases..."; GCScopedPauseStats scoped_pause_stats(this->GetPandaVm()->GetGCStats()); } // NOLINTNEXTLINE(misc-unused-parameters) template void EpsilonGC::WaitForGC([[maybe_unused]] GCTask task) { } template void EpsilonGC::InitGCBits([[maybe_unused]] panda::ObjectHeader *obj_header) { } template void EpsilonGC::InitGCBitsForAllocationInTLAB([[maybe_unused]] panda::ObjectHeader *obj_header) { LOG(FATAL, GC) << "TLABs are not supported by this GC"; } template void EpsilonGC::Trigger() { } template void EpsilonGC::MarkObject(ObjectHeader *object) { object->SetMarkedForGC(); } template bool EpsilonGC::IsMarked(const ObjectHeader *object) const { return object->IsMarkedForGC(); } template void EpsilonGC::MarkReferences([[maybe_unused]] GCMarkingStackType *references, [[maybe_unused]] GCPhase gc_phase) { } TEMPLATE_CLASS_LANGUAGE_CONFIG(EpsilonGC); } // namespace panda::mem