Claims
- 1. A method of tracking references to objects of an object-oriented programming environment, said method comprising:
providing a reference stack associated with an execution stack; determining whether at least one value should be stored in said reference stack; and storing said at least one value in said reference stack when said determining determines that said at least one object should be stored in said reference stack.
- 2. A method as recited in claim 1, wherein said object-oriented programming environment is Java programming environment.
- 3. A method as recited in claim 1, wherein said reference stack and said execution stack have the same size.
- 4. A method as recited in claim 1, wherein said at least one reference to said object is stored in an entry with an offset that is the same as the offset used to store said at least one reference in said execution stack.
- 5. A method as recited in claim 4, wherein said stored reference to said object is a reference to a newly instantiated object.
- 6. A method as recited in claim 4, wherein said stored reference to said object is associated with setting a local variable of said computer programming environment.
- 7. A method as recited in claim 4, wherein said stored reference to said object is associated with a Getfield operation.
- 8. A method as recited in claim 4, wherein said stored reference to said object is associated with an Aload operation.
- 9. A method as recited in claim 4, wherein said stored reference to said object is associated with an Areturn operation.
- 10. A method as recited in claim 4, wherein said stored reference to said object is associated with a Getstatic operation.
- 11. A method as recited in claim 1, wherein said providing of said reference stack further comprises:
initializing entries of said reference stack to zero.
- 12. A method of tracking references to Java objects, said method comprising:
providing a reference stack associated with an execution stack, said reference stack being the same size of said execution stack; determining whether at least one value should be stored in said reference stack, wherein said determining is performed during Bytecode verification; and storing at least one value in said reference stack in an offset that is the same as an offset in said execution stack where said value is stored, when said determining determines that said at least one object should be stored in said reference stack.
- 13. A method as recited in claim 12, wherein said determining further comprises:
determining whether a new object is being instantiated; determining whether a local variable is being set when it is determined that a new object is not being instantiated; and determining whether a Getfield, Afield, Aload, Areturn, or a Getstatic operation is being performed when it is determined that a local variable is being set.
- 14. In an object-oriented programming environment, a reference stack suitable for storing references to objects of a computer program written in said object-oriented programming environment, wherein said reference stack corresponds to an execution stack of said computer program which is also suitable for storing references to objects of said computer program, and wherein at least one reference to an object is stored both on said reference stack and said execution stack.
- 15. A reference stack as recited in claim 14, wherein said programming environment is Java programming environment.
- 16. A reference stack as recited in claim 14, wherein said reference stack and execution stack have the same size.
- 17. A reference stack as recited in claim 16, wherein said size is 2, 4, or 8 Kilo Bytes.
- 18. A method for identifying references to Java objects, said method comprising:
reading a value stored in an entry of a reference stack; determining whether said value is equal to another value that is stored in a corresponding entry of an execution stack; and marking said value in said entry of said reference stack as a reference to a Java object when said determining determines that said value is equal to said another value stored in said corresponding entry of said execution stack.
- 19. A method as recited in claim 16, wherein said method comprises:
setting said value in said entry of said reference stack to zero when said determining determines that said value is not equal to said another value stored in said corresponding entry of said execution stack.
- 20. A method as recited in claim 16, wherein said marked value is marked for garbage collection application.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is related to U.S. Patent Application No. ______ (Att.Dkt.No. SUN1P833/P6212), entitled “IDENTIFYING REFERENCES TO OBJECTS DURING BYTECODE VERIFICATION”, filed on an even date, and hereby incorporated herein by reference for all purposes.