Method for fast translation of java byte codes into efficient native processor code

Uložené v:
Podrobná bibliografia
Názov: Method for fast translation of java byte codes into efficient native processor code
Patent Number: 6,292,935
Dátum vydania: September 18, 2001
Appl. No: 09/087,353
Application Filed: May 29, 1998
Abstrakt: To efficient generate native processor code from operand stack based code, a mimic stack is introduced. The mimic stack is a compile time data structure that stores the location of operands pushed onto the operand stack. When an operation is detected that operates on operand stack values, the locations from the mimic stack are popped off and used to generate efficient code that directly accesses the operands.
Inventors: Lueh, Guei-Yuan (Santa Clara, CA); Tabatabai, Ali-Reza Adl (Santa Clara, CA)
Assignees: Intel Corporation (Santa Clara, CA)
Claim: We claim
Claim: 1. A method of translating operand stack based code into native processor code, said method comprising
Claim: pushing at least one value onto a compile time mimic stack which emulates an operand stack, the compile time mimic stack being independent of a stack mechanism of the native processor and independent of general purpose registers of the native processor; and
Claim: generating native processor code upon encountering an operand stack instruction that operates on said value pushed onto the compile time mimic stack.
Claim: 2. The method as claimed in claim 1 wherein said generating native processor code comprises generating a native processor instruction that performs the operation of said instruction that operates on said value pushed onto the compile time mimic stack.
Claim: 3. The method as claimed in claim 2 wherein the result of said native processor instruction is pushed onto said compile time mimic stack.
Claim: 4. The method as claimed in claim 1 wherein pushing said at least one value onto a compile time mimic stack comprises pushing the location of a variable onto said compile time mimic stack when said variable is pushed onto said operand stack in operand stack based code.
Claim: 5. The method as claimed in claim 1 wherein said at least one value comprises a register.
Claim: 6. The method as claimed in claim 1 wherein said at least one value comprises a floating point stack value.
Claim: 7. The method as claimed in claim 1 wherein said at least one value comprises an immediate value.
Claim: 8. The method as claimed in claim 1 wherein said at least one value comprises a memory location.
Claim: 9. The method as claimed in claim 8 wherein said memory location comprises a location in a stack frame.
Claim: 10. The method as claimed in claim 1 wherein said at least one value comprises a constant.
Claim: 11. The method as claimed in claim 1 wherein generating native processor code comprises moving said at least one value into a register.
Claim: 12. A computer system comprising
Claim: a storage device having stored therein a routine for translating operand stack based code into native processor code;
Claim: a processor coupled to the storage device for executing the routine for translating operand stack based code into native processor code, where
Claim: at least one value is pushed onto a compile time mimic stack which emulates an operand stack, the compile time mimic stack being independent of a stack mechanism of the native processor and independent of general purpose registers of the native processor; and
Claim: native processor code is generated upon encountering an operand stack instruction that operates on the value pushed onto the compile time mimic stack.
Claim: 13. The system of claim 1, where generating the native processor code comprises generating a native processor instruction that performs the operation of the instruction on the value pushed onto the compile time mimic stack.
Claim: 14. The system of claim 12, wherein the result of the native processor instruction is pushed onto the compile time mimic stack.
Claim: 15. The system of claim 12, wherein pushing the at least one value onto a compile time mimic stack comprises pushing the location of a variable onto the compile time mimic stack when the variable is pushed onto the operand stack in operand stack based code.
Claim: 16. The system of claim 12, wherein the at least one value comprises a register.
Claim: 17. The system of claim 12, wherein the at least one value comprises a floating point stack value.
Claim: 18. The system of claim 12, wherein the at least one value comprises an immediate value.
Claim: 19. The system of claim 12, wherein the at least one value comprises a memory location.
Claim: 20. The system of claim 19, wherein the memory location comprises a location in a stack frame.
Claim: 21. The system of claim 12, wherein the at least one value comprises a constant.
Claim: 22. The system of claim 12, wherein generating native processor code comprises moving the at least one value into a register.
Claim: 23. A method of translating operand stack based code into native processor code, said method comprising
Claim: detecting an instruction that pushes a first value onto an operand stack in said operand stack based code and responding by delaying generation of native processor code until an operand stack base code instruction is encountered that operates on the operand stack and pushing a location of said first value onto a compile time mimic stack which emulates the operand stacks the compile time mimic stack being independent of a stack mechanism of the native processor and independent of general purpose registers of the native processor; and
Claim: detecting an instruction that operates on said first value pushed onto the operand stack and responding by generating code that operates on said first value using said location pushed onto said compile time mimic stack.
Claim: 24. The method as claimed in claim 23 wherein generating said native processor code comprises generating a native processor instruction that performs the operation of said instruction that operates on said first value pushed onto the compile time mimic stack.
Claim: 25. The method as claimed in claim 24 wherein the result of said native processor instruction is pushed onto said compile time mimic stack.
Claim: 26. The method as claimed in claim 23 wherein one of said operand stack values comprises a register.
Claim: 27. The method as claimed in claim 23 wherein one of operand stack values comprises a floating point stack value.
Claim: 28. The method as claimed in claim 23 wherein one of operand stack values comprises an immediate value.
Claim: 29. The method as claimed in claim 23 wherein one of operand stack values comprises a memory location.
Claim: 30. The method as claimed in claim 23 wherein a memory location of said first value comprises a constant.
Claim: 31. The method as claimed in claim 23 wherein a memory location of said first value comprises a location in a stack frame.
Claim: 32. The method as claimed in claim 23 wherein generating code that operates on said first value using said location pushed onto said compile time mimic stack comprises folding the access to the first location into an arithmetic instruction.
Claim: 33. A computer system comprising
Claim: an instruction that pushes a first value onto an operand stack in said operand stack based code is detected and, in response to detecting the instruction, generation of native processor code is delayed until an operand stack base code instruction is encountered that operates on the operand stack and a location of said first value is pushed onto a compile time mimic stack which emulates the operand stack, the compile time mimic stack being independent of a stack mechanism of the native processor and independent of general purpose registers of the native processor; and
Claim: an instruction that operates on said first value pushed onto the operand stack is detected and in response to detecting the instruction code is generated that operates on said first value using said location pushed onto said compile time mimic stack.
Claim: 34. The system of claim 33, wherein generating said native processor code comprises generating a native processor instruction that performs the operation of said instruction that operates on said first value pushed onto the compile time mimic stack.
Claim: 35. The system as claimed in claim 34 wherein the result of said native processor instruction is pushed onto said compile time mimic stack.
Claim: 36. The system as claimed in claim 33 wherein one of said operand stack values comprises a register.
Claim: 37. The system as claimed in claim 33 wherein one of operand stack values comprises a floating point stack value.
Claim: 38. The system as claimed in claim 33 wherein one of operand stack values comprises an immediate value.
Claim: 39. The system as claimed in claim 33 wherein one of operand stack values comprises a memory location.
Claim: 40. The system as claimed in claim 33 wherein a memory location of said first value comprises a constant.
Claim: 41. The system as claimed in claim 33 wherein a memory location of said first value comprises a location in a stack frame.
Claim: 42. The system as claimed in claim 33 wherein generating code that operates on said first value using said location pushed onto said compile time mimic stack comprises folding the access to the first location into an arithmetic instruction.
Claim: 43. A machine-readable medium having stored thereon data representing sequences of instructions, the sequences of instructions which, when executed by a processor translate operand stack based code into native processor code by
Claim: 44. The machine-readable medium as claimed in claim 43 wherein said generating native processor code comprises generating a native processor instruction that performs the operation of said instruction that operates on said value pushed onto the compile time mimic stack.
Claim: 45. The machine-readable medium as claimed in claim 44 wherein the result of said native processor instruction is pushed onto said compile time mimic stack.
Claim: 46. The machine-readable medium as claimed in claim 43 wherein pushing said at least one value onto a compile time mimic stack comprises pushing the location of a variable onto said compile time mimic stack when said variable is pushed onto said operand stack in operand stack based code.
Claim: 47. The machine-readable medium as claimed in claim 43 wherein said at least one value comprises a register.
Claim: 48. The machine-readable medium as claimed in claim 43 wherein said at least one value comprises a floating point stack value.
Claim: 49. The machine-readable medium as claimed in claim 43 wherein said at least one value comprises an immediate value.
Claim: 50. The machine-readable medium as claimed in claim 43 wherein said at least one value comprises a memory location.
Claim: 51. The machine-readable medium as claimed in claim 50 wherein said memory location comprises a location in a stack frame.
Claim: 52. The machine-readable medium as claimed in claim 43 wherein said at least one value comprises a constant.
Claim: 53. The machine-readable medium as claimed in claim 43 wherein generating native processor code comprises moving said at least one value into a register.
Claim: 54. A machine-readable medium having stored thereon data representing sequences of instructions, the sequences of instructions which, when executed by a processor translate operand stack based code into native processor code by
Claim: detecting an instruction that pushes a first value onto an operand stack in said operand stack based code and responding by delaying generation of native processor code until an operand stack base code instruction is encountered that operates on the operand stack and pushing a location of said first value onto a compile time mimic stack which emulates the operand stack the compile time mimic stack being independent of a stack mechanism of the native processor and independent of general purpose registers of the native processor; and
Claim: 55. The machine-readable medium as claimed in claim 54 wherein generating said native processor code comprises generating a native processor instruction that performs the operation of said instruction that operates on said first value pushed onto the compile time mimic stack.
Claim: 56. The machine-readable medium as claimed in claim 55 wherein the result of said native processor instruction is pushed onto said compile time mimic stack.
Claim: 57. The machine-readable medium as claimed in claim 54 wherein one of said operand stack values comprises a register.
Claim: 58. The machine-readable medium as claimed in claim 54 wherein one of operand stack values comprises a floating point stack value.
Claim: 59. The machine-readable medium as claimed in claim 54 wherein one of operand stack values comprises an immediate value.
Claim: 60. The machine-readable medium as claimed in claim 54 wherein one of operand stack values comprises a memory location.
Claim: 61. The machine-readable medium as claimed in claim 54 wherein a memory location of said first value comprises a constant.
Claim: 62. The machine-readable medium as claimed in claim 54 wherein a memory location of said first value comprises a location in a stack frame.
Claim: 63. The machine-readable medium as claimed in claim 54 wherein generating code that operates on said first value using said location pushed onto said compile time mimic stack comprises folding the access to the first location into an arithmetic instruction.
Current U.S. Class: 717/5; 717/9; 717/7
Current International Class: G06F 945
Patent References Cited: 5598560 January 1997 Benson
5754830 May 1998 Butts et al.
5794049 August 1998 Lindholm
5802373 September 1998 Yates et al.
5805895 February 1999 Breternitz, Jr. et al.
5875336 February 1999 Dickol et al.
5898885 April 1999 Dickol et al.
6075942 June 2000 Cartwright, Jr.
6081665 June 2000 Nilsen et al.
Other References: Goodman-Miller, Programmer's View of Computer Architecture, Oxford University Press, 1993.*
James Gosling, et al., The Java Language Specification, Published by Addison-Wesley, 1996, pp. 29-49.
Tim Lindholm, et al., The Java Virtual Machine Specification, Published by Addison-Wesley, 1997, pp. 57-82.
Alfred V. Aho, et al., Compilers-Principles, Techniques, and Tools, Published by Addsion-Wesley, 1988, pp. 1-24.
Steven S. Muchnick, Advanced Compiler Design & Implementation, Published by Morgan Kaufmann, 1997, pp. 1-18, 319-328.
Douglas Kramer, The Java Platform-A White Paper, Published by Javasoft, 1996, pp. 6-24.
Primary Examiner: Powell, Mark R.
Assistant Examiner: Nguyen-Ba, Hoang-Vu Antony
Attorney, Agent or Firm: Blakely, Sokoloff, Taylor & Zafman LLP
Prístupové číslo: edspgr.06292935
Databáza: USPTO Patent Grants
Popis
Abstrakt:To efficient generate native processor code from operand stack based code, a mimic stack is introduced. The mimic stack is a compile time data structure that stores the location of operands pushed onto the operand stack. When an operation is detected that operates on operand stack values, the locations from the mimic stack are popped off and used to generate efficient code that directly accesses the operands.