Short pointer mode applications in long pointer mode environments
AssigneeInternational Business Machines Corporation
InventorMichael K. Gschwind
Life of this patent
Estimating the term…
Abstract
Short pointer mode applications are able to execute in long pointer mode environments. A plurality of actions is performed to prepare a short pointer mode application for execution in the long pointer mode environment. These actions include allocating memory for one or more in-memory short pointers of the application. The memory being allocated for an in-memory short pointer is of a size corresponding to a size of the in-memory short pointer. Further, a register is allocated for an in-register short pointer of the application. The register is allocated at a size corresponding to a long pointer mode. The size corresponding to the long pointer mode is different from the size of the in-memory short pointer.
Claims20
A computer program product for facilitating processing in a computing environment, said computer program product comprising:
- a computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
- obtaining, by a compiler executing on a processor of the computing environment, an application to be compiled and an indication that the application is a short pointer mode application that is to be executed in a long pointer mode environment;
- performing a compilation process, based on obtaining the application to be compiled, the compilation process comprising performing, based on the indication that the application is a short pointer mode application that is to be executed in a long pointer mode environment, a plurality of actions to prepare the application defined as the short pointer mode application for execution in the long pointer mode environment, the plurality of actions including:
- translating the application into a compiler internal representation;
- determining whether a plurality of short pointers of the application are to be allocated in memory as in-memory short pointers or in one or more processor registers as in-register short pointers, wherein one short pointer of the plurality of short pointers is to be allocated as an in-memory short pointer and another short pointer of the plurality of short pointers is to be allocated as an in-register short pointer;
- allocating, based on determining the one short pointer is to be allocated in memory, memory for the in-memory short pointer, the memory being allocated for the in-memory short pointer being of a size corresponding to a size of the in-memory short pointer;
- and
- allocating, based on determining the other short pointer is to be allocated in the processor register, a register for the in-register short pointer of the application, the register being allocated at a size corresponding to a long pointer mode, the size corresponding to the long pointer mode being different from the size of the in-memory short pointer;
- receiving a shared pointer in a short pointer compilation, the shared pointer to be shared with a long pointer mode application and the short pointer mode application;
- and
- performing sharing actions, based on receiving the shared pointer, wherein the sharing actions comprise allocating the shared pointer as a long pointer, and writing the shared pointer as a zero-extended long pointer.
A computer system for facilitating processing in a computing environment, said computer system comprising:
- one or more processors to perform a method, said method comprising:
- obtaining, by a compiler executing on a processor of the computing environment, an application to be compiled and an indication that the application is a short pointer mode application that is to be executed in a long pointer mode environment;
- performing a compilation process, based on obtaining the application to be compiled, the compilation process comprising performing, based on the indication that the application is a short pointer mode application that is to be executed in a long pointer mode environment, a plurality of actions to prepare the application defined as the short pointer mode application for execution in the long pointer mode environment, the plurality of actions including:
- translating the application into a compiler internal representation;
- determining whether a plurality of short pointers of the application are to be allocated in memory as in-memory short pointers or in one or more processor registers as in-register short pointers, wherein one short pointer of the plurality of short pointers is to be allocated as an in-memory short pointer and another short pointer of the plurality of short pointers is to be allocated as an in-register short pointer;
- allocating, based on determining the one short pointer is to be allocated in memory, memory for the in-memory short pointer, the memory being allocated for the in-memory short pointer being of a size corresponding to a size of the in-memory short pointer;
- and
- allocating, based on determining the other short pointer is to be allocated in the processor register, a register for the in-register short pointer of the application, the register being allocated at a size corresponding to a long pointer mode, the size corresponding to the long pointer mode being different from the size of the in-memory short pointer;
- receiving a shared pointer in a short pointer compilation, the shared pointer to be shared with a long pointer mode application and the short pointer mode application;
- and
- performing sharing actions, based on receiving the shared pointer, wherein the sharing actions comprise allocating the shared pointer as a long pointer, and writing the shared pointer as a zero-extended long pointer.
Dependencies are inferred from the claim text.