Claims
- 1. A method for scanning a discontiguous object, comprising:
initializing a cursor into a data structure having entries that correspond to slots of the discontiguous object and specifying whether the corresponding slots have a reference type; determining whether an entry of the data structure corresponding to the cursor specifies whether a slot of the discontiguous object corresponding to the entry has a reference type; and if the slot of the discontiguous object corresponding to the entry has a reference type, then performing an operation on an object referenced by the slot.
- 2. A method according to claim 1, wherein the entries further indicate corresponding increment values to reach successive slots, said method further comprising:
initializing a scan cursor to indicate a slot of the discontiguous object; and modifying the scan cursor to indicate a successive slot based on an increment value corresponding to the slot.
- 3. A method according to claim 2, wherein the scan cursor includes one of an integer index, a pointer, and a numeric reference.
- 4. A method according to claim 2, wherein performing the garbage collection on the object referenced by the slot includes:
accessing the slot by dereferencing the scan cursor.
- 5. A method according to claim 2, wherein:
the scan cursor includes a scan pointer; the discontiguous object is disposed on at least first page and a second page other than the first page; and modifying the scan pointer to point to a successive slot based on the increment value includes:
determining whether a sum of the increment value and the scan pointer exceeds an end of the first page; if the sum of the increment value and the scan pointer exceeds the end of the first page, then setting the scan pointer to point to a successive slot of the object disposed on the second page; and if the sum of the increment value and the first pointer does not exceed the end of the first page, then incrementing the first pointer by the increment value.
- 6. A method according to claim 2, wherein each of the entries consist of a first field and a second field, said first field specifying whether the slot of the discontiguous object corresponding to the entry has the reference type and said second field specifying a corresponding increment value to reach a successive slot.
- 7. A method according to claim 2, wherein each of the entries consists of a single machine word.
- 8. A method according to claim 1, further comprising:
incrementing the cursor to a successive entry in the data structure that corresponds to a subsequent slot in the object.
- 9. A method according to claim 1, wherein the data structure is stored contiguously in memory.
- 10. A method according to claim 1, wherein the cursor includes one of an integer index, a pointer, and a numeric reference.
- 11. A method according to claim 1, wherein the operation includes a garbage collection operation.
- 12. A computer-readable medium bearing instructions for scanning a discontiguous object, said instruction being arranged, upon execution by one or more processors, to perform the method according to claim 1.
- 13. A method for facilitating scanning of an object, comprising:
accessing a description of the object, said description indicating a plurality of slots and corresponding types, wherein at least one of the types is a reference type; and generating a data structure having entries corresponding to the slots that indicate whether each of the corresponding slots has a reference type.
- 14. A method according to claim 13, wherein the entries further indicate respective increment values to reach successive slots.
- 15. A method according to claim 14, wherein each of the entries consist of a first field and a second field, said first field indicating whether the slot of the discontiguous object corresponding to the entry has the reference type and said second field indicating a corresponding increment value to reach a successive slot.
- 16. A method according to claim 14, wherein each of the entries consists of a single machine word.
- 17. A method according to claim 13, wherein the data structure is stored contiguously in memory.
- 18. A computer-readable medium bearing instructions for scanning a discontiguous object for garbage collection, said instruction being arranged, upon execution by one or more processors, to perform the method according to claim 13.
- 19. A method for scanning a discontiguous object for garbage collection, said discontiguous object having a plurality a slot and being disposed on a plurality of pages, said method comprising:
accessing a description of the discontiguous object, said description indicating a plurality of slots and corresponding types, wherein at least one of the types is a reference type; generating a contiguous data structure having entries corresponding to the slots, each of said entries consisting of a single machine word and indicating whether a corresponding one of the slots has a reference type and that indicates indicating a corresponding increment value to reach a successive slot; initializing a first pointer to a slot of the discontiguous object; initializing a second pointer to the contiguous data structure; and traversing the contiguous data structure by repeatedly incrementing the second pointer to point to successive entries of the contiguous data structure and for each iteration, performing the steps of:
determining whether an entry of the contiguous data structure pointed to by the pointer indicates whether a slot of the discontiguous object corresponding to the entry has a reference type; and if the slot of the discontiguous object corresponding to the entry has a reference type, then performing garbage collection on an object referenced by a slot pointed to by the first pointer; determining whether a sum of the increment value indicated by the entry and the first pointer exceeds an end of one of the pages; if the sum of the increment value and the first pointer exceeds the end of the one of the pages, then setting the first pointer to point to a successive slot of the object on another one of the pages; and if the sum of the increment value and the first pointer does not exceed the end of the one of the pages, then incrementing the first pointer by the increment value.
- 20. A computer-readable medium bearing instructions for scanning the discontiguous object for garbage collection, said instruction being arranged, upon execution by one or more processors, to perform the method according to claim 19.
RELATED APPLICATIONS
[0001] The present application claims the benefit of U.S. Provisional Patent Application Serial No. 60/378,391 filed on May 8, 2002 (attorney docket number 50277-1054), the contents of which are hereby incorporated by reference.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60378391 |
May 2002 |
US |