Methods and systems for dynamically growing multiple stacks
AssigneeSun Microsystems, Inc.
InventorMichael L. Boucher
Life of this patent
Estimating the term…
Abstract
An allocation instructions and an extension instructions allow a program to continue to execute even when the program requires more stack space than has been allocated to the program. The methods and systems thereby allow programs to run to completion in more situations than programs running in conventional data processing systems. As a result, the programs avoid wasting computing resources by terminating prematurely, without producing results.
Claims60
A method in a data processing system having a stack for allocating a new stack frame in stack overflow memory for a subroutine, the new stack frame bounded by a frame pointer and a stack pointer, the method comprising the steps of:
- establishing a placeholder stack frame on the stack, the placeholder stack frame extending from the stack to the stack overflow memory;
- and
- establishing the new stack frame for the subroutine in the stack overflow memory.
A method in a data processing system for extending an existing stack frame on a stack into stack overflow memory, the existing stack frame bounded by a frame pointer and a stack pointer, the method comprising the steps of:
- allocating a memory block in the stack overflow memory;
- setting an allocation reference to point to the memory block;
- and
- setting the stack pointer beyond the allocation reference to create an extension for the existing stack frame.
A computer-readable medium containing instructions that cause a data processing system having a stack to perform a method for allocating a new stack frame in stack overflow memory, the new stack frame bounded by a frame pointer and a stack pointer, the method comprising the steps of:
- establishing a placeholder stack frame on the stack, the placeholder stack frame extending from the stack to the stack overflow memory area;
- and
- establishing the new stack frame in the stack overflow memory.
A computer-readable medium containing instructions that cause a data processing system to perform a method for extending an existing stack frame on a stack into stack overflow memory the existing stack frame bounded by a frame pointer and a stack pointer, the method comprising the steps of:
- allocating a memory block in the stack overflow memory;
- setting an allocation reference to point to the memory block;
- and
- setting the stack pointer beyond the allocation reference to create an extension for the existing stack frame.
A data processing system comprising:
- a memory comprising a stack, stack overflow memory, and stack frame allocation instructions, the stack frame allocation instructions allocating a new stack frame for a subroutine bounded by a frame pointer and a stack pointer in stack overflow memory by establishing a placeholder stack frame that extends from the stack to the stack overflow memory, and establishing the new stack frame in the stack overflow memory area;
- and
- a processor that runs the stack frame allocation instructions.
A data processing system comprising:
- a memory comprising a stack holding an existing stack frame bounded by a frame pointer and a stack pointer and stack frame extension instructions, the stack frame extension instructions extending the existing stack frame by setting an allocation reference to point to an overflow memory area outside of the stack;
- and setting the stack pointer beyond the allocation reference to create an extension for the existing stack frame;
- and
- a processor that runs the stack frame allocation instructions.
A data processing system for allocating a new stack frame bounded by a frame pointer and a stack pointer to store data used by a subroutine, the data processing system comprising:
- means for establishing a placeholder stack frame on a stack, the placeholder stack frame extending from the stack to overflow memory in a stack overflow memory area;
- and
- means for establishing the new stack frame in the overflow memory for the subroutine.
A data processing system for extending an existing stack frame bounded by a frame pointer and a stack pointer, the data processing system comprising:
- means for setting an allocation reference to point to an overflow memory area beyond the stack;
- and
- means for setting the stack pointer beyond the allocation reference to bound a stack extension for the existing stack frame.
A method in a data processing system for allocating storage space for a subroutine using a stack, the method comprising the steps of:
- determining when the stack lacks sufficient space to hold a new stack frame, and, in response:
- establishing a placeholder stack frame on the stack, the placeholder stack frame extending from the stack to a stack overflow memory area;
- and
- establishing the new stack frame in the stack overflow memory;
- and
- initiating a stack memory allocation request to extend an existing stack frame bounded by a frame pointer and a stack pointer;
- determining when the stack lacks sufficient space to meet the stack memory allocation request, and, in response:
- setting the stack pointer to point to the stack overflow memory;
- allocating a memory block in the stack overflow memory;
- setting an allocation reference to point to the memory block;
- and
- setting the stack pointer beyond the allocation reference to create an extension to meet the stack memory allocation request.
A data processing system for compiling a program that uses a stack and that comprises source code instructions, the data processing system comprising:
- a memory comprising a compiler and the source code instructions, the compiler adding stack frame allocation instructions during compilation of the source code instructions, the stack frame allocation instructions for establishing a placeholder stack frame on the stack that extends from the stack to stack overflow memory, and establishing the new stack frame for the program in the stack overflow memory, the compiler further adding stack extension instructions during compilation of the source code instructions, the stack extension instructions for extending an existing stack frame on the stack into the stack overflow memory, the existing stack frame bounded by a frame pointer and a stack pointer, by allocating a memory block in the stack overflow memory, setting an allocation reference to point to the memory block, and setting the stack pointer beyond the allocation reference to create an extension for the existing stack frame;
- and
- a processor that runs the compiler.
A method in a data processing system having a compiler, the method comprising the steps performed by the compiler of:
- receiving source code for a program using a stack and comprising instructions;
- and
- generating compiled ones of the instructions that include stack allocation instructions for establishing a placeholder stack frame on the stack that extends from the stack to stack overflow memory, and establishing the new stack frame for the program in the stack overflow memory.
A computer-readable medium containing instructions that cause a data processing system to perform a method comprising the steps performed by a compiler of:
- receiving source code for a program using a stack and comprising instructions;
- and
- generating compiled ones of the instructions that include stack allocation instructions for establishing a placeholder stack frame on the stack that extends from the stack to stack overflow memory, and establishing the new stack frame for the program in the stack overflow memory.
Dependencies are inferred from the claim text.