JNI methods can signal exceptions but those exceptions are not technically thrown until JNI method returns to JIT code. We must therefore test for exceptions signalled by JNI methods upon return. This test is cheap for non-exceptional flow but is expensive in the other case.
Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- arch/x86/insn-selector.brg | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg index d9142fa..aa6f4ef 100644 --- a/arch/x86/insn-selector.brg +++ b/arch/x86/insn-selector.brg @@ -2059,6 +2059,9 @@ static void invoke(struct basic_block *s, struct tree_node *tree, struct compila if (method->args_count) method_args_cleanup(s, tree, method->args_count); + + if (vm_method_is_jni(method)) + select_exception_test(s, tree); } -- 1.6.0.6 ------------------------------------------------------------------------------ _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel