/src/hermes/include/hermes/VM/RuntimeModule-inline.h
Line | Count | Source (jump to first uncovered line) |
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_RUNTIMEMODULE_INLINE_H |
9 | | #define HERMES_VM_RUNTIMEMODULE_INLINE_H |
10 | | |
11 | | #include "hermes/VM/Runtime.h" |
12 | | #include "hermes/VM/WeakRoot-inline.h" |
13 | | |
14 | | namespace hermes { |
15 | | namespace vm { |
16 | | |
17 | 6.33k | inline Handle<Domain> RuntimeModule::getDomain(Runtime &runtime) { |
18 | 6.33k | return runtime.makeHandle(getDomainUnsafe(runtime)); |
19 | 6.33k | } |
20 | | |
21 | 6.33k | inline Domain *RuntimeModule::getDomainUnsafe(Runtime &runtime) { |
22 | 6.33k | Domain *domain = domain_.get(runtime_, runtime_.getHeap()); |
23 | 6.33k | assert(domain && "RuntimeModule has an invalid Domain"); |
24 | 6.33k | return domain; |
25 | 6.33k | } |
26 | | |
27 | 0 | inline Domain *RuntimeModule::getDomainForSamplingProfiler(PointerBase &base) { |
28 | | // Do not use a read barrier here, as this is called from the SamplingProfiler |
29 | | // signal handler. The signal handler may have interrupted another read/write |
30 | | // barrier, which the GC isn't prepared to handle. Don't use this anywhere |
31 | | // else. |
32 | 0 | Domain *domain = domain_.getNoBarrierUnsafe(runtime_); |
33 | 0 | assert(domain && "RuntimeModule has an invalid Domain"); |
34 | 0 | return domain; |
35 | 0 | } |
36 | | |
37 | | } // namespace vm |
38 | | } // namespace hermes |
39 | | |
40 | | #endif |