|
| ci_lazy_methodst (const symbol_tablet &symbol_table, const irep_idt &main_class, const std::vector< irep_idt > &main_jar_classes, const std::vector< load_extra_methodst > &lazy_methods_extra_entry_points, java_class_loadert &java_class_loader, const std::vector< irep_idt > &extra_instantiated_classes, const select_pointer_typet &pointer_type_selector, message_handlert &message_handler, const synthetic_methods_mapt &synthetic_methods) |
| Constructor for lazy-method loading. More...
|
|
bool | operator() (symbol_tablet &symbol_table, method_bytecodet &method_bytecode, const method_convertert &method_converter) |
| Uses a simple context-insensitive ('ci') analysis to determine which methods may be reachable from the main entry point. More...
|
|
virtual void | set_message_handler (message_handlert &_message_handler) |
|
message_handlert & | get_message_handler () |
|
| messaget () |
|
| messaget (const messaget &other) |
|
messaget & | operator= (const messaget &other) |
|
| messaget (message_handlert &_message_handler) |
|
virtual | ~messaget () |
|
mstreamt & | get_mstream (unsigned message_level) const |
|
mstreamt & | error () const |
|
mstreamt & | warning () const |
|
mstreamt & | result () const |
|
mstreamt & | status () const |
|
mstreamt & | statistics () const |
|
mstreamt & | progress () const |
|
mstreamt & | debug () const |
|
void | conditional_output (mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const |
| Generate output to message_stream using output_generator if the configured verbosity is at least as high as that of message_stream . More...
|
|
|
void | initialize_instantiated_classes (const std::unordered_set< irep_idt > &entry_points, const namespacet &ns, ci_lazy_methods_neededt &needed_lazy_methods) |
| Build up a list of methods whose type may be passed around reachable from the entry point. More...
|
|
void | gather_virtual_callsites (const exprt &e, std::unordered_set< exprt, irep_hash > &result) |
| Get places where virtual functions are called. More...
|
|
void | get_virtual_method_targets (const exprt &called_function, const std::unordered_set< irep_idt > &instantiated_classes, std::unordered_set< irep_idt > &callable_methods, symbol_tablet &symbol_table) |
| Find possible callees, excluding types that are not known to be instantiated. More...
|
|
void | gather_needed_globals (const exprt &e, const symbol_tablet &symbol_table, symbol_tablet &needed) |
| See output. More...
|
|
irep_idt | get_virtual_method_target (const std::unordered_set< irep_idt > &instantiated_classes, const irep_idt &call_basename, const irep_idt &classname, const symbol_tablet &symbol_table) |
| Find a virtual callee, if one is defined and the callee type is known to exist. More...
|
|
std::unordered_set< irep_idt > | entry_point_methods (const symbol_tablet &symbol_table) |
| Entry point methods are either: More...
|
|
convert_method_resultt | convert_and_analyze_method (const method_convertert &method_converter, std::unordered_set< irep_idt > &methods_already_populated, const bool class_initializer_already_seen, const irep_idt &method_name, symbol_tablet &symbol_table, std::unordered_set< irep_idt > &methods_to_convert_later, std::unordered_set< irep_idt > &instantiated_classes, std::unordered_set< exprt, irep_hash > &virtual_function_calls) |
| Convert a method, add it to the populated set, add needed methods to methods_to_convert_later and add virtual calls from the method to virtual_function_calls. More...
|
|
bool | handle_virtual_methods_with_no_callees (std::unordered_set< irep_idt > &methods_to_convert_later, std::unordered_set< irep_idt > &instantiated_classes, const std::unordered_set< exprt, irep_hash > &virtual_function_calls, symbol_tablet &symbol_table) |
| Look for virtual callsites with no candidate targets. More...
|
|
Definition at line 97 of file ci_lazy_methods.h.
bool ci_lazy_methodst::handle_virtual_methods_with_no_callees |
( |
std::unordered_set< irep_idt > & |
methods_to_convert_later, |
|
|
std::unordered_set< irep_idt > & |
instantiated_classes, |
|
|
const std::unordered_set< exprt, irep_hash > & |
virtual_function_calls, |
|
|
symbol_tablet & |
symbol_table |
|
) |
| |
|
private |
Look for virtual callsites with no candidate targets.
If we have invokevirtual A.f and we don't believe either A or any of its children may exist, we assume specifically A is somehow instantiated. Note this may result in an abstract class being classified as instantiated, which stands in for some unknown concrete subclass: in this case the called method will be a stub.
- Returns
- whether a new class was encountered
Definition at line 231 of file ci_lazy_methods.cpp.
Uses a simple context-insensitive ('ci') analysis to determine which methods may be reachable from the main entry point.
In brief, static methods are reachable if we find a callsite in another reachable site, while virtual methods are reachable if we find a virtual callsite targeting a compatible type and a constructor callsite indicating an object of that type may be instantiated (or evidence that an object of that type exists before the main function is entered, such as being passed as a parameter). Elaborates lazily-converted methods that may be reachable starting from the main entry point (usually provided with the –function command- line option
- Parameters
-
| symbol_table | global symbol table |
[out] | method_bytecode | map from method names to relevant symbol and parsed-method objects. |
| method_converter | Function for converting methods on demand. |
- Returns
- Returns false on success
Definition at line 100 of file ci_lazy_methods.cpp.