News Column

Patent Application Titled "Systems and Methods for Uniquely Defining Fortran Run Type Descriptors for Polymorphic Entities" Published Online

July 3, 2014



By a News Reporter-Staff News Editor at Computer Weekly News -- According to news reporting originating from Washington, D.C., by VerticalNews journalists, a patent application by the inventors MEIROWITZ, DIANE R. (CHARLOTTE, NC); BASON, IAIN GEORGE (WINCHESTER, MA), filed on February 17, 2014, was made available online on June 19, 2014.

The assignee for this patent application is Oracle International Corporation.

Reporters obtained the following quote from the background information supplied by the inventors: "The present invention generally relates to Fortran type descriptors that can be used to describe dynamic types of objects such as polymorphic entities during runtime of an executable file, and more particularly, to systems and methods that uniquely define each type descriptor within an executable file or shared library to allow for the determination of how the dynamic type of one object relates to that of another by comparing type descriptor addresses of the objects while allowing for the lazy loading of shared libraries.

"The 2003 standard of Fortran ('Fortran 2003') introduced the use of polymorphic entities for use in scientific and technical programming. Generally, a polymorphic entity is a data entity that can assume differing types during program execution or runtime. The type of a data entity at a particular point during execution of a program is its 'dynamic type.' In practice, a polymorphic entity is declared to be of a certain type by using the CLASS keyword in place of the TYPE keyword, and it is then able to take any of a number of types during execution. Representative polymorphic entities include allocatable variables (in which case its dynamic type is whatever it is allocated to be), pointers (in which case its dynamic type is that of its target), and dummy arguments (in which case its dynamic type is that of the actual argument). Polymorphic entities allow code to be written for objects of a given type and used later for objects of an extended type. An entity is said to be type compatible with entities of the same declared type or of any declared type that is an extension of its declared type.

"Fortran 2003 also introduced a number of new operations (e.g., functions) that can be performed on polymorphic entities at runtime. For instance, 'SAME_TYPE_AS(A,B)' returns 'TRUE' if objects A and B have the same dynamic type, 'EXTENDS_TYPE_OF(A,MOLD)' returns 'TRUE' if the dynamic type of object A is an extension type of the dynamic type of object MOLD, and the 'SELECT TYPE' operation selects for execution at most one of its constituent blocks depending on the dynamic type of a variable or expression. Programmers can design executables to take different actions or perform different functions at runtime based on results of one or more of these operations.

"In any case, the Fortran compiler generates code (e.g., object files) to keep track of the dynamic type of each polymorphic entity at run time. The dynamic type of each of these variables is represented by a data structure called a 'type descriptor' which describes the name of the dynamic type, the context of the dynamic type, the ancestor types of the dynamic type, and the like. Often, a shared object (i.e., shared library) is generated including a list of type descriptors or type descriptor definitions to which the polymorphic entities of one or more object files or subsequently generated dynamic executables can point or reference (e.g., via identifiers, pointers, etc.). The new operations discussed above utilize the type descriptors in varying manners depending upon the particular operation.

"For instance, one manner (the 'string-compare' method) compares one or more strings of the type descriptors (e.g., type name) and/or contexts (e.g., name of module in which type descriptor resides in shared library) of two polymorphic entities to determine if the polymorphic entities have the same dynamic type. Another manner (the 'hash-value compare' method) computes hash values from the type names in the type descriptors of two polymorphic entities (e.g., using any appropriate hash function with each type name as a key). For instance, polymorphic entities may be declared to have the same dynamic type upon the matching of hash values and different dynamic types upon the non-matching of hash values. A further manner (the 'unique type descriptor' method) determines and compares the addresses of the type descriptors in memory to determine whether the dynamic types are the same."

In addition to obtaining background information on this patent application, VerticalNews editors also obtained the inventors' summary information for this patent application: "The above-discussed manners of comparing the dynamic types of polymorphic entities of an executable file at runtime are deficient in a number of regards. For example, the string-compare method requires access to one or more strings of the type descriptors of each of two or more polymorphic entities. As a result, runtime performance of the executable is often degraded because string comparison is slow. As another example, the hash-value compare method can lead to hash collision and thus incorrect processing results (e.g., in the situation where two different type descriptors having different type names hash to the same hash value).

