Font Size: a A A

Java Program Optimization And Data Race Detection

Posted on:2011-04-01Degree:DoctorType:Dissertation
Country:ChinaCandidate:K J YangFull Text:PDF
GTID:1118330335492110Subject:System architecture
Abstract/Summary:PDF Full Text Request
As the Java programming language enjoys widespread popularity on different platforms ranging from servers to mobile phones due to its productivity and safety, it is very important to provide optimizing compilers and more efficient runtime systems. The reality of multi-core hardwares makes multithreaded programs prevalent in order to make the best use of the underlying processors. As Java is the first programming language to provide build-in language support for multithreading, it becomes more pervasive in the parallel programming landscape. However, multithreaded programming is error prone and makes programmers introduce concurrency bugs easily, such as data races, deadlocks, etc. The dissertation focus on two hot issues in Java applications:runtime performance and concurrenty error detection.For the runtime performance optimization of Java application, a Java static compiler Opencj is built based on Open64 compiler. Meanwhile the dissertation takes the DRLVM, a JVM of Harmony, and Opencj as platform to reveal how to leverage the synergy between static and dynamic optimization to exploit more optimization chances and improve Java performance. Opencj takes Java source files or class files as inputs and generates machine dependent executable code for Linux/X86. Opencj benefits from Open64's industrial optimization modules and supports the Java exception handling mechanism. WHIRL is a tree-form Intermediate Representation (IR) used in Open64 compiler. While capable of describing various high-level control flow structures, WHIRL does not provide explicit data flow information. The dissertation presents an extension of SSA infrastructure to WHIRL. The SSA information, including the versions, phi nodes and aliased mu/chi nodes are attached to the WHIRL node as side data structure. WHIRL SSA can provide explicit and factored UD information for data flow analysis. WHIRL SSA is the first optimization infrastructure to enable SSA on high-level, tree-based IR. The potential benefits of WHIRL SSA are discussed and redundant array bounds check elimination optimization is implemented based on WHIRL SSA. The optimization is very important for Java scientific applications. The test result of NPB 3.0 benchmark suit shows the performance of Opnecj is roughly 20x faster than Sun JDK 1.6.For the detecting concurrent bugs of Java multithreaded programs, the dissertation focuses on the data race automatic detection. Static data race detectors are inherently imprecise and typically produce too many false races that place a tremendous burden on users. On the contrary, dynamic data race detectors can report actual data races. However, executing the instrumentation code and recording the access history incur huge runtime overhead, thus limiting widespread usage of dynamic race detector. Prior work adopts adjusting the detection granularity to reduce the recording overhead for object oriented languages. They only have two detection granularities: object-level and field-level. Based on a assumption that a past data race access pattern is likely to be repeated in the future, this paper presents a three-level detection granularity through object ownership tree to further reduce the runtime overhead for dynamic data race detector. The detector builds the global objects ownership relationship from the object reference graph and initially monitors the owner object of the suspicious area with the happens-before relation. It automatically refines the detection granularity when a potential data race occurs. Four kinds of detection granularity detectors are implemented in the same JVM, thus providing a fair performance comparison. The experimental results on Java benchmarks show the three-level race detector reduces about 3x overhead with no precision lost comparing to field-level detection granularity.Finally, the dissertation details the Java compilation framework which combines the static and dynamic optimization together, gives the conclusion and highlights the future work.The main contributions of this dissertation are:●an optimization framework to leverage the synergy between static and dynamic optimization to exploit more optimization chances,●an implementation of a Java static compiler Opencj,●a new optimization infrastructure based on high-level intermediate representation, called WHIRL SSA,●an optimization for eliminating redundant array bounds checks based on WHIRL SSA,●three-level granularity algorithm for dynamic data race detection.
Keywords/Search Tags:Java, Program Optimization, Intermediate Representation, WHIRL, SSA, Bounds Check Elimination, Data Race
PDF Full Text Request
Related items