CN100359470C - Treating method and device for static information incompleteness in moving and static combined binary translation - Google Patents

Treating method and device for static information incompleteness in moving and static combined binary translation Download PDF

Info

Publication number
CN100359470C
CN100359470C CNB2004100092870A CN200410009287A CN100359470C CN 100359470 C CN100359470 C CN 100359470C CN B2004100092870 A CNB2004100092870 A CN B2004100092870A CN 200410009287 A CN200410009287 A CN 200410009287A CN 100359470 C CN100359470 C CN 100359470C
Authority
CN
China
Prior art keywords
translation
static
code
inlet
follow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2004100092870A
Other languages
Chinese (zh)
Other versions
CN1716202A (en
Inventor
武成岗
张兆庆
冯晓兵
崔慧敏
谢海斌
唐锋
杨浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Computing Technology of CAS
Original Assignee
Institute of Computing Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CNB2004100092870A priority Critical patent/CN100359470C/en
Publication of CN1716202A publication Critical patent/CN1716202A/en
Application granted granted Critical
Publication of CN100359470C publication Critical patent/CN100359470C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a device for incompletely processing static information in dynamic and static combination binary translation and a device. A necessary inlet is preserved, and a dynamic translation executor is used for immediately translating. The performance of the system is performed according to the method of the dynamic translation executor linked with the preserved inlet. The present invention increases the set inlet and adopts the immediate translation to solve the problem that the local codes are generated as the dynamic execution can not return back to the static execution after a long time; the efficiency is low as the dynamic state simply adopts the explanation execution. The code quality and the whole performance of the system are enhanced.

Description

Be association of activity and inertia incomplete disposal route of static information and device in the binary translation
Technical field
The present invention relates to the binary translation technology of computer realm, relate in particular to incomplete disposal route of static information and device in a kind of binary translation of being association of activity and inertia.
Background technology
Compiling is the gordian technique in computing machine self field, and binary translation then is an important research direction of compiling.Just developed first commercial binary translation system Bergh et al as far back as Hewlett-Packard Corporation in 1987.Next, many companies and research institution have also launched the research of this respect in succession, and wherein the most representative have HP, IBM, Digital, an AT﹠amp; T, APPLE, Transmeta, Australian Queensland university, technology university, Austria Vienna etc., at present, the software center that Intel is built up in China has also added these ranks.
Binary translation is becoming a research focus that solves the software transplanting problem at present.As everyone knows,, then can lose the support of existing software, influence its promotion and application if its ISA of processor newly developed is not compatible forward.This just forces the deviser to use valuable chip space to come compatible old processor, has so both increased the complexity and the power consumption of new processor, influences the raising of its dominant frequency, has hindered the development of processor again.The binary translation technology is that new and old processor has been erected a bridge block, and existing software transplanting is carried out to processor newly developed, makes new processor break away from compatible forward constraint.
The binary translation technology to the development that promotes homemade processor also highly significant.Closely during the last ten years, the information industry of China is able to develop rapidly, and progressively moves to maturity.Along with the accumulation of knowledge and experience, industry elite begin the technological challenge of core the most in computer realm.With " Godson ", " starlight ", " Noah's ark ", " Chinese core ", " martial prowess ", " ten thousand is logical ", " the many will of Beijing University " etc. is that the homemade general or embedded microprocessor of representative continues to bring out, and has broken the situation of Chinese nothing " core ".But because the restriction of Intel various patents on the X86 series microprocessor makes domestic many microprocessor Design persons have to adopt and the incompatible ISA of X86 series microprocessor.As everyone knows, X86 series machine has had extremely abundant application software group as mainstream model.The incompatible application software of homemade microprocessor that causes of ISA is compared some scarcity that seems with x86 microprocessor, influenced the paces of its promotion and application to a certain extent.Therefore carry out the research of binary translation, can enrich the application software of homemade processor equally, provide support for these national industries enlarge market.
The strategy that binary translation adopts has dynamically and the branch of static state.So-called binary translation is meant that the translation of code is carried out in the process that program is carried out, the translation while carrying out.Static binary translation then is before program is carried out, and by translater the source binary program is directly analyzed, and is translated the new executable program of formation.Owing to have problems such as " indirect branch ", " indirect call ", " code is from revising " in the program, have only the dynamic translation of employing that these problems are solved, and the adaptivity of dynamic optimization also can be brought the not available benefit of static translation.
Find in the research that though binary translation can remedy the deficiency in the static translation, its shortcoming is also fairly obvious.Dynamically translation and optimization all take working time, cause adopting comparatively profound optimisation strategy.These strategies are when improving performance, and itself also can take overhead its behavior, thereby causes the decline of system performance.
When carrying out static translation, because the target of redirect and indirect call is uncertain indirectly, cause this step can't obtain complete control stream information, produced two critical problems therefrom: (1) can't accurately determine the border of fundamental block, and (2) can not stride fundamental block and carry out code optimization.These two problems can force static translation to have to take conservative strategy, thereby have influenced the code quality that is produced, and have reduced the overall performance of system.
The Digital company of the U.S. FX! 32 systems have adopted the binary translation means of being association of activity and inertia, and reserve the entrance, and it gives over to inlet with the next block of function entrance and CALL instruction. 32 in the process of implementation, when jumping to unknown address from the code of static translation gained, then changes the dynamic execute phase over to, and this stage is finished by interpreter fully.Though this system has also solved above-mentioned two problems, but it ignored some other important inlets (such as: in the dynamic part implementation, the part of having translated that runs into, should enter as early as possible in the code of having translated this moment carries out, and reserves corresponding inlet when needing static translation for this reason).Because it is insufficient that necessary inlet is reserved, thereby after causing control to enter interpreter, can't return the local code that static translation generates for a long time.The execution efficiency ratio of well-known interpreter is lower, carries out the source binary code by interpreter for a long time, will have a strong impact on the overall performance (drawback of the current binary translation of being association of activity and inertia) of system.
In addition, FX! 32 dynamically carry out the interpreter that places one's entire reliance upon.When the part that is performed is one section during the code of heat, interpreter will become the bottleneck that system performance can not be given full play to.
Summary of the invention
Technical matters to be solved by this invention provides the incomplete disposal route of static information in a kind of binary translation of being association of activity and inertia, overcome the problem that to return the static local code that is generated in the dynamic execution of prior art for a long time, and dynamically be that simple the employing explained the inefficient problem of carrying out, improve code quality and entire system performance.
Before introducing the present invention, we introduce a notion of using earlier in this document: translation unit.In translation process, because the just binary code that translation program is seen, and may there be indirect branch's jump instruction in these codes, compiler is in order to optimize in addition, also often the function afterbody is linked, these all can cause translation program can't divide the border of a function exactly.For this reason, native system is that unit carries out with the translation unit when handling binary program.Here the code segment that claims to satisfy following condition is a translation unit:
A) the initial inlet of translation unit: translation unit with the destination address of function call instruction as initial inlet;
B) from inlet, successively according to the control flow analysis corresponding instruction, when the instruction of the indirect jump target of the target that can't determine when running into static state, function link order, these instructions are as the outlet of translation unit.
In order to solve the problems of the technologies described above, the invention provides the incomplete disposal route of static information in a kind of binary translation of being association of activity and inertia, may further comprise the steps:
A) can turn over from static state and choose some special fundamental blocks the code, it is inlet that these fundamental blocks are given over to, the conservative processing;
B) except the fundamental block that gives over to inlet, other place need not to guard processing, adopts and strides the various of fundamental block
The global optimization strategy carries out depth optimization to interpreter code;
C) dynamically translate execution module and start after, with the code and the corresponding inlet graftabl of static translation, and preferentially move static local code.
D) in dynamic implementation, if when running into the code of untranslated mistake still, according to the address that is about to carry out these codes being carried out instant translation by dynamic translators carries out, to link between the local code that dynamically generates, and the local code that will dynamically generate links with the static local code that generates, instant translation is carried out when running into the inlet that static translation reserves, and the code that changes static translation more again over to is carried out.
In such scheme, the selection of the inlet in the step a) is according to following principle: fundamental block that next bar instruction place fundamental block of first fundamental block of the translation unit that is translated, function call instruction, inlet quantity surpass some self-defined thresholdings or dynamic outline information search are arrived, the destination address of this translation unit that the branch's jump instruction in other translation unit enters.
In such scheme, in the step a), processing is guarded in these places that given over to inlet, do not allow the global optimization strategy to upset the state of these porch, make the code after the translation keep the attribute identical with the source binary code, before and after the translation, the state of register and other machine remains unchanged.
The present invention also provides a kind of static translation method, may further comprise the steps:
If a) have the last profile information that is obtained when carrying out of dynamically translating, read in these information, with the tutorial message of these information as subsequent step, if there is no, then the profile information that will be used to instruct is made as sky;
B) dis-assembling source binary code; When running into indirect redirect and indirect call, search the indirect target information table, if corresponding target has been arranged, then proceed; Otherwise, finish;
C) inlet porting information, with these entry records the inlet information table in; Those may be given over to inlet as the fundamental block of the target of other code, these inlets comprise: fundamental block that next bar instruction place fundamental block of first fundamental block of the translation unit that is translated, function call instruction, inlet quantity surpass some self-defined thresholdings or dynamic outline information search are arrived, the destination address of this translation unit that the branch's jump instruction in other translation unit enters;
D) carry out static translation, except giving over to the place of inlet, other all adopts the depth optimization strategy to be optimized;
E) preserve the code after translating and the information table that enters the mouth, for dynamically translation actuator use.
In such scheme, in the step a), the temperature information, indirect target information, target that profile information comprises piece is not in the address of branch's jump instruction of this translation unit.
The present invention also provides a kind of dynamic translation manner of execution, may further comprise the steps:
A) the source binary code of packing into;
B) pack into the static local code and the information table that enters the mouth accordingly;
C) carry out and to be translated file and to comprise following steps:
C1) according to the file system agreement, find the program entry point;
C2) start the local code that is performed the file correspondence and carry out, in the local code implementation, when running into still untranslated instruction or EOP (end of program), withdraw from local code;
C3) judge according to the agreement of operating system whether be performed program finishes, if finish, execution in step d then), otherwise execution in step c4);
C4) obtaining the address of the source binary code of be about to carrying out, will be that the piece (block) of start address carries out instant translation and carries out with this address, produce corresponding local code;
C5) link between the local code that will dynamically generate, and the local code that will dynamically generate links with the static local code that generates;
C6) address setting of the instruction that will soon carry out becomes the entrance, then execution in step c2);
Use when d) deriving profile information and indirect target information table for static translation.
In such scheme, step c5) may further comprise the steps:
C51) set up and follow-up linking, all that find out this piece (block) are follow-up, if some follow-up be the inlet of static local code, then set up and static local code enters the mouth links; Follow-up for what be left, if some follow-up local code that has been translated into then connects with these local codes; If also remain follow-up link is as yet arranged, in forerunner's information table, note the piece at follow-up place and its forerunner this moment;
C52) set up and the linking of forerunner, inquiry forerunner information table will be that forerunner's piece links with the foundation of this piece with this piece.
The present invention also provides a kind of dynamic execution translater, comprises that first insmods, and second insmods, and carries out translation module, instant translation and link module and derivation module, wherein:
First insmods is used to pack into the source binary code;
Second insmods be used to pack into the static local code and the information table that enters the mouth accordingly;
The execution translation module is used for execution and is translated file;
Derive when module is used to derive profile information and indirect target information table for static translation and use; And
In carrying out translation module, also comprise instant translation module and link module, be respectively applied for the still untranslated module that is run in the implementation is carried out instant translation execution and link, when link, set up and follow-up linking, all that find out this piece are follow-up, if some is follow-up to be the inlet of static local code, then set up and linking that static local code enters the mouth; Follow-up for what be left, if some follow-up local code that has been translated into then connects with these local codes; If also remain follow-up link is as yet arranged, in forerunner's information table, note the piece at follow-up place and its forerunner this moment.
As from the foregoing, the present invention carries out instant translation by dynamic translation actuator and carries out by reserving necessary inlet, and by with reserve mode that inlet is linked and bring into play the performance of system.Increase inlet porting and employing instant translation are carried out, and overcome prior art and dynamically can't return the problem of the static local code that is generated for a long time in the execution, and dynamically be to adopt merely to explain the inefficient problem of execution, improve code quality and entire system performance.
Description of drawings
Fig. 1 is the binary translation system structural drawing of being association of activity and inertia of the embodiment of the invention;
Fig. 2 is the static translation result schematic diagram of the embodiment of the invention;
Fig. 3 is the workflow diagram that the present invention is association of activity and inertia;
Fig. 4 a is the incomplete processing mode synoptic diagram of information of the present invention;
Fig. 4 b is the incomplete method flow diagram of information of the present invention;
Fig. 5 a is a static translation device workflow diagram in the embodiment of the invention;
Fig. 5 b dynamically carries out the translater workflow diagram in the embodiment of the invention;
Fig. 6 a is the structural drawing of static translation device of the present invention;
Fig. 6 b is the structural drawing that the present invention dynamically carries out translater.
Embodiment
The present invention has provided the scheme of a binary translation of being association of activity and inertia, and emphatically the probabilistic problem of the static information that is wherein run into is provided corresponding solution.
For the ease of the understanding of the present invention, introduce ultimate principle of the present invention here earlier, provide corresponding embodiment then.
The binary translation system of being association of activity and inertia is made up of the two large divisions, as shown in Figure 1.Be respectively " static translation device " and " dynamically translating actuator ", the two cooperatively interacts and finishes whole binary translation task.The effect of static translation device is before program is not carried out, and according to the result of dynamic outline information search (profiling) the source binary code is carried out static translation, translates into the static translation result.This result comprises target machine code (being referred to as " static local code ") and some supplementarys after the translation, for dynamically translation actuator use (as shown in Figure 2).After dynamically the translation actuator obtains these information, source binary code and static local code are packed into, dynamically start the program that is translated and carry out.And write down the result of profile information search in the process of implementation, and using when translating for the static translation device next time, it carries out flow process as shown in Figure 3.In this system, the translation of sound attitude is alternately carried out, and after replacing through several times, it is stable that the program of being translated reaches.
We know, appearance owing to redirect indirectly, indirect call when static translation can cause the uncertainty of static information, make the static translation device can't locate the target of indirect redirect exactly, thereby can't judge the border of fundamental block exactly, and each fundamental block forerunner accurately.This will have a strong impact on the use of the global optimization strategy of striding fundamental block, thus the code quality that the influence translation is produced.
Among the present invention, adopt following method to solve this problem:
As shown in Figure 2, the static translation device is divided into two parts with the executable code that is translated, and is respectively static interpretable code and the static code that temporarily can not translate, and the code that the static translation device can turn over static state is translated.
Referring to Fig. 4 b,
Step 10 can be turned over from static state and to be chosen some special block (piece) the code, and these block are given over to into inlet, shown in Fig. 4 a.In the translation optimizing process, processing is guarded in these places that given over to inlet, do not allow the global optimization strategy to upset the state of these porch, be i.e. the unanimity of attribute, register and other machine state that maintenance is identical with the source binary code.
Step 20, except the instruction that gives over to inlet, other place need not to guard processing, can adopt the various global optimization strategies of striding fundamental block that interpreter code is carried out depth optimization.
Step 30 after dynamically translating execution module and starting, with the code and the corresponding inlet graftabl of static translation, and is preferentially moved static local code.
Step 40, in dynamic implementation, if when running into the code of untranslated mistake still, according to the address that is about to carry out these codes being carried out instant translation by dynamic translators carries out, with between the local code that dynamically generates and the static local code that generates link, instant translation is carried out when running into the inlet that static translation reserves, and the code that changes static translation more again over to is carried out.
In addition, in order to translate more code as much as possible when the static state, dynamically the translation actuator is gathered profile information, the temperature information that this profile information is used always in comprising compiling, also comprise indirect target information, in order to the indirect target of record during actual motion, during for static translation next time, stride across the indirect target instruction and translate.
Information uncertain problem when above-mentioned solution can solve static translation, the indirect target of dynamically recording can enlarge static the information that can't obtain, by inlet porting information, but restriction can not interpreter code being connected of part and interpreter code, the part that static state can be translated has kept self-enclosed property, for static translation provides bigger optimization space.These restrictions are dynamically translated by dynamic translation actuator and are remedied, thereby make that total system can organic and operation efficiently.
At above-mentioned principle, the concrete implementation step of this method is as follows:
Need to prove, the problem of information uncertainty when the objective of the invention is to solve static translation, so focus in the implementation step solution of this problem is described, method commonly used in those binary translations will here not given unnecessary details.
Referring to Fig. 5 a and Fig. 5 b,
Step 100 if there is the last profile information that is obtained when carrying out of dynamically translating, is read in these information.If there is no, then profile information is made as sky.In step 100, profile information comprises that temperature information, indirect target information table and target be not in the branch's jump instruction and the destination address thereof of this translation unit.
Step 110, dis-assembling source binary code.In step 110, when running into indirect redirect and indirect call, search the indirect target information table, if corresponding target has been arranged, then proceed; Otherwise, finish the dis-assembling work of this individual path, according to the method for depth-first search other individual path is carried out dis-assembling.
Step 120, inlet porting information, with these entry records the inlet information table in.In step 120, those may be given over to inlet as the fundamental block of the target of other code.These inlets comprise: the inlet place fundamental block of the translation unit that (1) is translated, (2) next bar instruction place fundamental block of function call instruction, (3) inlet quantity arrives the destination address of this translation unit that the branch's jump instruction in other translation unit enters above fundamental block (the control flow graph according to program defines) (4) dynamic outline information search of some self-defined thresholdings.
Step 130 is carried out static translation, and except giving over to the place of inlet, other all adopts the depth optimization strategy to be optimized in step 130, and the strategy that is provided in the compiling field can be provided for use according to demand.
Step 140 is preserved code and inlet information table after translating, for dynamically translation actuator use.
Step 150, the source binary code of packing into, its regular agreement according to operating system of packing into gets final product.
Step 160, pack into the static local code and the information table that enters the mouth accordingly.
Step 170 carries out being translated file.In step 170, begin to carry out the code of translating from program entry, when running into still untranslated part, suspend execution to the code of translating.Next the code that is about to carry out is carried out instant translation and carry out, and the record indirect target, the code that new translation is produced carried out then.With between the local code that dynamically generates and the static local code that generates link.Continue like this,, change in the static translation code and carry out up to running into the program entry that static translation is reserved.In this way, finish being translated the execution of file.
That is to say that step 170 may further comprise the steps:
Step 1 according to the file system agreement, finds the program entry point.
Step 2 according to the entrance, finds instruction address corresponding in the local code, and this instruction is handed in control, starts the local code that is performed the file correspondence and carries out, and in the local code implementation, when running into still untranslated instruction or EOP (end of program), withdraws from local code.
Step 3 judges according to the agreement of operating system whether finish, if finish, then end step 170, otherwise carry out next step if being performed program.
Step 4, the address that obtains the source binary code of be about to carrying out will be that the piece (block) of start address carries out instant translation and carries out with this address, produce corresponding local code.
Step 5, with between the local code that dynamically generates and the static local code that generates link.
In step 5, comprise following steps again:
Step 5a sets up and follow-up linking, and all that find out this block are follow-up, if some follow-up be the inlet of static local code, then set up and static local code enters the mouth links; Follow-up for what be left, if some follow-up local code that has been translated into then connects with these local codes; If also remain follow-up link is as yet arranged, illustrate that these follow-up pairing block are still untranslated, in forerunner's information table, note the block at follow-up place and its forerunner this moment.
Step 5b sets up and the linking of forerunner, and inquiry forerunner information table will be that forerunner's block links with this block foundation with this block.
Step 6 becomes the entrance with the address setting that is about to the instruction of execution, and execution in step 2 then.
Step 180 is used when deriving profile information and indirect target information table for static translation.
Describe the static translation device in detail and dynamically translate actuator referring to Fig. 6 a and 6b.
Shown in Fig. 6 a, the static translation device comprises that profile information reads in module, the dis-assembling module, and inlet is provided with module, translation optimal module and preserves module.The major function of this static translation device is according to the dynamic translation profile information (if any) that actuator obtained of last time, to carry out static translation as much as possible.Wherein, profile information reads in module and is used to read in the last dynamically profile information that is obtained when translation is carried out; The dis-assembling module is used for dis-assembling source binary code; Inlet is provided with module and is used for inlet porting information, with these entry records in the inlet information table; The translation optimal module is used to carry out static translation, and except giving over to the place of inlet, other all adopts the depth optimization strategy to be optimized; Preserve code and inlet information table after module is used to preserve translation, use for dynamic translation actuator.
Shown in Fig. 6 b, dynamically translate actuator and comprise that first insmods, second insmods, and carries out translation module and derives module.Wherein, first insmod and be used to pack into the source binary code; Second insmods be used to pack into the static local code and the information table that enters the mouth accordingly; The execution translation module is used for execution and is translated file; Derive when module is used to derive profile information and indirect target information table for static translation and use; In carrying out translation module, also comprise instant translation module (not shown) and link module (not shown), be respectively applied for the still untranslated module that is run in the implementation is carried out instant translation execution and link.
It should be noted last that: above embodiment is the unrestricted technical scheme of the present invention in order to explanation only, although the present invention is had been described in detail with reference to the foregoing description, those of ordinary skill in the art is to be understood that: still can make amendment or be equal to replacement the present invention, and not breaking away from any modification or partial replacement of the spirit and scope of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (9)

