Browse Prior Art Database

Effective Null Pointer Check Elimination

IP.com Disclosure Number: IPCOM000013427D
Original Publication Date: 2000-Jul-01
Included in the Prior Art Database: 2003-Jun-18
Document File: 1 page(s) / 40K

Publishing Venue

IBM

Abstract

Disclosed is a method to reduce execution costs of null pointer checks in the Java programs. In general, the implementation of null checking takes advantage of the hardware trap. However, all null checks cannot rely on hardware support because of OS limitations or

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 87% of the total text.

Page 1 of 1

Effective Null Pointer Check Elimination

   Disclosed is a method to reduce execution costs of null pointer
checks in the Java programs. In general, the implementation of null
checking takes advantage of the hardware trap. However, all null
checks cannot rely on hardware support because of OS limitations or
code transformations. This method eliminates software null checks
by utilizing hardware null checks as follows:

Compiler computes the region where software null check can be moved forwards. The


1.


2.


3.


4.


5.

following instructions become barriers of null check movement.

   Any instruction that overwrites a variable that is used in null check. Any instruction that accesses the contents of an object, where it is known that the access will cause a hardware trap if the object is null. Any instruction that causes side effects, such as raising other kinds of exceptions, or writing to memory. Compiler computes the set of the last checkpoints of null checks in the region where

software null check can be moved forwards. If the next instruction of the checkpoints accesses the contents of an object and it will

cause a hardware trap, compiler marks the next instruction as exception sites. Otherwise, compiler inserts software null check before the checkpoints. Compiler computes the region where the substitutes for the software null checks can be

moved backwards. Concrete instructions that become barriers are the same as (1). Compiler eliminates software null checks wherever possible...