Adapt methods for fast calls

Summary:
Changes all possible native JNI methods to critical methods.

For now, this only changes Android up and including v7. In order to be prepared for the `CriticalNative` annotation in Android v8, the following restrictions apply:

- Qualifying methods must be static (this is also enforced for Dalvik / Android v4)
- Method implementations can only consume primitive JNI types (`boolean`, jchar`, etc.)

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943868

fbshipit-source-id: 728817eb37822b717fd3daf94cd9f02b42c17db6
This commit is contained in:
David Aurelio
2018-09-25 15:44:42 -07:00
committed by Facebook Github Bot
parent 554d8cdf76
commit 6e46eec58f
4 changed files with 269 additions and 280 deletions

View File

@@ -183,7 +183,7 @@ inline std::string makeDescriptor(R (C::*)(Args... args)) {
template <typename R, typename... Args>
template <R (*func)(Args...)>
R CriticalMethod<R (*)(Args...)>::call(
JNI_ENTRY_POINT R CriticalMethod<R (*)(Args...)>::call(
alias_ref<jclass>,
Args... args) noexcept {
static_assert(

View File

@@ -13,5 +13,6 @@ yoga_cxx_library(
"real/jni.h",
],
force_static = True,
preprocessor_flags = ["-fmacro-backtrace-limit=0"],
visibility = ["PUBLIC"],
)