1, the incomplete disposal route of static information in a kind of binary translation of being association of activity and inertia may further comprise the steps:
A) can turn over from static state and choose some special fundamental blocks the code, it is inlet that these fundamental blocks are given over to, the conservative processing;
B) except giving over to the fundamental block of inlet, other place need not to guard processing, adopts the various global optimization strategies of striding fundamental block that interpreter code is carried out depth optimization;
C) dynamically translate execution module and start after, with the code and the corresponding inlet graftabl of static translation, and preferentially move static local code.
D) in dynamic implementation, if when running into the code of untranslated mistake still, according to the address that is about to carry out these codes being carried out instant translation by dynamic translators carries out, to link between the local code that dynamically generates, and the local code that will dynamically generate links with the static local code that generates, instant translation is carried out when running into the inlet that static translation reserves, and the code that changes static translation more again over to is carried out.
2, the method for claim 1, it is characterized in that, inlet in the step a) comprises: fundamental block that next bar instruction place fundamental block of first fundamental block of the translation unit that is translated, function call instruction, inlet quantity surpass some self-defined thresholdings or dynamic outline information search are arrived, the destination address of this translation unit that the branch's jump instruction in other translation unit enters.
3, method as claimed in claim 2 is characterized in that, described translation unit is a code segment; Described translation unit with the destination address of function call instruction or branch's jump instruction as initial inlet; From inlet, successively according to the control flow analysis corresponding instruction, in the time of can't determining instruction, the function link order of the indirect jump target of target when running into static state, the instruction of described indirect jump target, function link order are as the outlet of described translation unit.
4, the method for claim 1, it is characterized in that, in the step a), these fundamental blocks that given over to inlet are guarded processing, do not allow the global optimization strategy to upset the state of these porch, make the code after the translation keep the attribute identical with the source binary code, before and after the translation, the state of register and other machine remains unchanged.
5, a kind of static translation method may further comprise the steps:
If a) have the last profile information that is obtained when carrying out of dynamically translating, read in these information, with the tutorial message of these information as subsequent step, if there is no, then the profile information that will be used to instruct is made as sky;
B) dis-assembling source binary code; When running into indirect redirect and indirect call, search the indirect target information table, if corresponding target has been arranged, then proceed; Otherwise, finish;
C) inlet porting information, with these entry records the inlet information table in; Those may be given over to inlet as the fundamental block of the target of other code, these inlets comprise: fundamental block that next bar instruction place fundamental block of first fundamental block of the translation unit that is translated, function call instruction, inlet quantity surpass some self-defined thresholdings or dynamic outline information search are arrived, the destination address of this translation unit that the branch's jump instruction in other translation unit enters;
D) carry out static translation, except giving over to the place of inlet, other all adopts the depth optimization strategy to be optimized;
E) preserve the code after translating and the information table that enters the mouth, for dynamically translation actuator use.
6, method as claimed in claim 5 is characterized in that, in the step a), the temperature information, indirect target information, target that profile information comprises piece is not in the branch's jump instruction and the destination address thereof of this translation unit.
7, a kind of dynamic translation manner of execution may further comprise the steps:
A) the source binary code of packing into;
B) pack into the static local code and the information table that enters the mouth accordingly;
C) carry out and to be translated file and to may further comprise the steps:
C1) according to the file system agreement, find the program entry point;
C2) start the local code that is performed the file correspondence and carry out, in the local code implementation, when running into still untranslated instruction or EOP (end of program), withdraw from local code;
C3) judge according to the agreement of operating system whether be performed program finishes, if finish, execution in step d then), otherwise execution in step c4);
C4) obtaining the address of the source binary code of be about to carrying out, will be that the piece of start address carries out instant translation and carries out with this address, produce corresponding local code;
C5) link between the local code that will dynamically generate, and the local code that will dynamically generate links with the static local code that generates;
C6) address setting of the instruction that will soon carry out becomes the entrance, then execution in step c2);
Use when d) deriving profile information and indirect target information table for static translation.
8, method as claimed in claim 7 is characterized in that, step c5) may further comprise the steps:
C51) set up and follow-up linking, all that find out this piece are follow-up, if some follow-up be the inlet of static local code, then set up and static local code enters the mouth links; Follow-up for what be left, if some follow-up local code that has been translated into then connects with these local codes; If also remain follow-up link is as yet arranged, in forerunner's information table, note the piece at follow-up place and its forerunner this moment;
C52) set up and the linking of forerunner, inquiry forerunner information table will be that forerunner's piece links with the foundation of this piece with this piece.
9, a kind of dynamic execution translater is characterized in that comprising that first insmods, and second insmods, and carries out translation module, instant translation and link module and derivation module, wherein:
First insmods is used to pack into the source binary code;
Second insmods be used to pack into the static local code and the information table that enters the mouth accordingly;
The execution translation module is used for execution and is translated file;
Derive when module is used to derive profile information and indirect target information table for static translation and use; And
In carrying out translation module, also comprise instant translation module and link module, be respectively applied for the still untranslated module that is run in the implementation is carried out instant translation execution and link, when link, set up and follow-up linking, all that find out this piece are follow-up, if some is follow-up to be the inlet of static local code, then set up and linking that static local code enters the mouth; Follow-up for what be left, if some follow-up local code that has been translated into then connects with these local codes; If also remain follow-up link is as yet arranged, in forerunner's information table, note the piece at follow-up place and its forerunner this moment.
CNB2004100092870A 2004-06-30 2004-06-30 Treating method and device for static information incompleteness in moving and static combined binary translation Active CN100359470C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100092870A CN100359470C (en) 2004-06-30 2004-06-30 Treating method and device for static information incompleteness in moving and static combined binary translation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100092870A CN100359470C (en) 2004-06-30 2004-06-30 Treating method and device for static information incompleteness in moving and static combined binary translation

