/src/hermes/include/hermes/VM/WeakRoot-inline.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) Meta Platforms, Inc. and affiliates. |
3 | | * |
4 | | * This source code is licensed under the MIT license found in the |
5 | | * LICENSE file in the root directory of this source tree. |
6 | | */ |
7 | | |
8 | | #ifndef HERMES_VM_WEAKROOT_INLINE_H |
9 | | #define HERMES_VM_WEAKROOT_INLINE_H |
10 | | |
11 | | #include "hermes/VM/GC.h" |
12 | | #include "hermes/VM/WeakRoot.h" |
13 | | |
14 | | namespace hermes { |
15 | | namespace vm { |
16 | | |
17 | 4.79k | GCCell *WeakRootBase::get(PointerBase &base, GC &gc) const { |
18 | 4.79k | if (!*this) |
19 | 264 | return nullptr; |
20 | 4.53k | return getNonNull(base, gc); |
21 | 4.79k | } |
22 | | |
23 | 577k | GCCell *WeakRootBase::getNonNull(PointerBase &base, GC &gc) const { |
24 | 577k | GCCell *ptr = CompressedPointer::getNonNull(base); |
25 | 577k | gc.weakRefReadBarrier(ptr); |
26 | 577k | return ptr; |
27 | 577k | } |
28 | | |
29 | | template <typename T> |
30 | 573k | T *WeakRoot<T>::getNonNull(PointerBase &base, GC &gc) const { |
31 | 573k | return static_cast<T *>(WeakRootBase::getNonNull(base, gc)); |
32 | 573k | } |
33 | | |
34 | | template <typename T> |
35 | 4.79k | T *WeakRoot<T>::get(PointerBase &base, GC &gc) const { |
36 | 4.79k | return static_cast<T *>(WeakRootBase::get(base, gc)); |
37 | 4.79k | } Unexecuted instantiation: hermes::vm::WeakRoot<hermes::vm::JSObject>::get(hermes::vm::PointerBase&, hermes::vm::HadesGC&) const hermes::vm::WeakRoot<hermes::vm::Domain>::get(hermes::vm::PointerBase&, hermes::vm::HadesGC&) const Line | Count | Source | 35 | 4.53k | T *WeakRoot<T>::get(PointerBase &base, GC &gc) const { | 36 | 4.53k | return static_cast<T *>(WeakRootBase::get(base, gc)); | 37 | 4.53k | } |
hermes::vm::WeakRoot<hermes::vm::HiddenClass>::get(hermes::vm::PointerBase&, hermes::vm::HadesGC&) const Line | Count | Source | 35 | 264 | T *WeakRoot<T>::get(PointerBase &base, GC &gc) const { | 36 | 264 | return static_cast<T *>(WeakRootBase::get(base, gc)); | 37 | 264 | } |
|
38 | | |
39 | | } // namespace vm |
40 | | } // namespace hermes |
41 | | |
42 | | #endif |