USRE39519EExpiredUtility

Mixed execution stack and exception handling

67
Assignee: SUN MICROSYSTEMS INCPriority: Oct 6, 1997Filed: Jul 1, 2004Granted: Mar 13, 2007
Est. expiryOct 6, 2017(expired)· nominal 20-yr term from priority
G06F 9/00G06F 9/4484G06F 9/45504G06F 9/461
67
PatentIndex Score
9
Cited by
14
References
38
Claims

Abstract

Systems and methods for implementing an execution stack which stores frames for functions written in multiple programming languages are provided. The frames for functions written in different programming languages may be interleaved on the same execution stack. A data block on the execution stack may be utilized to traverse the execution stack around a frame by storing a stack pointer and frame pointer to a previous frame. Additionally, exceptions may be propagated, with conversion if necessary, through frames on the execution stack that are written in different programming languages.

Claims

exact text as granted — not AI-modified
1. In a computer system, a method for allocating  preallocating resources for functions written in a plurality of programming languages, the method comprising:
 storing a first frame on the  an execution stack for a first function, the first function being written in a first programming language; and  
 calling a second function using the first function, the second function being written in a second programming language; and  
 allocating resources for functions written in programming languages other than a  the second programming language that may be called by the second function.  
 
     
     
       2. The method of  claim 1 , further comprising upon exiting the second function, deallocating the resources for functions written in programming languages other than the second programming language. 
     
     
       3. The method of  claim 1  wherein calling the second function using the first function includes executing the second function, the method further including catching an exception that was raised during execution of the second function that was not handled by an exception handler for the second function. 
     
     
       4. The method of  claim 3  further including:
 identifying an exception handler for the data block to handle the exception; and  
 jumping from the second function to the identified exception handler.  
 
     
     
       5. The method of  claim 4  wherein the identified exception handler stores the exception in a local storage associated with a thread which causes the second function to be called using the first function. 
     
     
       6. The method of  claim 5  further including:
 returning to the first function from the second function; and  
 checking the local storage to determine whether an exception is pending; and  
 throwing the stored exception when it is determined that the exception is pending.  
 
     
     
       7. In a computer system, a method for handling exceptions for functions written in a plurality of programming languages, the method comprising:
 storing a first frame on the  an execution stack for a first function, the first function being written in a first programming language;  
 calling a second function with a first function, the second function being written in a second programming language; and  
 catching an exception that was raised during execution of the second function that was not handled by an exception handler for the second function; and  
   determining if the exception can be translated .  
 
     
     
       8. The method of  claim 7 , further comprising identifying an exception handler for the data block to handle the exception and jumping to the identified exception handler. 
     
     
       9. The method of  claim 8 , wherein the identified exception handler stores the exception in local storage. 
     
     
       10. The method of  claim 9 , wherein the local storage is storage associated with a current thread in which the first and second functions are executing. 
     
     
       11. The method of  claim 9 , further comprising upon returning to the first function, checking the local storage to determine if an exception is pending and throwing the stored exception if an exception is pending. 
     
     
       12. The method of  claim 11 , further comprising converting the stored exception to a format for the first programming language. 
     
     
       13. The method of  claim 7  wherein calling the second function with the first function includes storing a data block on the execution stack, the data block including a reference to another frame on the execution stack for a third function not written in the first programming language. 
     
     
       14. In a computer system, a method for implementing an execution stack that stores frames for functions written in a plurality of programming languages, the method comprising:
 storing a first frame on the execution stack for a first function, the first function being written in a first programming language;  
 storing a second frame on the execution stack for a second function, the second function being written in a second programming language; and  
 calling a third function from the second function, the third function being written in the first programming language, wherein calling the third function from the second function includes storing a data block on the execution stack that includes at least one reference to the first frame.  
 
     
     
       15. The method of  claim 14  further including storing the data block on the execution stack before a third frame for the third function. 
     
     
       16. The method of  claim 14  wherein the first programming language is the Java programming language. 
     
     
       17. The method of  claim 16  wherein the second programming language is one selected from the group consisting of the C++programming language, the Pascal programming language, the FORTRAN programming language, and an assembly language. 
     
     
       18. A method of implementing a mixed execution stack that can support a plurality of different programming languages in a computing environment, said method comprising:
   storing a first frame on said mixed execution stack, wherein said first frame is a frame for execution of computer program code written in a first programming language;        determining whether a second frame for execution of computer program code written in a second programming language is to be stored on said mixed execution stack, wherein said first and second programming languages are not the same programming language; and        storing at least one reference to said first frame when said determining determines that said second frame for execution of said computer program code written in said second programming language is to be stored on said mixed execution stack.     
     
     
       19. A method as recited in  claim 18 , wherein said method further comprises:
   storing said second frame on said mixed execution stack.     
     
     
       20. A method as recited in  claim 18 , wherein said method further comprises:
   storing said second frame on said mixed execution stack after said storing of at least one reference to said first frame.     
     
     
       21. A method as recited in  claim 18 , wherein said method further comprises:
   determining whether a third frame associated with said first programming language is to be stored on said mixed execution stack; and        storing said at least one reference to said first frame on said execution stack when said determines that said third frame is to be stored on said mixed execution stack.     
     
     
       22. A method as recited in  claim 18 , wherein said method further comprises:
   determining whether a third frame associated with said first programming language is to be stored on said mixed execution stack; and        storing an entry frame on said execution stack before said third frame is stored on said mixed execution stack.     
     
     
       23. A method as recited in  claim 18 , wherein said storing of said at least one reference to said first frame comprises:
   storing said at least one reference to a local storage.     
     
     
       24. A method as recited in  claim 18 , wherein said storing of said at least one reference to said first frame comprises:
   storing said at least one reference to a local storage before storing said at least one reference on said execution stack.     
     
     
       25. A method as recited in  claim 18 , wherein said first or second programming language is the Java programming language. 
     
     
       26. A virtual machine capable of using a mixed execution stack that can support a plurality of different programming languages in a computing environment, said virtual machine is capable of:
   storing a first frame on said mixed execution stack, wherein said first frame is a frame for execution of computer program code written in a first programming language;        determining whether a second frame for execution of computer program code written in a second programming language is to be stored on said mixed execution stack, wherein said first and second programming languages are not the same programming language; and        storing at least one reference to said first frame when said determining determines that said second frame for execution of said computer program code written in said second programming language is to be stored on said mixed execution stack.     
     
     
       27. A virtual machine as recited in  claim 25 , wherein said virtual machine is further capable of:
   storing said second frame on said mixed execution stack.     
     
     
       28. A virtual machine as recited in  claim 25 , wherein said virtual machine is further capable of:
   storing said second frame on said mixed execution stack after said storing of at least one reference to said first frame.     
     
     
       29. A virtual machine as recited in  claim 25 , wherein said virtual machine is further capable of:
   determining whether a third frame associated with said first programming language is to be stored on said mixed execution stack; and        storing said at least one reference to said first frame on said execution stack when said determines that said third frame stored on said mixed execution stack.     
     
     
       30. A virtual machine as recited in  claim 25 , wherein said first or second programming language is the Java programming language. 
     
     
       31. A virtual machine for preallocating resources for functions written in a plurality of programming languages, wherein said virtual machine is capable of:
   storing a first frame on the execution stack for a first function, the first function being written in a first programming language; and        calling a second function using the first function, the second function being written in a second programming language; and        allocating resources for functions written in programming languages other than a second programming language that may be called by the second function.     
     
     
       32. A virtual machine as recited in  claim 31 , wherein said virtual machine is further capable of:
   upon exiting the second function, deallocating the resources for functions written in programming languages other than the second programming language.     
     
     
       33. A virtual machine for handling exceptions for functions written in a plurality of programming languages, wherein said virtual machine is capable of:
   storing a first frame on the execution stack for a first function, the first function being written in a first programming language;        calling a second function with a first function, the second function being written in a second programming language;        catching an exception that was raised during execution of the second function that was not handled by an exception handler for the second function; and        determining if the exception can be translated.     
     
     
       34. A virtual machine as recited in  claim 33 , wherein said virtual machine is further capable of:
   identifying an exception handler for the data block to handle the exception; and        jumping to the identified exception handler.     
     
     
       35. A virtual machine for implementing an execution stack that stores frames for functions written in a plurality of programming languages, wherein said virtual machine is capable of:
   storing a first frame on the execution stack for a first function, the first function being written in a first programming language;        storing a second frame on the execution stack for a second function, the second function being written in a second programming language; and        calling a third function from the second function, the third function being written in the first programming language, wherein calling the third function from the second function includes storing a data block on the execution stack that includes at least one reference to the first frame.     
     
     
       36. A virtual machine as recited in  claim 35 , wherein said virtual machine is further capable of:
   storing said data block on the execution stack before a third frame for the third function.     
     
     
       37. A virtual machine as recited in  claim 35 , wherein said first programming language is the Java programming language. 
     
     
       38. A virtual machine as recited in  claim 35 , wherein the second programming language is one selected from the group consisting of the C++programming language, the Pascal programming language, the FORTRAN programming language, and an assembly language.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.