Publications (2)

Publication Number Publication Date
CN1716202A CN1716202A (en) 2006-01-04
CN100359470C true CN100359470C (en) 2008-01-02

Family

ID=35822062

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100092870A Active CN100359470C (en) 2004-06-30 2004-06-30 Treating method and device for static information incompleteness in moving and static combined binary translation

Country Status (1)

Country Link
CN (1) CN100359470C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452396B (en) * 2008-12-25 2012-04-25 上海交通大学 Binary translation method combining static optimization
CN101706734B (en) * 2009-11-10 2013-08-14 中国科学院计算技术研究所 Method and system thereof for translating indirect jump instruction in binary translation
CN104375879B (en) * 2014-11-26 2018-02-09 康烁 Based on the binary translation method and device for performing tree depth
CN111625279A (en) * 2020-04-27 2020-09-04 中国人民解放军战略支援部队信息工程大学 Dynamic and static fusion binary translation method and system based on dynamic link library
CN114995832B (en) * 2022-06-28 2023-03-21 湖南卡姆派乐信息科技有限公司 Dynamic and static combined binary program translation method
CN115543547B (en) * 2022-11-30 2023-04-18 北京太极信息系统技术有限公司 Migration method and system for virtual machine in heterogeneous virtualization platform
CN116126350B (en) * 2023-04-17 2023-09-12 龙芯中科技术股份有限公司 Binary translation method, binary translator and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5930509A (en) * 1996-01-29 1999-07-27 Digital Equipment Corporation Method and apparatus for performing binary translation
CN1270348A (en) * 1998-10-21 2000-10-18 富士通株式会社 Dynamic optimizing target code translator for structure simulation and translating method
US6308321B1 (en) * 1998-12-11 2001-10-23 Incert Software Corporation Method for determining program control flow
CN1374585A (en) * 2001-03-02 2002-10-16 国际商业机器公司 Method and apparatus for optimizition chaining post code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5930509A (en) * 1996-01-29 1999-07-27 Digital Equipment Corporation Method and apparatus for performing binary translation
CN1270348A (en) * 1998-10-21 2000-10-18 富士通株式会社 Dynamic optimizing target code translator for structure simulation and translating method
US6308321B1 (en) * 1998-12-11 2001-10-23 Incert Software Corporation Method for determining program control flow
CN1374585A (en) * 2001-03-02 2002-10-16 国际商业机器公司 Method and apparatus for optimizition chaining post code

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Binary translation:static,dynamic,retargetable? Cristina Cifuentes, Vishv Malhotra.Proceedings International Conference on Software Maintenance.. 1996 *
FX!32 a profile-directed binary translator. Anton Chernoff, Mark Herdeg, etc.IEEE Micro,Vol.vol:18 No.Issue:2. 1998 *

