Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dynamically register jni methods and use @FastNative & @CriticalNative #1792

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

triniwiz
Copy link
Member

@triniwiz triniwiz commented Nov 8, 2023

Using the new annotations to improve the runtime for our jni calls
@cla-bot cla-bot bot added the cla: yes label Nov 8, 2023
Comment on lines +47 to 57
@FastNative
private native void runModule(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native void runWorker(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native Object runScript(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native Object callJSMethodNative(int runtimeId, int javaObjectID, String methodName, int retType, boolean isConstructor, Object... packagedArgs) throws NativeScriptException;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if these should be FastNative. FastNative completely disables GC while it's running, and these could likely run for a good while.

callJSMethodNative is even trickier because we can go java->native->java->native multiple times in long running methods

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the fastest we can go for those would be !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants