Skip to content

Lazy methods: mark JVM-generated exceptions as always available #1467

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/java_bytecode/ci_lazy_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ void ci_lazy_methodst::initialize_needed_classes(
lazy_methods.add_needed_class("java::java.lang.String");
lazy_methods.add_needed_class("java::java.lang.Class");
lazy_methods.add_needed_class("java::java.lang.Object");
// Add the classes that can be produced by `java_bytecode_instrument`:
lazy_methods.add_needed_class("java::java.lang.NullPointerException");
lazy_methods.add_needed_class("java::java.lang.ArithmeticException");
lazy_methods.add_needed_class(
"java::java.lang.ArrayIndexOutOfBoundsException");
lazy_methods.add_needed_class("java::java.lang.ClassCastException");
lazy_methods.add_needed_class("java::java.lang.NegativeArraySizeException");
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a comment to java_bytecode_instrument::instrument_expr to say that new runtime thrown exceptions need to be added to ci_lazy_methods.cpp

}

/// Build up list of methods for types for a pointer and any types it
Expand Down