Class Loading


Loading a class in IAS or RTL

All classes are loaded statically in the picoJavaTM-II environment.

Use the loadClass command to load a class in IAS. Use the +class+<classfile> option or call the loadClass() function in libloader.a for the RTL model and cosimulation.

Files of the form <class_prefix.binit> and <class_prefix>.init, such as loadClass A if found, are also loaded. This file in IAS reads A.binit, A.init, and A.class.

The order of loading files into memory is:

  1. <.binit> file: Binary initialization file
  2. <.init> file: ASCII initialization file
  3. class contents: Methods, constant pool, and so on

For detailed information on class loading, see Chapter 2 of the picoJava-II Verification Guide.

Related sources related are in $DSVHOME/ldr/src/loader.c and $DSVHOME/ldr/src/copy.c files.

Note: All loader operations always operate directly on common or main memory, and can have unpredictable effects if the caches are enabled. Usually classes are preloaded into memory, before the caches are enabled, so this does not cause any problem. If this same loader is extended to a dynamic loader however, this point should be taken care of.

The .init file format is:

The .binit file format is:

Each section is compressed using the libz.a library in the $DSVHOME/lib directory.

The format of each section is as follows:


Copyright © 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303-4900 USA. All rights reserved.


Last modified 24-March-1999