1 /** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef PANDA_RUNTIME_OBJECT_ACCESSOR_IMPL_CPP_ 16 #define PANDA_RUNTIME_OBJECT_ACCESSOR_IMPL_CPP_ 17 // This file is included by interpreter to inline methods that defined in it. 18 // We don't move them to object_accessor-inl.h because including runtime.h 19 // will lead to circular header dependences. 20 21 #include "runtime/include/object_accessor-inl.h" 22 #include "runtime/include/runtime.h" 23 #include "runtime/include/panda_vm.h" 24 25 namespace panda { 26 27 /* static */ 28 #ifndef PANDA_RUNTIME_OBJECT_ACCESSOR_CPP_ 29 inline 30 #endif 31 mem::GCBarrierSet * GetBarrierSet()32 ObjectAccessor::GetBarrierSet() 33 { 34 return Thread::GetCurrent()->GetBarrierSet(); 35 } 36 37 /* static */ 38 #ifndef PANDA_RUNTIME_OBJECT_ACCESSOR_CPP_ 39 inline 40 #endif 41 mem::GCBarrierSet * GetBarrierSet(const ManagedThread * thread)42 ObjectAccessor::GetBarrierSet(const ManagedThread *thread) 43 { 44 return thread->GetBarrierSet(); 45 } 46 47 /* static */ 48 #ifndef PANDA_RUNTIME_OBJECT_ACCESSOR_CPP_ 49 inline 50 #endif 51 mem::BarrierType GetPreBarrierType(const ManagedThread * thread)52 ObjectAccessor::GetPreBarrierType(const ManagedThread *thread) 53 { 54 return thread->GetPreBarrierType(); 55 } 56 57 /* static */ 58 #ifndef PANDA_RUNTIME_OBJECT_ACCESSOR_CPP_ 59 inline 60 #endif 61 mem::BarrierType GetPostBarrierType(const ManagedThread * thread)62 ObjectAccessor::GetPostBarrierType(const ManagedThread *thread) 63 { 64 return thread->GetPostBarrierType(); 65 } 66 67 } // namespace panda 68 69 #endif // PANDA_RUNTIME_OBJECT_ACCESSOR_IMPL_CPP_ 70