One embodiment of the present invention provides a system that facilitates
loading classes into non-volatile memory. During the loading process, the
system first loads class definitions into volatile memory, wherein the
class definitions contain metadata for classes currently being loaded
into non-volatile memory, as well as metadata for classes that are
already loaded into non-volatile memory. Next, after the class
definitions are loaded into volatile memory, the system loads method code
for the classes into non-volatile memory. During this process, the system
uses the class definitions to resolve linkages in the method code so that
the method code is ready for execution in non-volatile memory.