Also Published As

Publication number Publication date
CN1716202A (en) 2006-01-04

Similar Documents

Publication Publication Date Title
CN100465895C (en) Compiler, compilation method, and compilation program
Lee et al. Branch prediction strategies and branch target buffer design
US8769511B2 (en) Dynamic incremental compiler and method
US5530964A (en) Optimizing assembled code for execution using execution statistics collection, without inserting instructions in the code and reorganizing the code based on the statistics collected
KR101279179B1 (en) Parallel program generation method
US6295644B1 (en) Method and apparatus for patching program text to improve performance of applications
CN1802632B (en) Method and apparatus for performing interpreter optimizations during program code conversion
CN101299192B (en) Non-aligning access and storage processing method
Bala et al. Efficient instruction scheduling using finite state automata
CN106227671A (en) Program analysis of running performance method and device
CN100359470C (en) Treating method and device for static information incompleteness in moving and static combined binary translation
JPH1173325A (en) Program converting device and recording medium
CN102156634B (en) Method for realizing value association indirect jump forecast
CN100559344C (en) A kind of disposal route of supporting with regular record variables access special register group
CN101593125B (en) Method for dynamically monitoring execution flow of binary internal translator by using monitoring thread
CN100437476C (en) Processing of a compileable computer program
CN1332308C (en) Translation method in dynamic binary translation
RU2206119C2 (en) Method for producing object code
CN103793502A (en) Cloud-based heat path optimization method in just-in-time compiler
JP3902147B2 (en) Compiler device, compilation method, compiler program, and recording medium
CN102360306A (en) Method for extracting and optimizing information of cyclic data flow charts in high-level language codes
CN101907999B (en) Binary translation method of super-long instruction word program
CN100498716C (en) Method for converting straight-through passage for system call for processor emulation model
US20080059777A1 (en) Semiconductor integrated circuit device and compiler device
Posadas et al. Accelerating host-compiled simulation by modifying ir code: Industrial application in the spatial domain

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant