• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2023-2024 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 
16 #ifndef RUNTIME_MEM_OBJECT_VMHANDLE_INL_H
17 #define RUNTIME_MEM_OBJECT_VMHANDLE_INL_H
18 
19 #include "runtime/mem/vm_handle.h"
20 #include "runtime/mem/local_object_handle.h"
21 #include "runtime/mem/refstorage/global_object_storage.h"
22 
23 namespace ark {
24 
25 template <typename T>
26 template <typename P, typename>
VMHandle(const LocalObjectHandle<P> & other)27 inline VMHandle<T>::VMHandle(const LocalObjectHandle<P> &other) : HandleBase(other.GetAddress())
28 {
29 }
30 
31 template <typename T>
VMHandle(mem::GlobalObjectStorage * globalStorage,mem::Reference * reference)32 inline VMHandle<T>::VMHandle(mem::GlobalObjectStorage *globalStorage, mem::Reference *reference)
33     : HandleBase(globalStorage->GetAddressForRef(reference))
34 {
35     ASSERT(reference != nullptr);
36 }
37 
38 }  // namespace ark
39 
40 #endif  // RUNTIME_MEM_OBJECT_VMHANDLE_INL_H
41