"Still further, it is often desirable to 'lazily load' shared libraries at run time or, in other words, to delay loading a shared object into the memory space of an executing program until a function or subroutine that resides in the shared object is called or referenced by the executing program. However, references to variables (e.g. information, data) that reside in a shared library would cause the shared library to be loaded into the executing program's memory space immediately at the start of runtime of the executing program. In this regard, the unique type descriptor method can break the lazy loading of shared libraries that include type descriptor definitions as the type descriptors are data. As a result, an entire shared library may be loaded into the execution space of a program even though it may ultimately be unnecessary for the proper functioning of the executable file.

"The present invention is directed to methods and systems adapted to avoid the above-discussed problems with current manners of comparing and analyzing the dynamic types of two polymorphic entities at runtime of an executable file. Briefly, the following description provides methods, systems, software, and the like (e.g., utilities) that uniquely define a number of Fortran type descriptors (or types of type descriptors) at a respective number of particular addresses within the memory space of an executing program and/or shared library to allow the dynamic types of two polymorphic entities to be compared with high accuracy by comparing the addresses of the Fortran type descriptors associated with each of the polymorphic entities. More specifically, each type of type descriptor has a single copy appropriately defined in either an executable file or a shared library. Thereafter, and as will be discussed in more detail below, all references (e.g., originating from the executable and/or a shared library) to a particular type of type descriptor definition (e.g. located in the executable and/or the shared library) can be bound to the single copy of the particular type of type descriptor. The above arrangement thus effectively results in only a single (e.g., unique) copy of each type of type descriptor to which all polymorphic entities (and/or all of the polymorphic entities that could possibly assume dynamic types corresponding to such type descriptor types) point or reference. Hence, the dynamic types of two or more polymorphic entities can be compared and/or analyzed with high accuracy by comparing the addresses of the type descriptors associated with each of the polymorphic entities (e.g., once identifiers of the particular type descriptors have been resolved into memory addresses).

"Unlike previous manners of comparing the dynamic types of polymorphic entities, two polymorphic entities associated with Fortran type descriptors having different memory addresses necessarily implies (i.e., in the absence of software bugs or other processing errors) that the two polymorphic entities are not of the exact same dynamic type (i.e., due to the presence of only a single copy of each type of type descriptor definition to which all polymorphic entities in the executable and/or shared library(ies) point or reference). Also in contrast to previous manners of comparing the dynamic types of polymorphic entities, the present utilities allow one or more shared libraries (that may or may not include, inter alia, copies of type descriptor definitions) to be lazily loaded at run time of an executable due to polymorphic entities referencing the single copies of the various types of Fortran type descriptor definitions in the executable instead of in the one or more shared libraries.

"The present utilities generally achieve the provision of single or unique copies of each of a number of types of Fortran type descriptors to which polymorphic entities can reference. In one arrangement, this is done by instantiating each of a number of types of type descriptors (e.g., during compile-time) in each of a number of object files in which polymorphic entities are defined or referenced, associating common types of type descriptors across the object files with common COMDAT groups (e.g., associating each copy of type descriptor 1 across the object files with COMDAT group 1, and so on), and marking each of the instantiated type descriptors (and in some embodiments type descriptors resident in one or more shared libraries) with a singleton attribute (e.g., STV_SINGLETON). The COMDAT groupings cause a linker to select a single copy among the plurality of copies for each type of type descriptor and to discard the remaining copies while the singleton attribute causes a runtime linker to bind all references to each type of type descriptor (e.g., originating from the executable and/or a shared library) to the single or unique copy of the type of type descriptor, either in the executable file (e.g., as the single copy of each type of type descriptor in the executable would occur at runtime before any duplicate copies resident in shared libraries to which the executable depends) or, if the executable contains no copy of that type of type descriptor, in a shared library.

