10545744

Prediction Mechanism for Subroutine Returns in Binary Translation Sub-Systems of Computers

PublishedJanuary 28, 2020
Assigneenot available in USPTO data we have
InventorsOle AGESEN
Technical Abstract

Patent Claims
18 claims

Legal claims defining the scope of protection, as filed with the USPTO.

1

1. A computer system comprising a host, the computer system comprising: a memory comprising a return target cache implemented as an array having a size that is dynamically adjustable; and one or more processors coupled to the memory, the one or more processors being configured to: execute instructions in an output language (OL); run a guest, the guest configured to issue a sequence of instructions in an input language (IL); dynamically adjust the size of the return target cache; and run a binary translator configured to convert the sequence of IL instructions of the guest into a corresponding sequence of OL instructions of the host, wherein the binary translator converts a first sequence of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address P and an IL return address R, into a first sequence of OL instructions of the host by: (i) translating the call statement into a call block of instructions, the call block pushing the IL return address R onto a stack and storing a known OL return address corresponding to the IL return address R in the return target cache at a location corresponding to a value derived from the IL procedure entry address P, and (ii) inserting a confirm block of instructions at an address following the call block, the confirm block determining a hit if an address popped from the stack matches the IL return address R, wherein the one or more processors, responsive to the confirm block determining the hit during execution of the first sequence of OL instructions, retrieve the known OL return address from the return target cache at the location corresponding to the value derived from the IL procedure entry address P and continue execution of the first sequence of OL instructions at the retrieved known OL return address.

2

2. The computer system of claim 1 , wherein the binary translator is configured to convert each of one or more other N sequences of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address Pn and an IL return address Rn (where n=1, 2, . . . , N), into a corresponding sequence of OL instructions of the host.

3

3. The computer system of claim 2 , wherein the confirm block determines a miss if the address popped from the stack does not match the IL return address R or any of the other IL return addresses Rn (where n=1, 2, . . . , N), and responsive to the confirm block determining the miss, executes a miss/failure handler to recover a correct OL return address.

4

4. The computer system of claim 3 , wherein the one or more processors are configured to track a number of times the miss/failure handler executes during execution of OL instructions converted from IL instructions of the guest, and adjust the size of the return target cache based on said number of times.

5

5. The computer system of claim 4 , wherein the one or more processors are configured to adjust the size of the return target cache based on the number of times the miss/failure handler executes during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period of time.

6

6. The computer system of claim 4 , wherein the one or more processors are configured to adjust the size of the return target cache based on the number of times the miss/failure handler executes during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period of time, divided by a total number of subroutine calls made during the execution of the OL instructions converted from IL instructions of the quest.

7

7. A method for implementing subroutine calls and returns in a computer system having a host configured to execute instructions in an output language (OL), a guest communicatively coupled to the host and configured to issue a sequence of instructions in an input language (IL), a return target cache implemented as an array having a size that is dynamically adjusted, and a binary translator configured to convert the sequence of IL instructions of the guest into a corresponding sequence of OL instructions of the host, said method comprising: converting a first sequence of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address P and an IL return address R, into a first sequence of OL instructions of the host by: (i) translating the call statement into a call block of instructions, the call block pushing the IL return address R onto a stack and storing a known OL return address corresponding to the IL return address R in the return target cache at a location corresponding to a value derived from the IL procedure entry address P, and (ii) inserting a confirm block of instructions at an address following the call block, the confirm block determining a hit if an address popped from the stack matches the IL return address R; and responsive to the confirm block determining the hit during execution of the first sequence of OL instructions, retrieving the known OL return address from the return target cache at the location corresponding to the value derived from the IL procedure entry address P and continuing execution of the first sequence of OL instructions at the retrieved known OL return address.

8

8. The method of claim 7 , further comprising: converting each of one or more other N sequences of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address Pn and an IL return address Rn (where n=1, 2, . . . , N), into a corresponding sequence of OL instructions of the host.

9

