[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Null check elimination & other stuff

From: Miroslaw Dobrzanski-Neumann
Subject: Re: [DotGNU]Null check elimination & other stuff
Date: Tue, 15 Jun 2004 15:43:39 +0200
User-agent: Mutt/1.4i

Althou, fully implementing POSIX 

On Wed, Jun 16, 2004 at 12:55:49AM +1200, Thong (Tum) Nguyen wrote:
> Hi guys,
> I've just checked in support for null check elimination from PNET.  PNET
> will still use the classical check for null references using an if/else
> statement on unsupported platforms but now there is infrastructure to allow
> it to not bother checking on supported platforms.  It does this by trapping
> and responding to segmentation faults that occur while the engine is
> executing managed code.  Most of the implementation is in support/interrupt*
> and is platform & CPU specific (because registers need to be saved &
> restored after the CVM recovers) but has been sufficiently (IMHO) abstracted
> to keep PNET portable.  I've added implementations for POSIX & WIN32 systems
> though full POSIX support is only enabled for Linux until I can find other
> systems to test on (see support/interrupt.h).

I do not know it exactly but does POSIX require an exception when reading
from address 0x0?

Anyway, AIX Operating Systems (IBM), although fully POSIX compatible, do not
forbid reading from the first page of process address space!! Writes are
forbidden since AIX 4.x. This means that you get no SEGV for the following

char *p = (char *)0x0;
char  c = *p;

The IBM Visual Age C Compiler (xlc) has an option to enable this check
-qcheck=nullptr. The IBM compiler generates a trap machine instructions like
"twllti rA,256" where rA is the value to check but only if null ptr check is

If you want to get rid of "if (a == nullptr) Reexecute_In_Cvm" you must use
traps on plattforms like AIX and optimize their usage doing full featured null
check elimination. Of course you must install SIGTRAP handler to handle it

Mirosław Dobrzański-Neumann
E-mail: address@hidden

This message is utf-8 encoded

reply via email to

[Prev in Thread] Current Thread [Next in Thread]