Exploiting exceptions

نویسندگان

  • Michael M. J. Zastre
  • R. Nigel Horspool
چکیده

Most programmers use exceptions to handle exceptional events. However, exceptions can also be used to simplify the control logic of a program and enhance readability [1]. As we will demonstrate, there are situations where exceptions can be used as a standard programming pattern to make programs execute faster. These situations are opportunities to increase the speed of Java programs by changing bytecode within methods with a space cost of, at most, a few extra instructions. Such modifications apply knowledge of which run-time actions and checks are performed by a virtual machine as bytecode instructions are executed. For instance, within Sun’s Java Virtual Machine (JVM), all object dereferences are preceded with a run-time check for a null value; if null, a NullPointerException is thrown; if not null, the object dereference proceeds. As observed by Orchard [2], this exception can be exploited in loops whose control expressions involve an explicit null check since the expressions may be redundant—the exception thrown as a result of dereferencing a null pointer may be used to transfer control out of the loop (Figures 1(a), (b)). Array-bounds checks present another opportunity. Before accessing any element of an array, the runtime system first checks whether the array index is within the array’s bounds; if not, the JVM throws an ArrayIndexOutOfBounds exception; otherwise the array access proceeds. In a similar manner to the previous example, the exception may be exploited in any loop whose control expression involves

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A knowledge-based approach for handling exceptions in business processes

This paper describes a novel knowledge-based methodology and toolset for helping business process designers and participants better manage exceptions (unexpected deviations from an ideal sequence of events caused by design errors, resource failures, requirement changes, etc.) that can occur during the enactment of a process. This approach is based on an on-line repository exploiting a generic a...

متن کامل

Towards a Systematic Repository of Knowledge about Managing Multi-agent System Exceptions

A critical challenge to creating effective agent-based systems is allowing them to operate effectively in environments where failures (‘exceptions’) can occur. An important barrier to achieving this has been the lack of systematized dissemination of exception handling techniques. This paper describes a semi-formal Web-accessible repository, built as an augmentation of the MIT Process Handbook, ...

متن کامل

A Systematic Repository of Knowledge about Handling Exceptions in Business Processes

A critical challenge to creating effective business processes is allowing them to operate effectively in environments where failures (‘exceptions’) can occur. An important barrier to achieving this has been the lack of systematized dissemination of exception handling techniques. This paper describes the MIT Exception Repository, a semi-formal Web-accessible repository, built as an augmentation ...

متن کامل

Formal Verification of Superscalar Microprocessors with Multicycle Functional Units, Exceptions, and Branch Prediction1

We extend the Burch and Dill flushing technique [6] for formal verification of microprocessors to be applicable to designs where the functional units and memories have multicycle and possibly arbitrary latency. We also show ways to incorporate exceptions and branch prediction by exploiting the properties of the logic of Positive Equality with Uninterpreted Functions [4][5]. We study the modelin...

متن کامل

Formal Verification of Superscalar Microprocessors with Multicycle Functional Units, Exceptions, and Branch Prediction

We extend the Burch and Dill flushing technique [6] for formal verification of microprocessors to be applicable to designs where the functional units and memories have multicycle and possibly arbitrary latency. We also show ways to incorporate exceptions and branch prediction by exploiting the properties of the logic of Positive Equality with Uninterpreted Functions [4][5]. We study the modelin...

متن کامل

A Knowledge-Based Approach for Designing Robust Business Processes

This chapter describes a novel knowledge-based methodology and computer toolset for helping business process designers and participants better manage exceptions (unexpected deviations from a normal sequence of events caused by design errors, resource failures, requirement changes etc.) that can occur during the enactment of a process. This approach is based on an on-line repository exploiting a...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Softw., Pract. Exper.

دوره 31  شماره 

صفحات  -

تاریخ انتشار 2001