Automatic conversion of source code from 32-bit to 64-bit
AssigneeSun Microsystems, Inc.
InventorPaul J. Hinker
Life of this patent
Estimating the term…
Abstract
In accordance with methods and systems consistent with the present invention, a system that automatically generates 32-bit to 64 bit interfaces to 64-bit code is provided. These interfaces provide for the use of optional parameters and, because they are written in 64-bit code, also allow for parameter checking. These interfaces are automatically generated to allow a programmer to maintain compatibility with 64-bit libraries from 32-bit source code.
Claims27
A method in a data processing system, comprising the steps of:
- receiving 32-bit source code;
- generating, from the 32-bit source code, a 32-bit interface file including statements describing characteristics of parameters in the 32-bit source code, wherein generating a 32-bit interface file includes invoking an interface generator that:
- scans the 32-bit source code and creates the interface file according to a definition;
- and
- adds to the interface file the statements describing characteristics of the parameters by parsing the 32-bit source code;
- and
- automatically generating, based on the statements in the 32-bit interface file, a 32-bit to 64-bit conversion stub that is used by the 32-bit source code to invoke 64-bit code, wherein automatically generating a 32-bit to 64-bit conversion stub includes invoking a stub generator that:
- reads the 32-bit interface file to populate a hash table with information identifying the parameters in the interface file;
- re-reads the 32-bit interface file to populate the hash table with information indicating processing that occurs for the statements in the interface file;
- and
- generates the 32-bit to 64-bit conversion stub using the hash table.
A computer-readable memory device containing instructions for controlling a data processing system to perform a method comprising the steps of:
- receiving 32-bit source code;
- generating, from the 32-bit source code, a 32-bit interface file including statements describing characteristics of parameters in the 32-bit source code, wherein generating a 32-bit interface file includes invoking an interface generator that
- scans the 32-bit source code and creates the interface file according to a definition;
- and
- adds to the interface file the statements describing characteristics of the parameters by parsing the 32-bit source code;
- and
- automatically generating, based on the statements in the 32-bit interface file, a 32-bit to 64-bit conversion stub that is used by the 32-bit source code to invoke 64-bit code, wherein automatically generating a 32-bit to 64-bit conversion stub includes invoking a stub generator that
- reads the 32-bit interface file to populate a hash table with information identifying the parameters in the interface file;
- re-reads the 32-bit interface file to populate the hash table with information indicating processing that occurs for the statements in the interface file;
- and
- generates the 32-bit to 64-bit conversion stub using the hash table.
A data processing system comprising:
- means for receiving 32-bit source code;
- means for generating, from the 32-bit source code, a 32-bit interface file including statements describing characteristics of parameters in the 32-bit source code,
- wherein the means for generating a 32-bit interface file includes means for invoking an interface generator that
- scans the 32-bit source code and creates the interface file according to a definition;
- and
- adds to the interface file the statements describing characteristics of the parameters by parsing the 32-bit source code;
- and
- means for automatically generating, based on the statements in the 32-bit interface file, a 32-bit to 64-bit conversion stub that is used by the 32-bit source code to invoke 64-bit code, wherein the means for automatically generating a 32-bit to 64-bit conversion stub includes means for invoking a stub generator that
- reads the 32-bit interface file to populate a hash table with information identifying the parameters in the interface file;
- re-reads the 32-bit interface file to populate the hash table with information indicating processing that occurs for the statements in the interface file;
- and
- generates the 32-bit to 64-bit conversion stub using the hash table.
Dependencies are inferred from the claim text.