#include <ffi_callback_metadata.h>
Definition at line 33 of file ffi_callback_metadata.h.
◆ Trampoline
◆ RuntimeFunctions
Enumerator |
---|
kGetFfiCallbackMetadata | |
kExitTemporaryIsolate | |
kNumRuntimeFunctions | |
Definition at line 46 of file ffi_callback_metadata.h.
◆ TrampolineType
Enumerator |
---|
kSync | |
kSyncStackDelta4 | |
kAsync | |
Definition at line 40 of file ffi_callback_metadata.h.
40 : uint8_t {
41 kSync = 0,
42 kSyncStackDelta4 = 1,
43 kAsync = 2,
44 };
◆ Cleanup()
void dart::FfiCallbackMetadata::Cleanup |
( |
| ) |
|
|
static |
◆ CreateAsyncFfiCallback()
Definition at line 316 of file ffi_callback_metadata.cc.
321 {
324 GetEntryPoint(zone, send_function),
325 static_cast<uint64_t>(send_port), list_head);
326}
◆ CreateIsolateLocalFfiCallback()
Definition at line 270 of file ffi_callback_metadata.cc.
274 {
276
277
280 return CreateSyncFfiCallbackImpl(isolate, zone,
function,
nullptr,
281 list_head);
282 } else {
285 return CreateSyncFfiCallbackImpl(isolate, zone,
function,
286 CreatePersistentHandle(isolate,
closure),
287 list_head);
288 }
289}
Dart_NativeFunction function
@ kIsolateLocalClosureCallback
@ kIsolateLocalStaticCallback
std::function< void()> closure
◆ DeleteAllCallbacks()
void dart::FfiCallbackMetadata::DeleteAllCallbacks |
( |
Metadata ** |
list_head | ) |
|
Definition at line 222 of file ffi_callback_metadata.cc.
222 {
223 MutexLocker locker(&lock_);
224 for (Metadata* entry = *list_head; entry != nullptr;) {
225 Metadata*
next = entry->list_next();
226 DeleteCallbackLocked(entry);
228 }
229 *list_head = nullptr;
230}
static float next(float f)
◆ DeleteCallback()
void dart::FfiCallbackMetadata::DeleteCallback |
( |
Trampoline |
trampoline, |
|
|
Metadata ** |
list_head |
|
) |
| |
Definition at line 232 of file ffi_callback_metadata.cc.
233 {
234 MutexLocker locker(&lock_);
237 auto*
prev = entry->list_prev_;
238 auto*
next = entry->list_next_;
239 if (
prev !=
nullptr) {
241 } else {
242 ASSERT(*list_head == entry);
244 }
245 if (
next !=
nullptr) {
247 }
248 DeleteCallbackLocked(entry);
249}
static float prev(float f)
◆ Init()
void dart::FfiCallbackMetadata::Init |
( |
| ) |
|
|
static |
◆ Instance()
◆ lock()
Mutex * dart::FfiCallbackMetadata::lock |
( |
| ) |
|
|
inline |
◆ LookupMetadataForTrampoline()
◆ MappingAlignment()
static constexpr intptr_t dart::FfiCallbackMetadata::MappingAlignment |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ MappingSize()
static constexpr intptr_t dart::FfiCallbackMetadata::MappingSize |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ MappingStart()
static constexpr intptr_t dart::FfiCallbackMetadata::MappingStart |
( |
uword |
address | ) |
|
|
inlinestaticconstexpr |
◆ MetadataOffset()
static constexpr intptr_t dart::FfiCallbackMetadata::MetadataOffset |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ MetadataOfTrampoline()
Definition at line 342 of file ffi_callback_metadata.cc.
343 {
344#if defined(DART_TARGET_OS_FUCHSIA)
345
346
347 const uword page_start =
351 (trampoline - offset_of_first_trampoline_in_page_ - page_start) /
352 kNativeCallbackTrampolineSize;
354 Metadata* metadata_table = reinterpret_cast<Metadata*>(
356 return metadata_table + index;
357#else
361 (trampoline -
start - offset_of_first_trampoline_in_page_) /
362 kNativeCallbackTrampolineSize;
363 return &metadatas[index];
364#endif
365}
static constexpr T RoundDown(T x, intptr_t alignment)
static intptr_t PageSize()
◆ NumCallbackTrampolinesPerPage()
static constexpr intptr_t dart::FfiCallbackMetadata::NumCallbackTrampolinesPerPage |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ RuntimeFunctionOffset()
static constexpr uword dart::FfiCallbackMetadata::RuntimeFunctionOffset |
( |
uword |
function_index | ) |
|
|
inlinestaticconstexpr |
◆ RWMappingSize()
static constexpr intptr_t dart::FfiCallbackMetadata::RWMappingSize |
( |
| ) |
|
|
inlinestaticconstexpr |
Definition at line 226 of file ffi_callback_metadata.h.
226 {
231 }
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
◆ RXMappingSize()
static constexpr intptr_t dart::FfiCallbackMetadata::RXMappingSize |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ TrampolineOfMetadata()
Definition at line 328 of file ffi_callback_metadata.cc.
329 {
332 const uword index = metadata - metadatas;
333#if defined(DART_TARGET_OS_FUCHSIA)
334 return StubCode::FfiCallbackTrampoline().EntryPoint() +
335 index * kNativeCallbackTrampolineSize;
336#else
337 return start + offset_of_first_trampoline_in_page_ +
338 index * kNativeCallbackTrampolineSize;
339#endif
340}
◆ kPageMask
constexpr intptr_t dart::FfiCallbackMetadata::kPageMask = ~(kPageSize - 1) |
|
staticconstexpr |
◆ kPageSize
constexpr intptr_t dart::FfiCallbackMetadata::kPageSize = 4 * KB |
|
staticconstexpr |
The documentation for this class was generated from the following files: