One embodiment of the present invention provides a system that initializes system
classes for a virtual machine during build time for the virtual machine, so that
portions of the system classes can be stored in Read Only Memory (ROM). During
virtual machine build time, the system loads system classes for the virtual machine.
Next, the system identifies which of the system classes can be initialized at build
time and then initializes the identified system classes. The system then stores
portions of the system classes in a ROM image, so that the portions of the system
classes can be accessed from the ROM image during subsequent run-time execution
of the virtual machine. In this way, this embodiment of the present invention reduces
the amount of time required to initialize system classes during run-time execution
of the virtual machine.