Font Size: a A A

Java Exception Handling Mechanism For Statically Compiled To Optimized

Posted on:2010-11-13Degree:MasterType:Thesis
Country:ChinaCandidate:Z W CaoFull Text:PDF
GTID:2208360275491515Subject:Computer system architecture
Abstract/Summary:PDF Full Text Request
Exception handling is a widely used mechanism for improving the software robustness and stability, which is supported by many kinds of object-oriented programming language. As two popular object-oriented programming languages, both C++ and Java include exception handling mechanism as an important component. Exception handling mechanism is usually implemented by both compiler and exception handling library functions. As a result, how to make exception handling works correctly and efficiently becomes critical to both compiler design and exception handling library implementation.There are two ways to run a Java program: the first one is compiling Java program into class files and then using a Java Virtual Machine to run them dynamically; the second one is compiling Java program into executable file and then running it statically. Under certain circumstance, running a Java program statically could outperform running it dynamically, and this fact makes Java static compiler more and more useful. This paper proposes an algorithm to implement Java exception mechanism in a Java static compiler, and presents an implementation of this algorithm based on Open64 open source compiler. After this implementation, Open64 compiler could compile Java program correctly.Stack unwinding is a common way to implement exception handling mechanism, and it could be used by both compiler and JVM. This paper proposes an improved stack unwinding algorithm to overcome some shortcomings which exist in the conventional stack unwinding algorithm. Based on the stack unwinding library which is an affiliated part of Open64 compiler, we implemented our algorithm and did some test. According to the test result, our algorithm could correctly support both C++ exception and Java exception and effectively improve the programs which have a lot of exceptions thrown during run time.
Keywords/Search Tags:Java, Exception handling, Open64, Stack unwinding, Optimization
PDF Full Text Request
Related items