System and method for reducing the footprint of preloaded...

Electrical computers and digital processing systems: multicomput – Computer-to-computer data routing – Least weight routing

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S166000, C717S159000

Reexamination Certificate

active

06658492

ABSTRACT:

The present invention relates generally to a class preloader and, particularly, to a system and method for reducing the size in read only memory of preloaded Java classes.
BACKGROUND OF THE INVENTION
A Java program comprises a number of small software components called classes. Each class contains code and data and is defined by information in a respective class file. Each class file is organized according to the same platform-independent “class file format”. Referring to
FIG. 1
, there is shown a block diagram of the class file format, according to which each class file
400
includes header information
402
, a constant pool
404
, a methods table
406
and a fields table
408
. The header information
402
identifies the class file format, the size of the constant pool, the number of methods in the methods table
406
and the number of fields in the fields table
408
. The constant pool
404
is a table of structures representing various string constants, class names, field names and other constants that are referred to within the class file structure and its sub-structures. The methods table
406
includes one or more method structures, each of which gives a complete description of and Java code for a method explicitly declared by the class. The fields table
408
includes one or more field structures, each of which gives a complete description of a field declared by the class. An example of the fields table
408
is now described in reference to FIG.
1
B.
A Java program is executed on a computer containing a program called a virtual machine (VM), which is responsible for executing the code in Java classes. It is customary for the classes of a Java program to be loaded as late in the program's execution as possible: they are loaded on demand from a network server or from a local file system when first referenced during the program's execution. The VM locates and loads each class, parses the class file format, allocates internal data structures for its various components, and links it in with other already loaded classes. This process makes the method code in the class readily executable by the VM.
For small and embedded systems for which facilities, required for class loading, such as a network connection, a local file system or other permanent storage, are unavailable, it is desirable to preload the classes into read only memory (ROM). One preloading scheme is described in U.S. patent application Ser. No. 08/655,474 (“A Method and System for Loading Classes in Read-Only Memory”), which is entirely incorporated herein by reference. In this method and system, the VM data structures representing classes, fields and methods in memory are generated offline by a class preloader. The preloader output is then linked in a system that includes a VM and placed in read-only memory. This eliminates the need for storing class files and doing dynamic class loading.
Referring to
FIG. 2A
, there is shown a more detailed block diagram of the VM data structures
1200
.generated by the class preloader. The data structures
1200
include a class block
1202
, a plurality of method blocks
1204
, a plurality of field blocks
1214
and a constant pool
1224
.
The class block
1202
is a fixed-size data structure that can include the following information:
the class name
1230
;
a pointer
1232
to the class block of the current class's immediate superclass;
a pointer
1234
to the method blocks
1204
;
a pointer
1236
to the field blocks
1214
; and
a pointer
1238
to the class' constant pool;
The elements of a class block data structure are referred to herein as class block members.
A method block
1204
is a fixed-sized data structure that represents one of the class's methods. The elements of a method block data structure are referred to herein as method block members. A field block
1214
is a fixed-size data structure that represents one of the class's instance variables. The elements of a field block data structure are referred to herein as field block members.
Each type of VM data structure, including the class block
1202
, method blocks
1204
, field blocks
1214
and constant pool
1224
, has a format defined by a corresponding data structure declaration. For example, a single method block declaration defines the format of all method blocks
1204
. The data structure declarations also define accessor functions (or macros) that are used by the VM to access data structure members. These data structure declarations are internal to the VM and are not used by class components. The prior art data structure declarations are now described in reference to FIG.
2
B.
Referring to
FIG. 2B
, there is shown a depiction of data structure declarations
1230
that define the format of all data structure types employed by a particular VM. Each declaration
1230
includes a set of member declarations
1232
and accessor functions
1234
for accessing respective members. The member declarations
1232
and accessor functions
1234
are defined conventionally, according to the syntax of the language used in the implementation of the VM. For example, assuming the C language is used in the data structure declarations
1230
, a generic field data structure
1230
.N (shown in
FIG. 2B
) could be defined as a structure T with five members of the following types with respective accessor functions:
member name
member type
accessor functions
member1
mtype1
mem1 of (T) T->member1
member2
mtype2
mem2 of (T) T->member2
member3
mtype3
mem3 of (T) T->member3
member4
mtype4
mem4 of (T) T->member4
member5
mtype5
mem5 of (T) T->member5
In this example, the member types can be any type defined by the relevant computer language, including user defined types or language types, such as integer, float, char or double. The accessor functions are macros used by the VM to access the fields without needing to access directly the structure containing the field. For example, instead of employing the expression “T→member
1
” to access field
1
in structure type T, the VM need only employ the expression “mem
1
of (T)”. Accessor functions are well known in programming languages, such as C, that provide sophisticated data structure capabilities.
The internal data structures used to store “class meta data” (i.e., the class, method and field blocks
1202
,
1204
,
1214
) require large, fixed amounts of space in read-only memory. In fact, measurements indicate that this sort of class meta data often takes up much more space than the bytecodes for the class methods themselves. These internal data structures are therefore often unsuitable for use in small, resource-constrained devices in which class preloading is desirable and/or necessary.
Moreover, if the internal data structures were individually modified to save memory space, the VM code would need to be extensively revised to enable the VM to correctly access the modified data structures. To make such changes to the VM could be onerous and inefficient.
Therefore, there is need for a modified representation of the internal data structures that is smaller in size than the prior art data structures, includes all information required by the VM, and does not require extensive or onerous modification of the VM code.
SUMMARY OF THE INVENTION
In summary, the present invention is a method and system that reduces the ROM space required for preloaded Java classes.
In particular, the method and system of the present invention are based upon the realization that, in an environment where the Java VM classes are preloaded, it is highly likely that the VM would be a closed system with a set number of classes and class components, such as fields and methods. Such a closed VM would include a fixed number of internal data structures, such as class blocks, method blocks and field blocks. Moreover, each member of these data structures (e.g., a method block or field block member) would have one of a well-known set of distinct values.
Given this assumption and its implications, the present invention reduces the memory space required to represent the

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

System and method for reducing the footprint of preloaded... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with System and method for reducing the footprint of preloaded..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and System and method for reducing the footprint of preloaded... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3160448

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.