5 stars based on
The translation process takes place during execution of the source binary code. In order g binary translator improve execution speed of the source binary code, g binary translator dynamic binary translator may need to reduce overhead during the translation process. Overhead may include, for example, repetitive g binary translator of a g binary translator fragment or same set of instructions of the source binary code, redundancy in saving a same set of instructions or same g binary translator of the source binary code being translated, etc.
For example, if the source binary code is unchanged during execution, the relating translated target binary code may be reused. Translation reuse may require verifying consistency of the source instruction to be currently translated compared g binary translator previously translated source instruction relating to the target binary code to be reused.
To ensure consistency, a no-fault verification method may require saving all the fragments of the source binary code that affect the translation, and comparing all the saved fragments with a fragment to be executed.
In addition, because a dynamic binary translator may not be able to discover the exact boundaries of functions g binary translator the source binary code, a conventional dynamic binary translator may need to rely on an inaccurate verification procedure to verify consistency of the source binary code, leaving certain functional issues unresolved.
The invention will be understood and appreciated more fully from the following detailed description of embodiments of the invention, taken in conjunction with the accompanying cara deposit liteforex malaysia of which:.
It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity.
In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of embodiments of the invention. However it will be understood by those of ordinary skill in the art that embodiments of the invention may be practiced without these specific details.
In other instances, well-known methods and procedures have not been described g binary translator detail so as not to g binary translator the embodiments of the invention. Some portions of the detailed description in the following are presented in terms of algorithms and g binary translator representations of operations on data bits or binary digital signals within a computer memory.
These algorithmic descriptions and representations may be the techniques used by those skilled in the data processing arts to convey the substance of their work to others skilled in the art. An algorithm is here, and generally, considered to be a self-consistent sequence of acts or operations leading to a desired result.
These include physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic g binary translator capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers or the like.
It should be understood, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Embodiments of the invention may include apparatuses for performing the operations herein. These apparatuses may be specially constructed for the desired purposes, or they may include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer.
Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, magnetic-optical disks, read-only memories ROMrandom access memories RAMelectrically programmable read-only memories EPROMelectrically erasable and programmable read only memories EEPROMmagnetic or optical cards, or any other type of media suitable for storing electronic instructions, and capable of being coupled to g binary translator computer system bus.
The processes and displays presented herein are not inherently related to any particular computer or other apparatus. G binary translator general-purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct a more specialized apparatus to perform the desired method. The desired structure for a variety of these systems will appear from the description below. In addition, embodiments of the invention are not described with reference to any particular programming language.
It will be appreciated that a variety g binary translator programming languages may be used to implement the teachings of the invention as described herein. In the following g binary translator, various figures, diagrams, flowcharts, models, and descriptions are presented as different means to effectively convey the g binary translator and illustrate different embodiments of the invention that are proposed in this application.
It shall be understood by those skilled g binary translator the art that they are provided merely as exemplary samples, and shall not be constructed as limitation to the invention. A non-exhaustive list of examples for apparatus 2 may include a desktop personal computer, a workstation, a server computer, a laptop computer, a notebook computer, a hand-held computer, a personal digital assistant PDAa mobile telephone, a game g binary translator, and the like. Moreover, processor 4 may be part of an application specific integrated circuit ASICor may be part of an application specific standard product ASSP.
Memory 6 may be fixed within or removable from apparatus 2. If the source architecture g binary translator not g binary translator with the target architecture, as is the case, for example, with the IA and Itanium architectures, processor 4 may not be able to execute source binary code According to some exemplary embodiments of the invention, processor 4 may invoke dynamic binary translator 30 to translate source binary code 10 into target binary g binary translator While fragments of source binary code 10 are being translated into code blocks of target binary code 20processor 4 may execute the translated code blocks of target binary code The results of executing the g binary translator code blocks of target binaries 20 may generally correspond to the results of g binary translator source binary code 10 on a processor that complies with the source architecture.
Dynamic binary translator 30 may g binary translator source binaries 10 in fragments into code blocks of target binaries 20 for execution by a g binary translator processor complying with a target architecture.
A source fragment, or code fragment, may be a source binary instruction, a basic instruction code, a code page, or other code size. As shown in FIG. As translator 30 translates the source binaries to be executed by processor 4execution engine 31 may direct the flow of execution of processor 4 through the translated code blocks.
When the execution flow to be carried out by processor 4 reaches a source fragment, e. Upon receiving the translation request, translation engine 32 may attempt to query for a previously translated code block that may potentially be reused to perform the instructions included in the source fragment.
A potentially reusable code block may be a code block that has been previously translated from the same source fragment but may not be currently accessible by the execution engine To search for such a potentially reusable code block, translation engine 32 may send a reuse request to reuse engine If a potentially g binary translator translated code block is identified, reuse engine 33 may proceed to verify the consistency of the source fragment that corresponds to the identified code block, thereby to determine a reusability status of the identified code block.
A source fragment is considered consistent if each and every instruction in the source fragment is exactly g binary translator same as it was before, for example, g binary translator the source fragment was originally translated. The reusable translated code block may then be passed to execution engine 31 for execution. If the previously translated code block is determined to g binary translator unusable, e.
This may be achieved by global optimization performed by the dynamic binary translator. When g binary translator optimization is performed on translated code block 21certain functions used in translated code block 21 may be realized sharing a translated code block of a different source fragment.
For example, as is shown in FIG. It will be appreciated that if all source fragments in the RSB of a previously translated code block are consistent, that is, each and every instruction of the G binary translator source fragments is the same as it was before, e. The translated code block may then be identified as safely reusable. G binary translator, according to exemplary embodiments of the present invention, verification of reusability status of a translated code block may be limited to verifying the consistency of only those source fragments that are related to the translated code block.
Such source fragment verification, that is, verification of only the RSB elements of the translated code block, ensures correctness of the reused target code blocks and may be faster than conventional methods that verify the entire source binary code. Furthermore, g binary translator will be appreciated that verifying only the RSB elements of the translated code block, according to embodiments of the invention, does not compromise the g binary translator of the translated target binaries.
The RVR parameter may be defined as a ratio between the number of source fragments that are verified more than once, and the number of all verified source fragments. The NVR may be defined as a ratio between the number of source fragments that are verified but whose verification results are not actually used, and the total number of verified source fragments. Verifying only the RSB elements of a translated code block, according to exemplary embodiments of the invention, may reduce the NVR of the translator and, thus, improve translation efficiency.
However, it is appreciated that even if the NVR is minimal, the same source fragment may be verified more than once for different translated code blocks, because a given source fragment, e. This potential redundancy is overcome by some exemplary embodiments of the invention, e. According to exemplary embodiments of the invention, the efficiency of a dynamic binary translator, as measured by for example, RVR, may be improved by grouping translated code blocks into one or more code block groups, e.
A code block group, e. Source fragments corresponding to a group of translated code blocks may be the union of the RSB elements of all the group members, and may be saved as part of a RSB groups 40 in memory 6separately g binary translator the original source fragment 10 FIG. According to embodiments of the invention, during dynamic binary translation, consistency of source fragments may be verified g binary translator a group, rather than for individually translated code blocks.
Similarly, translated code blocks 22 and 23 may share a common source fragment 43which may also be saved as a RSB element of group source According to exemplary embodiments of the invention, translated code blocks 2122and 23whose RSB elements may intersect with each other, may be included in code block group 26 and may share source fragments of group Similarly, translated code blocks 24 and 25 may be included in another code block group e.
In this example, the reusability status of group 27 may be marked as non-reusable, as g binary translator in more detail below. In some embodiments, translated code block 25 may belong to a group 29 of invalidated binaries, and may be revived during the process of dynamic binary translation, as discussed in detail below with reference to FIG.
In a RSB group such as, for example, source g binary translator 46overlapping RSB elements, for example, source fragments 42 and 43 g binary translator, may be saved only once but may be referenced by multiple translated code blocks. In this manner, there may be less, or no duplicated RSB elements in any single group. The reusability status of a group to which a translated code block belongs may be used to determine the reusability status of the translated code block.
If the group g binary translator marked as reusable, the code block may then g binary translator determined to be reusable. If the reusability status of the group is marked as unknown, reuse g binary translator 33 may need to re-verify consistency of the g binary translator RSB elements.
If all of the RSB elements are verified to be consistent, the group may be re-marked as reusable, and the code block may be reused. The process of grouping source fragments and verifying reusability of the group, according to embodiments of the invention, may result in a low, or even zero, RVR, a reduction in verification time, and conservation of storage space needed to contain the source fragments.
During execution of g binary translator binaries, execution engine 31 FIG. The execution flow may reach a current source fragment, which may include a set of source instructions of any size, for which execution engine 31 may be unable to identify a corresponding previously translated code block.
In such case, as indicated at boxexecution engine 31 may send a translation request to translation engine 32 FIG. Upon receiving the translation request at boxtranslation engine 32 may send a reuse request to reuse engine 33 FIG.
According to some embodiments of the invention, certain previously translated code blocks may be effectively inaccessible to execution engine As indicated at boxreuse engine 33 may attempt to find or locate the previously translated g binary translator block, as described above, as well as a group to which g binary translator translated code block may belong.
At boxif none of the translated code blocks is determined to meet the requirement of the reuse request, reuse engine 33 may send translation engine 32 an indication that a reusable translated code block for the source fragment g binary translator be found or located.
After receiving the indication at box that no reusable translated code block can be found or located, at box translation engine 32 may proceed to translate the source fragment. A newly translated code block may subsequently be generated and sent for execution by execution engine More details concerning the translation process performed by translation engine 32 are described below with reference to FIG. If a corresponding translated code block, e.
At boxreuse engine 33 may read the reusability status marking of a group, e. If group 26 is marked as reusable, indicating that all the translated code blocks in the group, i. Reuse engine 33 may then terminate the reusability verification process and, as indicated at boxmay send the identified code block, i.
Translation engine 32 may in turn pass the identified code block g binary translator to execution engine 31 for execution. If all the RSB elements related to the group, e.
At this point, any translated code blocks, e. The identified code block, e. Translation engine 32 may subsequently pass code block 24 to execution engine 31 for execution.
If at box one or more of the RSB elements related to the g binary translator, e. In such a case, the group, e.