eliminating null pointer checks on mmu-less machines

Adam Megacz adam@megacz.com
Sat Sep 13 08:57:00 GMT 2003


Hey, I was thinking about NullPointerException handling on machines
with no MMU.  There's not much that can be done for field accesses,
but method invocations are much more common.

Is it feasible to place an object at address 0x0 whose vtable is at
least as large as the largest vtable (either set a static limit or
expand the vtable every time a class with a larger vtable is loaded),
where all vtable entries point to a method that just throws a NPE?

It seems that this would eliminate the zillions of "if ptr==NULL"
checks.

  - a

-- 
"Education is not filling a bucket but lighting a fire." -- WB Yeats



More information about the Java mailing list