In this paper, we report on our experiences with guaranteeing GC-pointer sa
fety when using unsafe low-level language extensions to implement a JVM in
Java. We give an overview of the original unsafe language extensions that w
ere defined for use by Jalapeno implementers, and introduce sanitized repla
cements that capture common idioms while also guaranteeing GO-pointer safet
y. We also outline some simple static and dynamic checks for correct usage
of low-level operations, and examine how code containing low-level operatio
ns can be optimized correctly and effectively.