IP Library Granted Patent US 12693982
Granted Patent B2
US 12693982 · App. 18/063,730 · Granted Jul 28, 2026

Heap protection system

Inventors: Joran S.C. Siu (Thornhill, CA); Alper Buyuktosunoglu (White Plains, NY); Richard H. Boivie (Monroe, CT); Tong Chen (Yorktown Heights, NY)
Assignee: International Business Machines Corporation
G06F12/1441G06F12/0261
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12693982
App. No.
18/063,730
Granted
Jul 28, 2026
Kind
B2
Abstract

A computer implemented method handles object references. A computer system determines whether an object reference fetched by a load instruction has an expected value for heap protection for a heap in response to receiving the load instruction for execution. The computer system generates an event in response to the object reference not being the expected value, wherein the event is used to manage the object reference. According to other illustrative embodiments, a computer system and a computer program product for managing object references are provided. As a result, the illustrative embodiments can prevent a load instruction from loading an invalid object reference that does not point to a memory location in a heap.

Claims (44)

1 . A computer implemented method for managing object references, the computer implemented method comprising:

determining, by a computer system, whether an object reference fetched by a load instruction has an expected value for heap protection for a heap before loading the object reference for use, in response to receiving the load instruction for execution;

associating, by the computer system, a heap protection check with the load instruction, the heap protection check is used for heap protection and garbage collection, wherein heap protection control information defines a first range of memory locations for the heap for the heap protection, and wherein garbage collection control information defines a second range of memory locations for a subset of the heap for the garbage collection;

determining, by the computer system, whether the object reference has the expected value using the first range of memory locations using the heap protection control information in response to performing the heap protection;

determining, by the computer system, whether the object reference points to an object in the second range of memory locations for the garbage collection using the garbage collection control information in response to performing the garbage collection; and

generating, by the computer system, an event in response to the object reference not being the expected value, wherein the event is used to manage the object reference.

2 . The computer implemented method of claim 1 further comprising:

loading the object reference in response to the object reference having the expected value.

3 . The computer implemented method of claim 1 , wherein the expected value for the object reference is one of a null value and a memory location within a range of memory locations in the heap.

4 . The computer implemented method of claim 3 , wherein the range of memory locations in the heap is at least one selected from a group consisting of: a portion of the heap and all of the heap.

5 . The computer implemented method of claim 1 , wherein the event is an interrupt to an interrupt handler that generates diagnostic information relating to the object reference.

6 . The computer implemented method of claim 1 , wherein associating the heap protection check with the load instruction comprises:

adding a load guarded instruction in place of the load instruction, wherein the load guarded instruction causes a check of the object reference prior to completing a load of the object reference.

7 . The computer implemented method of claim 1 , wherein associating the heap protection check with the load instruction comprises:

inserting a load guarded instruction prior to the load instruction, wherein the load guarded instruction causes a check of the object reference fetched in the load instruction.

8 . A computer system comprising:

a number of processor units, wherein the number of processor units executes program instructions to:

determine whether an object reference in a load instruction has an expected value for heap protection for a heap before loading the object reference for use in response to receiving the load instruction;

associate a heap protection check with the load instruction, the heap protection check is used for heap protection and garbage collection, wherein heap protection control information defines a first range of memory locations for the heap for the heap protection, and wherein garbage collection control information defines a second range of memory locations for a subset of the heap for the garbage collection;

determine whether the object reference has the expected value using the first range of memory locations using the heap protection control information in response to performing the heap protection;

determine whether the object reference points to an object in the second range of memory locations for the garbage collection using the garbage collection control information in response to performing the garbage collection; and

generate an event in response to the object reference not being the expected value, wherein the event is used to manage the object reference.

9 . The computer system of claim 8 , wherein the number of processor units executes program instructions to:

load the object reference in response to the object reference having the expected value.

10 . The computer system of claim 8 , wherein the expected value for the object reference is one of a null value and a memory location within a range of memory locations in the heap.

11 . The computer system of claim 10 , wherein the range of memory locations in the heap is at least one selected from a group consisting of: a portion of the heap and all of the heap.

12 . The computer system of claim 8 , wherein the event is an interrupt to an interrupt handler that generates diagnostic information relating to the object reference.

13 . The computer system of claim 8 , wherein in associating the heap protection check with the load instruction, the number of processor units executes program instructions to:

add a load guarded instruction in place of the load instruction, wherein the load guarded instruction causes a check of the object reference prior completing a load of the object reference.

14 . The computer system of claim 8 , wherein in associating the heap protection check with the load instruction, wherein the number of processor units executes program instructions to:

insert a load guarded instruction prior to the load instruction, wherein the load guarded instruction causes a check of the object reference fetched by the load instruction.

15 . A computer program product for managing object references, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer system to cause the computer system to perform a method of:

determining, by the computer system, whether an object reference fetched by a load instruction has an expected value for heap protection for a heap before loading the object reference for use, in response to receiving the load instruction;

associating, by the computer system, a heap protection check with the load instruction, the heap protection check is used for heap protection and garbage collection, wherein heap protection control information defines a first range of memory locations for the heap for the heap protection, and wherein garbage collection control information defines a second range of memory locations for a subset of the heap for the garbage collection;

determining, by the computer system, whether the object reference has the expected value using the first range of memory locations using the heap protection control information in response to performing the heap protection;

determining, by the computer system, whether the object reference points to an object in the second range of memory locations for the garbage collection using the garbage collection control information in response to performing the garbage collection; and

generating, by the computer system, an event in response to the object reference not being the expected value, wherein the event is used to manage the object reference.

16 . The computer program product of claim 15 further comprising:

loading the object reference in response to the object reference having the expected value.

17 . The computer program product of claim 15 , wherein the expected value for the object reference is one of a null value and a memory location within a range of memory locations in the heap.

18 . The computer program product of claim 17 , wherein the range of memory locations in the heap is at least one selected from a group consisting of: a portion of the heap and all of the heap.

19 . The computer program product of claim 15 , wherein the event is an interrupt to an interrupt handler that generates diagnostic information relating to the object reference.

20 . The computer program product of claim 15 , wherein associating the heap protection check with the load instruction comprises:

adding a load guarded instruction in place of the load instruction, wherein the load guarded instruction causes a check of the object reference prior to completing a load of the object reference.