9. The method of claim 8 , wherein the confirm block determines a miss if the address popped from the stack does not match the IL return address R or any of the other IL return addresses Rn (where n=1, 2, . . . , N), and responsive to the confirm block determining the miss, executes a miss/failure handler to recover a correct OL return address.

10

10. The method of claim 9 , further comprising: tracking a number of times the host executes the miss/failure handler during execution of OL instructions converted from IL instructions of the guest; and adjusting the size of the return target cache based on said number of times.

11

11. The method of claim 10 , wherein the size of the return target cache is adjusted based on the number of times the host executes the miss/failure handler during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period of time.

12

12. The method of claim 10 , wherein the size of the return target cache is adjusted based on the number of times the host executes the miss/failure handler during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period at time, divided by a total number of subroutine calls made during the execution of the OL instructions converted from IL instructions of the quest.

13

13. A non-transitory computer readable medium embodying program instructions for implementing subroutine calls and returns in a computer system having a host configured to execute instructions in an output language (OL), a guest communicatively coupled to the host and configured to issue a sequence of instructions in an input language (IL), a return target cache implemented as an array having a size that is dynamically adjusted, and a binary translator configured to convert the sequence of IL instructions of the guest into a corresponding sequence of OL instructions of the host, the program instructions causing the computer system to perform a method comprising the steps of: converting a first sequence of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address P and an IL return address R, into a first sequence of OL instructions of the host by: (i) translating the call statement into a call block of instructions, the call block pushing the IL return address R onto a stack and storing a known OL return address corresponding to the IL return address R in the return target cache at a location corresponding to a value derived from the IL procedure entry address P, and (ii) inserting a confirm block of instructions at an address following the call block, the confirm block determining a hit if an address popped from the stack matches the IL return address R; and responsive to the confirm block determining the hit during execution of the first sequence of OL instructions, retrieving the known OL return address from the return target cache at the location corresponding to the value derived from the IL procedure entry address P and continuing execution of the first sequence of OL instructions at the retrieved known OL return address.

14

14. The non-transitory computer readable medium of claim 13 , wherein the method further comprises the step of: converting each of one or more other N sequences of IL instructions of the guest including a call statement that directs execution to a subroutine having an IL procedure entry address Pn and an IL return address Rn (where n=1, 2, . . . , N), into a corresponding sequence of OL instructions of the host.

15

15. The non-transitory computer readable medium of claim 14 , wherein the confirm block determines a miss if the address popped from the stack does not match the IL return address R or any of the other IL return addresses Rn (where n=1, 2, . . . , N), and responsive to the confirm block determining the miss, executes a miss/failure handler to recover a correct OL return address.

16

16. The non-transitory computer readable medium of claim 15 , wherein the method further comprises the steps of: tracking a number of times the host executes the miss/failure handler during execution of OL instructions converted from IL instructions of the guest; and adjusting the size of the return target cache based on said number of times.

17

17. The non-transitory computer readable medium of claim 16 , wherein the size of the return target cache is adjusted based on the number of times the host executes the miss/failure handler during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period of time.

18

18. The non-transitory computer readable medium of claim 16 , wherein the size of the return target cache is adjusted based on the number of times the host executes the miss/failure handler during the execution of the OL instructions converted from IL instructions of the quest over a predetermined period of time, divided by a total number of subroutine calls made during the execution of the OL instructions converted from IL instructions of the quest.

Patent Metadata

Filing Date

Unknown

Publication Date

January 28, 2020

Inventors

Ole AGESEN

Want to explore more patents?

Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.

Citation & reuse

Analysis on this page is generated by Patentable — an AI-powered patent intelligence platform. AI-generated summaries, explanations, and analysis may be reused with attribution and a visible link back to the canonical URL below. Patent abstracts and claims are USPTO public domain.

Cite as: Patentable. “PREDICTION MECHANISM FOR SUBROUTINE RETURNS IN BINARY TRANSLATION SUB-SYSTEMS OF COMPUTERS” (10545744). https://patentable.app/patents/10545744

© 2026 Patentable. All rights reserved.

Patentable is a research and drafting-assistant tool, not a law firm, and does not provide legal advice. Documents we generate are drafts for review by a licensed patent attorney.