"In one aspect, a computer-implemented method includes generating a plurality of object files from a plurality of source code portions, where at least one of the source code portions contains one or more variables (e.g., polymorphic entities). At compile time, type descriptor definitions of the polymorphic entities are instantiated in (e.g., copied into) each of the object files and each of such type descriptor definitions is marked with a singleton attribute. Additionally, common type descriptor definition copies are associated with common COMDAT groups across the object files.

"For instance, a folding operation (e.g., COMDAT folding) of common type descriptor definitions across the plurality of object files may be performed to obtain a single copy of each type of type descriptor definition in an executable file, each of which resides at a particular address in the memory space of the executing program. In some arrangements, the singleton attribute of each of the single copies of the various types of type descriptor definitions may be used to bind, for each type of type descriptor, all references to the type descriptor (e.g., whether originating in the executable and/or in a related shared object or library) to the single copy, whether it is resident in the executable or in a shared library. Thereafter, the address of a type descriptor definition of a first polymorphic entity of the executable file may be compared to an address of a type descriptor definition of a second polymorphic entity of the executable file to determine whether a dynamic type of the first polymorphic entity is the same as the dynamic type of the second polymorphic entity. Instructions can then be executed based on, for instance, whether or not the dynamic type of the first polymorphic entity is the same as the dynamic type of the second polymorphic entity, is an extension of the dynamic type of the second polymorphic entity or another object, and the like.

"Any of the embodiments, arrangements, or the like discussed herein may be used (either alone or in combination with other embodiments, arrangement, or the like) with any of the disclosed aspects. Merely introducing a feature in accordance with commonly accepted antecedent basis practice does not limit the corresponding feature to the singular. Any failure to use phrases such as 'at least one' does not limit the corresponding feature to the singular. Use of the phrase 'at least generally,' 'at least partially,' 'substantially' or the like in relation to a particular feature encompasses the corresponding characteristic and insubstantial variations thereof. Furthermore, a reference of a feature in conjunction with the phrase 'in one embodiment' does not limit the use of the feature to a single embodiment.

"In addition to the exemplary aspects and embodiments described above, further aspects and embodiments will become apparent by reference to the drawings and by study of the following descriptions.

BRIEF DESCRIPTION OF THE DRAWINGS

"FIG. 1 is a block diagram of a computing system that allows a programmer or other user to build and produce a runnable process that utilizes unique Fortran type descriptor definitions for polymorphic entities while limiting the breakage of the lazy loading of shared objects and/or libraries.

"FIG. 2 is a flow diagram that illustrates the generation of an executable file including unique definitions of each of a number of different types of Fortran type descriptors to which all polymorphic entities within the execution environment refer.

"FIG. 3 is a method that may be performed by a compiler of the computing system of FIG. 1 to generate objects files from source code portions with type descriptor definitions, COMDAT groupings, and singleton attributes.

"FIG. 4 is a method that may be performed by one or more linkers or linking units that use the object files of FIG. 3 to uniquely define each of a number of types of type descriptors within the address space of an executable file or shared library.

"FIG. 5 is a method that may be performed by comparison code of the executable file of FIG. 4 to determine a degree to which the dynamic type of a first polymorphic entity relates to that of a second polymorphic entity"

For more information, see this patent application: MEIROWITZ, DIANE R.; BASON, IAIN GEORGE. Systems and Methods for Uniquely Defining Fortran Run Type Descriptors for Polymorphic Entities. Filed February 17, 2014 and posted June 19, 2014. Patent URL: http://appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.html&r=203&p=5&f=G&l=50&d=PG01&S1=20140612.PD.&OS=PD/20140612&RS=PD/20140612

Keywords for this news article include: Software, Oracle International Corporation.

Our reports deliver fact-based news of research and discoveries from around the world. Copyright 2014, NewsRx LLC


For more stories covering the world of technology, please see HispanicBusiness' Tech Channel



Source: Computer Weekly News


Story Tools






HispanicBusiness.com Facebook Linkedin Twitter RSS Feed Email Alerts & Newsletters