Lazy loading: load static initializers for needed classes. Fixes #846#855
Conversation
|
@smowton could you please take a look at the overly long lines reported? |
There was a problem hiding this comment.
Nit picking: STL headers first, blank line, local include
There was a problem hiding this comment.
Function comment headers missing
src/java_bytecode/ci_lazy_methods.h
Outdated
There was a problem hiding this comment.
Single-character indent - no indent needed for public/private/protected
src/java_bytecode/ci_lazy_methods.h
Outdated
There was a problem hiding this comment.
Why is one of those a vector while the other is a set?
94832db to
5bbec11
Compare
|
Amended and added comments to address your question about vector vs. set. |
tautschnig
left a comment
There was a problem hiding this comment.
See one more comment for a suggested improvement, but otherwise looks good to me.
src/java_bytecode/ci_lazy_methods.h
Outdated
There was a problem hiding this comment.
Thanks a lot for the clarification; I'd suggest to use std::unordered_set<irep_idt, irep_id_hash> &needed_classes as a minor improvement.
There was a problem hiding this comment.
I'd want to make change a few others too, so I'll do that in a subsequent PR
There was a problem hiding this comment.
What's the reason for taking a const ref to a temporary here vs. the following?
const irep_idt clinit_name(id2string(class_symbol_name)+".<clinit>:()V");5bbec11 to
286fcc5
Compare
This adds a wrapper for the needed-methods and needed-classes objects used to accumulate dependencies during lazy loading, such that the first time a class is noted needed, its static initializer if any is also queued for elaboration.
The test case is borrowed from @reuk.