You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the JNI APIs can throw exceptions; however we have not implemented this behavior in most cases yet.
There is an example for how to do this in: jvm.cpp: JVM_FindClassFromCaller & exception.cpp
This relies on JLang-compiled code for creating and throwing Java Exceptions. The downside of this is that a separate function needs to be compiled for each type of exception that the runtime might throw. This is actually probably reasonable since the runtime only throws a handful of exception types (probably fewer than a dozen).
However, we could use our runtime class loading and object creation (see class.cpp: LoadJavaClassFromLib and factory.cpp:CreateJavaObject) to create the exceptions and merely use a JLang-compiled method to throw them. This does require knowing how to call appropriate constructors however, which is a bit of runtime reflection that, as of yet, is unimplemented.
The text was updated successfully, but these errors were encountered:
Many of the JNI APIs can throw exceptions; however we have not implemented this behavior in most cases yet.
There is an example for how to do this in: jvm.cpp: JVM_FindClassFromCaller & exception.cpp
This relies on JLang-compiled code for creating and throwing Java Exceptions. The downside of this is that a separate function needs to be compiled for each type of exception that the runtime might throw. This is actually probably reasonable since the runtime only throws a handful of exception types (probably fewer than a dozen).
However, we could use our runtime class loading and object creation (see class.cpp: LoadJavaClassFromLib and factory.cpp:CreateJavaObject) to create the exceptions and merely use a JLang-compiled method to throw them. This does require knowing how to call appropriate constructors however, which is a bit of runtime reflection that, as of yet, is unimplemented.
The text was updated successfully, but these errors were encountered: