diff options
author | 2024-01-05 16:30:57 +0000 | |
---|---|---|
committer | 2024-09-25 18:50:21 +0000 | |
commit | 9f3192455f075aea6538fa191b106f21ad6b789f (patch) | |
tree | da4ced0a7a5c09cc758b64b6be4bc649eb01faa4 /runtime/entrypoints/quick/quick_entrypoints.h | |
parent | bb2fb09b7d4618e4e4319835e1a8e3c1eb1506ae (diff) |
Refactor C++ entrypoints
Refactor all C++ entrypoint function (those that can be called from
assembly entrypoints) declarations into a new header file. Now all
C++ entrypoint functions have a single declaration, inside a header
that can be included as needed. This removes the need for additional
declarations to be made which, if not type checked, could be
mismatched with the function definition.
A macro is used to declare each entrypoint inside the header but also
allows operations to be done on all C++ entrypoints similar to
assembly entrypoints with its macro in quick_entrypoints_list.h.
Note: linkers, unlike compilers, do not typically type check
function declarations against defintions, e.g: when linking between
two libraries. This can cause mismatches which are not caught when
building and therefore become difficult to debug later.
This patch aims to unify all C++ entrypoint function declarations,
i.e: those C++ functions called from assembly entrypoints.
By doing this any unnecessary and potentially conflicting
declarations can be removed to ensure a single source of truth.
Author: Chris Jones <christopher.jones@arm.com>
Test: test.py --host --target
Change-Id: I5b0de39eed96f666e7bb4205906c5d9369615aa8
Diffstat (limited to 'runtime/entrypoints/quick/quick_entrypoints.h')
-rw-r--r-- | runtime/entrypoints/quick/quick_entrypoints.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h index fe01424c7c..cd6debea95 100644 --- a/runtime/entrypoints/quick/quick_entrypoints.h +++ b/runtime/entrypoints/quick/quick_entrypoints.h @@ -53,51 +53,9 @@ struct QuickEntryPoints { #undef ENTRYPOINT_ENUM }; - // JNI entrypoints. -extern "C" void artJniMethodStart(Thread* self) UNLOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR; -extern "C" void artJniMethodEnd(Thread* self) SHARED_LOCK_FUNCTION(Locks::mutator_lock_) HOT_ATTR; extern mirror::Object* JniDecodeReferenceResult(jobject result, Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; -extern "C" void artJniReadBarrier(ArtMethod* method) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; -extern "C" void artJniUnlockObject(mirror::Object* locked, Thread* self) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; - -// JNI entrypoints when monitoring entry/exit. -extern "C" void artJniMonitoredMethodStart(Thread* self) UNLOCK_FUNCTION(Locks::mutator_lock_); -extern "C" void artJniMonitoredMethodEnd(Thread* self) SHARED_LOCK_FUNCTION(Locks::mutator_lock_); -extern "C" void artJniMethodEntryHook(Thread* self); - -// StringAppend pattern entrypoint. -extern "C" mirror::String* artStringBuilderAppend(uint32_t format, - const uint32_t* args, - Thread* self) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; - -// Read barrier entrypoints. -// -// Compilers for ARM, ARM64 can insert a call to these -// functions directly. For x86 and x86-64, compilers need a wrapper -// assembly function, to handle mismatch in ABI. - -// Mark the heap reference `obj`. This entry point is used by read -// barrier fast path implementations generated by the compiler to mark -// an object that is referenced by a field of a gray object. -extern "C" mirror::Object* artReadBarrierMark(mirror::Object* obj) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; - -// Read barrier entrypoint for heap references. -// This is the read barrier slow path for instance and static fields -// and reference type arrays. -extern "C" mirror::Object* artReadBarrierSlow(mirror::Object* ref, - mirror::Object* obj, - uint32_t offset) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; - -// Read barrier entrypoint for GC roots. -extern "C" mirror::Object* artReadBarrierForRootSlow(GcRoot<mirror::Object>* root) - REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR; } // namespace art |