In a computer system that uses a "snapshot-at-the-beginning" garbage
collector and in which write barrier code is generated for pointer write
instructions in order to support the operation of the garbage collector,
a static analysis of the computer program source code is performed prior
to generating compiled code for the application and garbage collector in
order to identify source code instructions that, at runtime, will perform
initializing pointer writes as indicated by the fact that they overwrite
memory locations that contain a predetermined pre-write value, such as
NULL. The identified instructions are then compiled in a conventional
manner, but no write barrier code is generated for them. Thus, at
runtime, those instructions that perform initializing writes will incur
no write barrier cost penalty.