Redundancy elimination in the presence of split class initialization

2018 
Virtual machines for mobile and embedded devices often use the romization technique when the VM is loaded from a preinitialized state, previously saved as an image. This way some of the initialization work can be avoided in a resource constrained environment. For Java, one of the initialization activities which can be moved from execution time to romization time is class initialization. The preinitialized image can be optimized in different ways. For instance, redundancy elimination transformations, which include elimination of unused methods, fields, and classes, can be applied to reduce the static and the dynamic footprint of the image. We consider the problem of redundancy elimination in the presence of romization time class initialization. There is a circular dependency between class initialization and method reachability analysis. On the one hand, class initialization reduces the set of reachable methods as the methods used solely for the initialization become unreachable. On the other hand, eager initialization of classes which are not used by the reachable methods can increase the size of the image by creating reachable but unused objects in the heap. We propose a method reachability analysis algorithm which breaks this circular dependency by performing selective class initialization during the analysis. The algorithm keeps track of the classes which can be initialized by the reachable methods and initializes a subset of these classes. A simple heuristic is used to choose the classes which are safe to preinitialize. We also found that elimination of initialized but unused reference fields in Java can affect finalization semantics. The elimination of a field might cause some objects to be collected by the GC, which can be observed by the application. We present an algorithm for elimination of unused fields which preserves finalization behavior.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    16
    References
    1
    Citations
    NaN
    KQI
    []