*Result*: Garbage Collector Agnostic Load Barriers : Moving Towards Flexible Ahead-of-Time Java Compilation ; Skräpsamlingsoberoende inläsningsbarriärer : Mot flexibel ahead-of-time-kompilering av Java
*Further Information*
*Java, executed on the HotSpot Java Virtual Machine, benefits from just-in-time compilation, in which profiling guides optimizations. There is also ongoing research on ahead-of-time compilation for Java, which has the benefit of reduced startup time compared to just-in-time compilation. One challenge is that ahead-of-time compilation forces a choice in one of several garbage collectors, to the detriment of runtime flexibility. This is due to opaquely inserted instructions called barriers, which facilitate communication between the garbage collector and application. These barriers are primarily emitted during field accesses and updates, and their concrete instructions depend on the garbage collector. This thesis investigates garbage-collector-agnostic load barriers, instructions for field accesses that the Serial, Parallel and Z garbage collectors can leverage. Presently, only G1 and Z have load barriers. The research objectives are to 1) develop; and 2) measure the impact of agnostic load barriers in terms of execution time and latency of real-world applications. An agnostic load barrier algorithm, called the Patching Barrier, is developed. The Patching Barrier emits mostly-correct machine code, which is then just-in-time modified by the garbage collector during runtime for correctness. The implementation takes advantage of existing mechanisms in HotSpot. Serial, Parallel and G1 see the introduction of more machine code. Benchmarking the Patching Barrier on the DaCapo Chopin suite indicates regressions in execution time and latency. Execution time increases up to 17% for Serial, 19% for Parallel, 17% for G1 and 23% for Z, although outlier programs which perform better exist. Latency also increases up to 15% for Serial, 17% for Parallel, 20% for G1 and 39% for Z. Smaller heaps generally perform better in execution time tests, but no such trend was found for latency. These results indicate that agnostic load barriers are feasible, at the cost of higher execution time and latency regressions. However, there is still ...*