Search Images Maps Play YouTube News Gmail Drive More »
Sign in
Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.

Patents

  1. Advanced Patent Search
Publication numberCN101238438 B
Publication typeGrant
Application numberCN 200680024664
PCT numberPCT/US2006/026081
Publication date8 Dec 2010
Filing date30 Jun 2006
Priority date8 Jul 2005
Also published asCN101238438A, EP1902364A2, EP1902364A4, US7389500, US20070011666, WO2007008506A2, WO2007008506A3
Publication number200680024664.5, CN 101238438 B, CN 101238438B, CN 200680024664, CN-B-101238438, CN101238438 B, CN101238438B, CN200680024664, CN200680024664.5, PCT/2006/26081, PCT/US/2006/026081, PCT/US/2006/26081, PCT/US/6/026081, PCT/US/6/26081, PCT/US2006/026081, PCT/US2006/26081, PCT/US2006026081, PCT/US200626081, PCT/US6/026081, PCT/US6/26081, PCT/US6026081, PCT/US626081
InventorsVĚ谭
Applicant微软公司
Export CitationBiBTeX, EndNote, RefMan
External Links: SIPO, Espacenet
Selective pre-compilation of virtual code to enhance emulator performance
CN 101238438 B
Abstract
A method and computer-readable medium perform a pre-boot scan of an emulated binary to detect a function that is above a predetermined complexity threshold. The detected function may then be precompiled during a boot-up process. The pre-boot scan may also detect a function that falls below a second predetermined complexity threshold. The detected function may be placed inline with the code body. Just-in-time translation may then be performed at runtime.
Claims(17)  translated from Chinese
  1. 一种用以提高仿真器性能的虚拟代码的选择性预编译方法,包括:扫描具有至少一个函数的虚拟代码;在所述扫描之后判定所述至少一个函数是否具有超出第一预定阈值的复杂度;如果所述至少一个函数具有超出所述第一预定阈值的复杂度,则预编译所述函数;以及对所述虚拟代码执行及时翻译。 After determining the complexity of the function whether the at least one scan exceeds a first predetermined threshold value; scan codes having at least one virtual function: A method for improving the selectivity precompiler virtual performance simulator code, comprising ; if the at least one function has exceeded the first predetermined threshold value complexity, the pre-compiling the function; and performing timely translation of the virtual code.
  2. 2.如权利要求1所述的方法,其特征在于,所述复杂度级别对应于代码行的预定数目。 2. The method according to claim 1, characterized in that the degree of the level corresponding to the predetermined number of lines of code complexity.
  3. 3.如权利要求1所述的方法,其特征在于,所述预编译步骤延长虚拟代码启动周期一持续时间,并且其中所述第一预定阈值基于所述持续时间。 3. The method according to claim 1, wherein said step of pre-compiled code to start the cycle of a virtual extension of the duration, and wherein said first predetermined threshold value based on the duration.
  4. 4.如权利要求1所述的方法,其特征在于,所述虚拟代码具有主体和至少一个子例程, 并且还包括:如果所述至少一个函数不具有超出所述第一预定阈值的复杂度: 判定所述至少一个子例程具有小于第二预定阈值的复杂度;以及将所述至少一个子例程放置在所述虚拟代码的所述主体中。 4. The method according to claim 1, characterized in that said virtual codes having a body and at least one subroutine, and further comprising: if the at least one function that does not have said first predetermined threshold exceeding complexity : determining at least one subroutine has a complexity is less than a second predetermined threshold value; and the at least one subroutine is placed in the body of the virtual code.
  5. 5.如权利要求4所述的方法,其特征在于,所述至少一个子例程具有代码行,以及其中所述主体具有对应于所述子例程的函数调用,并且其中所述放置步骤包括从所述至少一个子例程拷贝所述代码行并使用所述代码行替代所述虚拟代码的所述主体中的所述函数调用。 5. The method according to claim 4, characterized in that said at least one subroutine has a line of code, and wherein the body has a corresponding function call of the subroutine, and wherein said placing step comprises from said at least one copy of the subroutine of the lines of code and lines of code in place of the use of the function of the virtual body of code in the call.
  6. 6.如权利要求5所述的方法,其特征在于,所述虚拟代码还包括多个子例程,并且其中仅当所述子例程的数量小于第三预定阈值时,才执行所述放置步骤。 6. The method according to claim 5, wherein said code further comprises a plurality of virtual sub-routines, and wherein said subroutine only if the number is less than a third predetermined threshold value, before performing the placing step .
  7. 7.如权利要求1所述的方法,其特征在于,所述虚拟代码实现图形渲染软件。 7. The method according to claim 1, characterized in that said virtual graphics rendering software code.
  8. 8. 一种用以提高仿真器性能的虚拟代码的选择性预编译方法,包括: 对软件应用程序的仿真二进制码执行预引导扫描;对所述二进制码内具有超出第一预定阈值的的复杂度的第一函数进行标识; 对所述二进制码内需要上下文切换来执行并具有小于第二预定阈值的复杂度的第二函数进行标识;预编译所述第一函数;将所述第二函数内联放置在所述仿真二进制码的主体中;以及对所述仿真二进制码执行及时翻译。 8. A method for enhancing the selectivity precompiled virtual simulator performance of the code, including: simulation software applications to perform pre-boot binary code scanning; within the binary code has exceeded a first predetermined threshold value of the complex identify a first degree function; within the context of the need to perform a binary code and having a second switching function complexity is less than a second predetermined threshold value are identified; precompiled said first function; the second function Inline simulation placed in the binary code of the body; and performing timely translation of the simulation of binary code.
  9. 9.如权利要求8所述的方法,其特征在于,所述及时翻译生成适于由预定处理器执行的第二二进制码。 9. The method according to claim, wherein said generating is adapted to perform the translation in time by a second predetermined binary code processor.
  10. 10.如权利要求9所述的方法,其特征在于,还包括执行所述经翻译的二进制码。 10. The method according to claim 9, characterized in that, further comprising the translated binary code execution.
  11. 11.如权利要求8所述的方法,其特征在于,所述及时翻译在所述软件应用程序的运行时执行。 11. The method of claim 8, wherein the timely translation executed at run time the software application.
  12. 12.如权利要求8所述的方法,其特征在于,所述软件应用程序是游戏软件。 12. The method according to claim 8, wherein said software application is game software.
  13. 13.如权利要求8所述的方法,其特征在于,所述第一和第二函数与图形渲染相关。 13. The method according to claim 8, characterized in that said first and second functions associated with the graphics rendering.
  14. 14. 一种用以提高仿真器性能的虚拟代码的选择性预编译系统,所述系统包括: 用于扫描具有至少一个函数的虚拟代码的装置;用于在所述扫描之后判定所述至少一个函数是否具有超出第一预定阈值的复杂度的装置;用于如果所述至少一个函数具有超出所述第一预定阈值的复杂度,则预编译所述函数的装置;以及用于对所述虚拟代码执行及时翻译的装置。 14. A method for improving the selectivity precompiler system simulator virtual code performance, the system comprising: means for scanning at least one function having a virtual code; means for determining, after said scanning of said at least one function is the complexity of the device exceeds a first predetermined threshold value has; for if the at least one function has complexity beyond the first predetermined threshold value, the pre-compiled function of the device; and for the virtual code execution timely translation devices.
  15. 15.如权利要求14所述的系统,其特征在于,所述用于预编译的装置延长虚拟代码启动周期一持续时间,并且其中所述第一预定复杂度阈值基于所述持续时间。 15. The rights and wherein the first predetermined threshold value of the complexity of the system based on the duration or claim 14, wherein the means for pre-compiled code to start the cycle a virtual extension of the duration.
  16. 16.如权利要求14所述的系统,其特征在于,所述虚拟代码具有主体和至少一个子例程,并且还包括:用于如果所述至少一个函数不具有超出所述第一预定阈值的复杂度,则判定所述至少一个子例程具有小于第二预定复杂度阈值的复杂度的装置;以及将所述至少一个子例程放置在所述虚拟代码的所述主体中的装置。 16. The system of claim 14, wherein said virtual codes having a body and at least one subroutine, and further comprising: means for, if said at least one function of said first predetermined threshold has not exceeded complexity, it is determined that the at least one subroutine has a complexity means is smaller than a second predetermined complexity threshold; and at least one subroutine is placed in the main body of the apparatus in the virtual code.
  17. 17.如权利要求16所述的系统,其特征在于,所述至少一个子例程具有代码行,以及其中所述主体具有对应于所述子例程的函数调用,并且其中所述用于放置的装置从所述至少一个子例程拷贝所述代码行并使用所述代码行替代所述虚拟代码的所述主体中的所述函数调用。 17. The system according to claim 16, characterized in that said at least one subroutine has a line of code, and wherein the body has a corresponding function call of the subroutine, and wherein the means for placing It means from said at least one copy of the subroutine code line and the line in place of the use of the function of the virtual body of code in the call.
Description  translated from Chinese

用以提高仿真器性能的虚拟代码的选择性预编译方法和系 Selective precompiled method to improve the performance of virtual simulation code and department

EC

发明领域 Field of the Invention

[0001] 本发明一般涉及软件仿真领域,尤其涉及虚拟代码的选择性预编译和内联。 [0001] The present invention relates generally to the field of simulation software, in particular, to the virtual selectivity precompiled code and inlining. 背景技术 Background

[0002] 当诸如视频游戏的软件应用程序被编译时,它通常被转换成虚拟代码,诸如提供对应用程序的描述以及该应用程序如何来运行的指令的中间仿真二进制码。 [0002] When software applications such as video games is compiled, it is usually converted into a virtual code, such as providing the middle of the description of the application and the application instructions on how to run the simulation of binary code. 软件仿真器在应用程序被执行之前的某个时刻对软件应用程序的中间二进制码执行二进制翻译。 Emulator software application at a time to be executed before the execution of the software application binary translation intermediate binary code. 二进制翻译指将中间二进制码转换成专用于将执行该代码的处理器类型的机器可执行二进制码的过程。 Binary translation refers to the intermediate binary code into dedicated to the implementation of the code, the processor type of machine-executable binary code of procedure. 然后,可执行二进制码准备好由针对其已进行格式化的处理器来执行。 Then, the executable binary code ready to perform for which has been formatted processor.

[0003] 一种这样的二进制翻译方法称为“及时(just-in-time) ” ( “ JIT” ) 二进制翻译, 由其名字所暗示,它是恰好在代码被执行之前进行的软件代码的二进制翻译。 [0003] One such method is called binary translation "in a timely manner (just-in-time)" ("JIT") binary translation, its name implies, it is a binary code is executed just before the software code of conduct Translation. 结果,可在各种处理器和计算平台上使用特定中间二进制码,因为成功运行代码所需进行的处理器专用改变不会发生直至恰好在执行之前。 As a result, you can use a particular intermediate binary code on a variety of processors and computing platforms, because the processor-specific changes in the code are necessary for the successful operation does not occur until just before the execution. JIT翻译还提供了相对快速的加载和引导时间,因为在启动期间不进行二进制翻译。 JIT translation also provides a relatively rapid loading and boot times, because during startup without binary translation.

[0004] 遗憾的是,在运行时,JIT翻译可对代码的执行产生不利影响。 [0004] Unfortunately, at run-time, JIT translation may have an adverse impact on the implementation of the code. 例如,针对代码内的大多数平均复杂的图形函数,典型的游戏系统可能在运行时执行JIT翻译而不对代码的执行产生不利影响(即,不影响图形渲染)。 For example, for most average within the code complex graphics functions typical game system may be executed at run time without adversely affecting JIT translation (ie, does not affect the graphics rendering) for the implementation of the code. 然而,如果遇到特别复杂的图形函数一诸如涉及大段人工智能(“Al”)的图形函数一则可能不存在足以可用于执行函数翻译和代码执行的处理器资源。 However, if you encounter a particularly complex graphics functions such as involving large section of artificial intelligence ("Al") graphics functions might not exist a sufficient function can be used to perform the translation and processor resources code execution. 因此,在回放期间,用户可能注意到代码执行中如明显的“闪烁”或“结巴(stutter),,的瞬间暂停。随着程序设计员坚持不懈地为图形逼真度而努力,这些延迟变得越来越令人不快。 Thus, during playback, the user may notice that the code execution as the obvious "flicker" or "stutter (stutter) ,, a momentary pause. With the programmer unswervingly efforts for the graphics fidelity, these delays become more and more unpleasant.

[0005] 另一种翻译方法涉及软件预编译器的使用。 [0005] Another method involves translation software pre-compiler to use. 预编译器对表示执行之前的软件应用程序代码的整个静态中间二进制码执行二进制翻译。 Pre-compiler that the implementation of software application code before the entire static intermediate binary code execution binary translation. 通常在启动过程期间软件被加载时(在“加载时间”)进行翻译。 Typically during the process when you start the software is loaded (in the "load time") for translation. 虽然预编译器的使用提供了运行时较快速、无中断的执行,但是当预编译器执行二进制翻译时的初始加载时间被延长。 Although the use of a pre-compiler to provide a more rapid, non-disruptive implementation of runtime, but when the initial load time pre-compiler to perform binary translation time is extended. 因而,用户可能体验过度长的系统引导时间,因此,通常不对较大的程序使用预编译器。 Thus, the user may experience excessive length of the system boot time, therefore, usually not larger program using pre-compiler.

[0006] 在运行时存在与执行机器可执行二进制码中的相对较简单的函数相关的另一问题。 [0006] The existence and implementation of machine-executable binary code in a relatively simple function of another related issue at runtime. 例如,许多函数涉及从代码主体到子例程的调用。 For example, many of the functions related to the body from the code to call the subroutine. 对子例程的调用以及从该子例程的返回(称为“上下文切换”)需要处理时间。 Call the subroutine, and the routine is returned from the sub (called "context switching") required processing time. 对于大多数函数,上下文切换所需的处理时间与执行函数本身所需的处理时间相比可被忽略。 Processing time for most functions, context switching and processing time required to perform the required function itself can be ignored in comparison. 然而,如果函数非常小,则上下文切换所需的处理时间可能在函数所需的总执行时间中占据相当大的百分比。 However, if the function is very small, the processing time required to switch contexts may occupy a large percentage of the total execution time required for the function. 结果,这种函数作为子例程的执行的效率比如果简单地在代码的主体内执行该函数要低。 As a result, the efficiency of the implementation of this function as a subroutine than if simply perform that function in the body of the code to be lower. 此低效率由于被上下文切换占据了过多的处理时间的,可对JIT翻译以及代码执行的性能产生不利影响。 This low efficiency due to being occupied too much context switching processing time can translate to JIT code execution and performance adversely affected. 虽然执行这样的函数作为子例程可能是低效率的,但是这种函数通常充当软件开发者的便利手段。 While performing such functions as a subroutine may be inefficient, but this function is usually acts as a convenient means of software developers. 因而,简单地创建所有这些函数均位于其主体中的代码并非所期望的。 Thus, simply create all of these functions are located in the body of code is not desired.

4[0007] 因此,需要一种克服了上述缺点和缺陷的机制。 4 [0007] Thus, a need for a mechanism to overcome the above drawbacks and defects. 本发明满足了这种需要。 The present invention satisfies this need.

[0008] 发明内容 [0008] SUMMARY

[0009] 鉴于上述缺点和缺陷,提供了一种方法和计算机可读介质,它们对仿真二进制码执行预引导扫描以检测高于预定复杂度阈值的函数。 [0009] In view of the above disadvantages and drawbacks, there is provided a method and computer-readable media, which performs pre-boot scan to detect levels above a predetermined threshold complexity binary code emulation function. 然后,在启动过程期间,预编译检测到的函数。 Then, during the boot process, the pre-compiled function detected. 预引导扫描还可检测低于第二预定复杂度阈值的函数。 Pre-boot scan also the complexity of the function of the second predetermined threshold value is below detection. 可将检测到的函数与代码主体内联放置。 The function can be detected in the body associated with the code placed within. 然后,可在运行时执行及时翻译,其中预编译函数可被直接执行而无需进一步翻译,并且可执行移入内联的任何函数而无需上下文切换。 Then, you can execute timely translation at runtime, wherein the pre-compiled functions can be executed directly without further translation, and may perform any function into inline without context switching.

[0010] 根据本发明的第一方面,提供了一种用以提高仿真器性能的虚拟代码的选择性预编译方法,包括:扫描具有至少一个函数的虚拟代码;在所述扫描之后判定所述至少一个函数是否具有超出第一预定阈值的复杂度;如果所述至少一个函数具有超出所述第一预定阈值的复杂度,则预编译所述函数;以及对所述虚拟代码执行及时翻译。 [0010] According to a first aspect of the present invention, there is provided a method for the selective pre-compiled to improve performance of the virtual code emulation, comprising: scanning the code having at least one virtual function; after the determination of the scan whether at least one function exceeds a first predetermined threshold complexity; if the at least one function having a first predetermined threshold value beyond the complexity, the pre-compiling the function; and performing timely translation of the virtual code.

[0011 ] 根据本发明的第二方面,所述复杂度级别对应于代码行的预定数目。 [0011] According to a second aspect of the present invention, the complexity level corresponding to a predetermined number of lines of code in.

[0012] 根据本发明的第三方面,所述预编译步骤延长虚拟代码启动周期一持续时间,并且其中所述第一预定阈值基于所述持续时间。 [0012] According to a third aspect of the invention, the pre-compilation step to extend the virtual code starts a cycle duration, and wherein the first predetermined threshold value based on the duration.

[0013] 根据本发明的第四方面,所述虚拟代码具有主体和至少一个子例程,并且还包括: 如果所述至少一个函数不具有超出所述第一预定阈值的复杂度:判定所述至少一个子例程具有小于第二预定阈值的复杂度;以及将所述至少一个子例程放置在所述虚拟代码的所述主体中。 [0013] According to a fourth aspect of the present invention, the code having the virtual body and at least one subroutine, and further comprising: if the at least one function that does not have the complexity exceeds a first predetermined threshold value: determining the at least one subroutine has a complexity is less than a second predetermined threshold value; and the at least one subroutine is placed in the body of the virtual code.

[0014] 根据本发明的第五方面,所述至少一个子例程具有代码行,以及其中所述主体具有对应于所述子例程的函数调用,并且其中所述放置步骤包括从所述至少一个子例程拷贝所述代码行并使用所述代码行替代所述虚拟代码的所述主体中的所述函数调用。 [0014] According to a fifth aspect of the invention, said at least one subroutine has a line of code, and wherein the body has a corresponding function call of the subroutine, and wherein said placing step comprises at least from the A subroutine copy the lines of code and use the line of code instead of the virtual function of the body of the code in the call.

[0015] 根据本发明的第六方面,所述虚拟代码还包括多个子例程,并且其中仅当所述子例程的数量小于第三预定阈值时,才执行所述放置步骤。 [0015] According to a sixth aspect of the present invention, the virtual code further comprising a plurality of subroutines, and wherein only when the number of said subroutine predetermined threshold value smaller than the third, before performing the placing step.

[0016] 根据本发明的第七方面,所述虚拟代码实现图形渲染软件。 [0016] According to a seventh aspect of the present invention, the virtual code for graphics rendering software.

[0017] 根据本发明的第八方面,一种用以提高仿真器性能的虚拟代码的选择性预编译方法,包括:对软件应用程序的仿真二进制码执行预引导扫描;对所述二进制码内具有超出第一预定阈值的的复杂度的第一函数进行标识;对所述二进制码内需要上下文切换来执行并具有小于第二预定阈值的复杂度的第二函数进行标识;预编译所述第一函数;将所述第二函数内联放置在所述仿真二进制码的主体中;以及对所述仿真二进制码执行及时翻译。 [0017] According to the eighth aspect of the present invention, a method for enhancing the selectivity precompiled virtual simulator performance of the code, including: simulation software applications to perform pre-boot binary code scanning; to the binary code inside having a first function complexity exceeds a first predetermined threshold value be identified; within the context of the need to perform the binary code and having a second switching function complexity is less than a second predetermined threshold value are identified; precompiled said first a function; will join the second function is placed inside the body of a binary code emulation; and performing timely translation of the simulation of binary code.

[0018] 根据本发明的第九方面,所述及时翻译生成适于由预定处理器执行的第二二进制码。 [0018] According to a ninth aspect of the present invention, the timely translation generated by a predetermined processor is adapted to perform a second binary code.

[0019] 根据本发明的第十方面,还包括执行所述经翻译的二进制码。 [0019] According to the tenth aspect of the present invention also includes the translated binary code execution.

[0020] 根据本发明的第十一方面,所述及时翻译在所述软件应用程序的运行时执行。 [0020] According to an eleventh aspect of the present invention, the timely translation executed at run time the software application.

[0021] 根据本发明的第十二方面,所述软件应用程序是游戏软件。 [0021] According to the twelfth aspect of the present invention, the software application is game software.

[0022] 根据本发明的第十三方面,所述第一和第二函数与图形渲染相关。 [0022] According to the thirteenth aspect of the present invention, the first and the second function associated with the graphics rendering.

[0023] 根据本发明的第十四方面,一种用以提高仿真器性能的虚拟代码的选择性预编译系统,所述系统包括:用于扫描具有至少一个函数的虚拟代码的装置;用于在所述扫描之后判定所述至少一个函数是否具有超出第一预定阈值的复杂度的装置;用于如果所述至少一个函数具有超出所述第一预定阈值的复杂度,则预编译所述函数的装置;以及用于对所 [0023] According to a fourteenth aspect of the present invention, a method to improve the selectivity of pre-compiled system simulator performance of virtual code, the system comprising: means for scanning at least one function having a virtual code; for After the scan is determined whether the at least one function exceeds the complexity of the apparatus having a first predetermined threshold; means for, if said at least one function having a complexity beyond said first predetermined threshold value, then the pre-compiled function ; and means for the

5述虚拟代码执行及时翻译的装置。 5 virtual code execution timely translation of said device.

[0024] 根据本发明的第十五方面,所述用于预编译的装置延长虚拟代码启动周期一持续时间,并且其中所述第一预定复杂度阈值基于所述持续时间。 [0024] According to a fifteenth aspect of the present invention, the means for pre-compiled code to start the cycle a virtual extension of the duration, complexity and wherein the first predetermined threshold based on the duration.

[0025] 根据本发明的第十六方面,所述虚拟代码具有主体和至少一个子例程,并且还包括:用于如果所述至少一个函数不具有超出所述第一预定阈值的复杂度,则判定所述至少一个子例程具有小于第二预定复杂度阈值的复杂度的装置;以及将所述至少一个子例程放置在所述虚拟代码的所述主体中的装置。 [0025] According to a sixteenth aspect of the present invention, the code having the virtual body and at least one subroutine, and further comprising: means for, if said at least one function that does not have the complexity exceeds a first predetermined threshold value, it is determined that the at least one subroutine has a complexity means is smaller than a second predetermined complexity threshold; and at least one subroutine is placed in the main body of the apparatus in the virtual code.

[0026] 根据本发明的第十七方面,所述至少一个子例程具有代码行,以及其中所述主体具有对应于所述子例程的函数调用,并且其中所述用于放置的装置从所述至少一个子例程拷贝所述代码行并使用所述代码行替代所述虚拟代码的所述主体中的所述函数调用。 [0026] According to a seventeenth aspect of the present invention, the at least one subroutine has a line of code, and wherein the body has a corresponding function call of the subroutine, and wherein said means for placing from The at least one copy of the subroutine of the lines of code and lines of code in place of the use of the function of the virtual body of code in the call.

附图说明 Brief Description

[0027] 图1是其中可实现本发明的方面的示例计算环境; [0027] Figure 1 is an example in which aspects of the present invention to achieve a computing environment;

[0028] 图2是示出了根据本发明的实施例的示例方法的流程图; [0028] FIG. 2 is a flowchart illustrating a method according to an exemplary embodiment of the present invention;

[0029] 图3是示出了根据本发明的实施例的示例代码流程的框图;以及 [0029] FIG. 3 is a block diagram illustrating an embodiment according to the present invention, sample code processes; and

[0030] 图4A-B是示出了根据本发明的实施例的代码流程的示例更改的框图。 [0030] Figures 4A-B is a block diagram showing changes in accordance with an exemplary embodiment of the present invention, the process code.

具体实施方式 DETAILED DESCRIPTION

[0031] 按照以满足法规要求的特征来描述本发明的主题。 [0031] in order to meet regulatory requirements in accordance with the features described in the subject invention. 然而,描述本身并非旨在限制本专利的范围。 However, the description itself is not intended to limit the scope of this patent. 相反,发明人构想所要求保护的主题还可以其它方式来体现,以包括连同其它现有或将来技术的不同步骤或类似于本文献中所述的要素。 On the contrary, the inventors conceived of the claimed subject matter may also be embodied in other ways, to include along with other existing or future technologies or different steps similar to the elements described in this document. 此外,尽管这里可使用术语“步骤”来意味着所用方法的不同方面,但是该术语不应当被解释为隐含本文所公开的各种步骤之中或之间的任何特定次序,除非或除明确描述了各个步骤的次序之外。 In addition, although there may use the term "step" to mean different aspects of the method used, but the term should not be construed as in any particular order implies various steps herein disclosed among or between, unless expressly or in addition to It describes the sequence of individual steps outside.

[0032] 示例计算环境 [0032] Example Computing Environment

[0033] 图1示出了其中可实现本发明的合适计算系统环境100的一个示例。 [0033] Figure 1 shows an example in which the present invention may be a suitable computing system environment 100. 计算系统环境100仅作为合适的计算环境的一个示例,而非旨在对本发明的使用范围或功能提出任何限制。 The computing system environment 100 only as an example of a suitable computing environment and is not intended scope of use or functionality of the invention to suggest any limitation. 计算环境100也不应当被解释为对示例性操作环境100中所示组件的任一个或组合具有任何依赖或要求。 Nor should the computing environment 100 be interpreted as any one or combination of components shown in 100 exemplary operating environment having any dependency or requirement.

[0034] 本发明可与许多其它通用或专用计算系统环境或配置一起运行。 [0034] The present invention may be run with numerous other general purpose or special purpose computing system environments or configurations. 可适合用于本发明的众所周知的计算系统、环境和/或配置的示例包括但不限于:个人计算机、服务器计算机、手持型或膝上型设备、多处理器系统、基于微处理器的系统、机顶盒、可编程消费者电子产品、网络PC、小型机、大型计算机、包括上述系统或设备的任意种类的分布式计算环境等。 May be suitable for use in the present invention is well known computing systems, environments, and / or configurations include, but are not limited to: personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, top boxes, programmable consumer electronics, network PC, a minicomputer, mainframe computers, including any kind of above systems or devices distributed computing environment.

[0035] 可在由计算机执行的诸如程序模块的计算机可执行指令的通用环境中描述本发明。 [0035] may be described in a computer such as a program executed by a computer module executable instructions in the general context of the present invention. 通常,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、 数据结构等。 Generally, program modules include perform particular tasks or implement particular abstract data types of routines, programs, objects, components, data structures, and so on. 也可在其中通过经由通信网络链接的远程处理设备执行任务的分布式计算环境中实践本发明。 Also by practice of the invention in which the processing device to perform tasks via remote communications network link distributed computing environments. 在分布式计算环境中,程序模块和其它数据可位于包括存储器存储设备的本地或远程计算机存储介质中。 In a distributed computing environment, program modules and other data may be located in both local and remote computer storage media including memory storage devices.

[0036] 参看图1,用于实现本发明的示例性系统包括计算机110形式的通用计算设备。 [0036] Referring to Figure 1, an exemplary system for implementing the present invention include 110 in the form of a general purpose computing device. 计算机Iio的组件可包括但不限于:处理单元120 ;系统存储器130 ;以及将包括系统存储器 Iio computer components may include, but are not limited to: a processing unit 120; a system memory 130; and including the system memory

6在内的各种系统元件耦合到处理单元120的系统总线121。 6, including the various system components coupled to the processing unit 120. The system bus 121. 系统总线121可以是若干类型总线结构中的任意一种,包括存储器总线或存储器控制器、外围总线以及使用各种总线体系结构中的任一种的局域总线。 The system bus 121 may be any of several types of bus structures any one, including a memory bus or memory controller, a peripheral bus, and a variety of bus architectures using any of a local bus. 作为示例而非限制,这些架构包括工业标准结构(ISA)总线、微通道结构(MCA)总线、增强型ISA(EISA)总线、视频电子标准协会(VESA)局部总线、 以及也称为附夹板(Mezzanine)总线的外设部件互连(PCI)总线。 By way of example and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and also known as attachment jaws ( Mezzanine) Bus Peripheral Component Interconnect (PCI) bus.

[0037] 计算机110通常包括各种计算机可读介质。 [0037] Computer 110 typically includes a variety of computer readable media. 计算机可读介质可以是可由计算机110访问的任何可用介质,包括易失性和非易失性介质、可移动和不可移动介质。 Computer readable media can be any available media that can be accessed by computer 110 and includes both volatile and nonvolatile media, removable and non-removable media. 作为示例而非限制,计算机可读介质可包括计算机存储介质和通信介质。 By way of example and not limitation, computer readable media may comprise computer storage media and communication media. 计算机存储介质包括以存储诸如计算机可读指令、数据结构、程序模块或其它数据的信息的任意方法和技术实现的易失性和非易失性、可移动和不可移动介质。 Computer storage media includes storage such as computer readable instructions, data structures, program modules, or any other information on the methods and techniques to achieve data volatile and nonvolatile, removable and non-removable media. 计算机存储介质包括但不限于:RAM、ROM、 EEPR0M、闪存或其它存储器技术、CD-ROM、数字多功能盘(DVD)或其它光盘存储、磁带盒、磁带、磁盘存储器或其它磁存储设备、或者可被用来存储所需信息并可由计算机110访问的任意其它介质。 Computer storage media include, but are not limited to: RAM, ROM, EEPR0M, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or It may be used to store the desired information and which can accessed by the computer 110 from any other medium. 通信介质通常以诸如载波或其它传送机制的已调制数据信号的方式体现计算机可读指令、数据结构、程序模块或者其它数据,并且包括任意信息传输介质。 Communication media typically a carrier wave or other transport mechanism, such as the way a modulated data signal embodied computer readable instructions, data structures, program modules, or other data, and includes any information delivery media. 术语“已调制数据信号”是指以在信号中编码信息的方式设置或改变其特性中的一个或多个的信号。 The term "modulated data signal" refers to encode information in the signal set or changed in a manner in which one or more characteristics of a signal. 作为示例而非限制,通信介质包括诸如有线网络或直接线连接的有线介质、以及诸如声波、 RF、红外线和其它无线介质的无线介质。 By way of example and not limitation, communication media includes wired media such as a wireless media wired network or direct-wired connection, as well as acoustic, RF, infrared and other wireless media. 以上任一种组合应当也可被包括在计算机可读介质的范围内。 A combination of any of the above should also be included within the scope of computer-readable media.

[0038] 系统存储器130包括诸如只读存储器(ROM) 131和随机存取存储器(RAM) 132的易失性和/或非易失性存储器形式的计算机存储介质。 [0038] The system memory 130 includes memory such as read only (ROM) 131 and random access memory (RAM) 132 volatile and / or nonvolatile memory in the form of computer storage media. 包含有助于诸如在启动期间在计算机110内的元件之间传递信息的基本例程的基本输入/输出系统(BIOS) 133通常被存储在ROM 131中。 It contains information to help, such as during start within computer 110 basic routines that communicate basic information input / output system (BIOS) 133 is typically stored in ROM 131 in between the elements. RAM 132通常包含可由处理单元120立即访问和/或当前正操作的数据和/或程序模块。 RAM 132 typically contains a processing unit 120 may be immediately accessible to and / or data and / or program modules that are currently being operated. 作为示例而非限制,图1示出了操作系统134、应用程序135、其它程序模块136 和程序数据137。 By way of example and not limitation, Figure 1 illustrates operating system 134, application programs 135, other program modules 136, and program data 137.

[0039] 计算机110也可包括其它可移动/不可移动、易失性/非易失性计算机存储介质。 [0039] The computer 110 may also include other removable / non-removable, volatile / non-volatile computer storage media. 仅作为示例,图ι示出了对不可移动的非易失性磁性介质读写的硬盘驱动器140、对可移动的非易失性磁盘152读写的磁盘驱动器151、以及对诸如CD ROM或其它光学介质的可移动的非易失性光盘156读写的光盘驱动器155。 Only as an example, Figure ι illustrates a non-removable, nonvolatile magnetic media hard disk drives to read and write 140, removable nonvolatile magnetic disk 152 151 disk drives to read and write, as well as a CD ROM or other CD-ROM drive removable non-volatile read-write optical media disc 156 155. 可被用在示例性操作环境中的其它可移动/不可移动、易失性/非易失性计算机存储介质包括但不限于:磁带盒、闪存卡、数字多功能盘、 数字录像带、固态RAM、固态ROM等。 Can be used in the exemplary operating environment other removable / non-removable, volatile / nonvolatile computer storage media include, but are not limited to: magnetic tape cassettes, flash memory cards, digital versatile disks, digital video tape, solid state RAM, solid state ROM, and the like. 硬盘驱动器141通常经由诸如接口140的不可移动存储器接口连接到系统总线121,而磁盘驱动器151和光盘驱动器155通常经由诸如接口150 的可移动存储器接口连接到系统总线121。 Hard disk drive 141 is typically via a non-removable memory interface such as interface 140 is connected to the system bus 121, and magnetic disk drive 151 and optical disk drive 155 are typically such as interface 150 via a removable memory interface connected to the system bus 121.

[0040] 以上讨论并在图1中示出的驱动器以及与它们相关联的计算机存储介质为计算机110提供了对计算机可读指令、数据结构、程序模块和其它数据的存储。 [0040] drives discussed above and illustrated in FIG. 1 and the computer 110 provides a computer-readable instructions, data structures, program modules and other data with their associated computer storage media is. 例如,在图1中, 硬盘驱动器141被示为存储操作系统144、应用程序145、其它程序模块146以及程序数据147。 For example, in Figure 1, the hard disk drive 141 is illustrated as storing operating system 144, application programs 145, other program modules 146, and program data 147. 注意:这些组件可与操作系统134、应用程序135、其它程序模块136和程序数据137 相同或不同。 Note: These components 134, application programs and the operating system 135, other program modules 136, and program data 137 are the same or different. 这里,操作系统144、应用程序145、其它程序模块146和程序数据147被赋予不同附图标记,以便说明至少它们是不同的副本。 Here, the operating system 144, application programs 145, other program modules 146, and program data 147 are given different reference numerals to illustrate that they are at least different copies. 用户可通过诸如键盘162和通常指的是鼠标、跟踪球或触摸板的定点设备161向计算机20输入命令和信息。 Users can such as a keyboard 162 and generally referred to as mouse, trackball or touchpad pointing device 161 20 enter commands and information into the computer. 其它输入设备(未示 Other input devices (not shown

7出)可包括麦克风、操纵杆、游戏手柄、圆盘式卫星天线、扫描仪等。 7) may include a microphone, joystick, game pad, satellite dish, scanner, and so on. 这些和其它输入设备常常经由耦合于系统总线的用户输入接口160连接到处理单元120,但也可通过诸如并行端口、游戏端口或通用串行总线(USB)的其它接口和总线结构连接。 These and other input devices often via the user input interface 160 coupled to system bus 120 is connected to the processing unit, but can also be such as a parallel port, game port or a universal serial bus (USB) interface and bus structures other connections. 监视器191或其它类型的显示设备也经由诸如视频接口190的接口连接到系统总线121。 A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190. 除监视器之外,计算机还可包括诸如扬声器197和打印机196的其它外围输出设备,它们可经由输出外围接口190 连接。 In addition to the monitor, computers may also include other peripheral such as speakers 197 and printer output device 196, which may be connected through an output peripheral interface 190.

[0041] 计算机110可工作在使用到诸如远程计算机180的一个或多个远程计算机的逻辑连接的网络化环境中。 [0041] The computer 110 may operate in a networked environment, such as the use to one or more remote computers remote computer 180. The logical connection. 远程计算机180可以是个人计算机、服务器、路由器、网络PC、对等设备或其它公共网络节点,并且通常包括以上就计算机110所描述的组件中的许多或所有组件,尽管图1仅示出了存储器存储设备181。 The remote computer 180 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the components on the above described components of the computer 110, although Figure 1 shows only a memory storage device 181. 图1中所示的逻辑连接包括局域网(LAN)171 和广域网(WAN) 173,但也可包括其它网络。 Logical connections shown in Figure 1 comprises a local area network (LAN) 171 and a wide area network (WAN) 173, but may also include other networks. 这些网络环境在办公室、企业范围计算机网络、 内联网和因特网中是普遍的。 These network environments are common in offices, enterprise-wide computer networks, intranets and the Internet.

[0042] 当用在LAN网络环境中时,计算机110经由网络接口或适配器170连接到LAN 171。 [0042] When used in a LAN networking environment, the computer 110 is connected via a network interface or adapter 170 to the LAN 171. 当用在WAN网络环境中时,计算机110通常包括调制解调器172或在诸如因特网的WAN 173上建立通信的其它装置。 When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. 或为内置式或为外置式的调制解调器172可经由用户输入接口160或其它适当的机制连接到系统总线121。 Or a built-in or enter 160 or other appropriate mechanism connected to the system bus 121 via an external modem 172 users. 在网络化环境中,关于计算机110所述的程序模块或其一部分可被存储在远程存储器存储设备中。 In a networked environment, about 110 of the computer program modules or portions thereof may be stored in a remote memory storage device. 作为示例而非限制,图1将远程应用程序185示为驻留在存储器设备181上。 By way of example and not limitation, Figure 1 illustrates remote application programs 185 as residing on memory device 181. 应当理解,所示网络连接仅是示例性的,并且也可使用在计算机之间建立通信链接的其它装置。 It should be appreciated that the network connections shown are merely exemplary, and other means may be used to establish a communications link between the computers.

[0043] 示例实施例 [0043] Example Example

[0044] 在以下的讨论中,认为关于代码仿真和二进制翻译的细节对于本领域技术人员是公知的。 [0044] In the following discussion that the details about the code emulation and binary translation of the skilled person is well known. 因此,为了清晰和说明的目的,这里很大程度上略去了这些细节。 Thus, for purposes of illustration and clarity, these details are omitted here, to a large extent. 另外,这里使用涉及游戏软件上下文中的图形渲染的示例实施例仅为了说明的目的,而非旨在将本发明限于任何这种实施例。 In addition, the example used here relates to game software graphics rendering context examples for illustrative purposes only and are not intended to limit the invention to any such examples.

[0045] 本发明的实施例选择性地组合JIT翻译和预编译技术以在软件应用程序的代码执行期间避免暂停。 Example [0045] The present invention is selectively combined translation and pre-JIT compiler technology to during execution of the software application's code to avoid suspension. 可对这种代码的仿真二进制码执行预引导扫描,以检测该二进制码内的复杂函数。 May perform pre-boot scan this code emulation binary code to detect complex functions within the binary code. 在软件的引导过程期间,实施例预编译检测到的复杂函数。 During the boot process software Example precompiled detected complex functions. 在运行时,JIT翻译技术用于二进制码的其它部分,而可直接执行经预编译的函数而无需进一步的翻译。 At run time, JIT translation technology used in other parts of binary code, and can be executed directly through pre-compiled function without further translation. 另外,在此预引导扫描期间,实施例可检测极简单函数,并选择性地将它们重新定位到代码的主体(在这里称为“内联”的过程)。 In addition, during this pre-boot scan, an embodiment may detect very simple function, and selectively repositioning them to the body of code (referred to herein as "inline" process). 在运行时,可避免将否则执行函数所必需的上下文切换。 At run time, you can avoid the context switch function otherwise necessary.

[0046] 对实施例的预引导扫描可增加执行初始引导过程所需的时间量。 [0046] The amount of time for pre-boot scan embodiment increase required to perform the initial boot process. 然而,由于可选择性地实施预编译和内联操作,所以引导时间的增加可被控制成保持在可接受的限度内。 However, since the selectively embodiment precompiled and inline operation, so the increase in boot time can be controlled to be kept within acceptable limits. 因而,可改进代码执行以在不用过分延长应用的引导时间的情况下避免显著的暂停。 Thus, the code can be improved without excessively performed to extend the application at boot time, while avoiding significant pause.

[0047] 现在参看图2,它示出了实施例的示例方法200。 [0047] Referring now to Figure 2, which shows an exemplary embodiment of a method 200. 在步骤201,例如扫描诸如视频游戏的中间二进制码的仿真代码。 At step 201, e.g., as an intermediate binary code scanning simulation code video games. 可使用任何类型的扫描机制。 You can use any type of scanning mechanism. 例如,在2005年5月12 日提交的、题为"Function-Level Just-in-Time Translation Engine withMultiple Pass Optimization(具有多遍优化的函数级及时时翻译引擎)的共同转让的美国申请No. 11/128,699描述了这样一种扫描方法,该申请通过引用全部结合于此。扫描可涉及例如根据对于本领域技术人员而言应知的相对指令移置技术来在整个仿真代码流中移动指令指针等。当扫描在整个仿真代码中进行时,确定函数边界以确立仿真代码内的每个函数的复杂度。这里所用的术语“复杂度”指编译和/或执行函数所需的处理时间或资源的任何量度。例如,可根据函数大小(例如,代码行的数量等)、处理难度等来测量复杂度。对涉及通过函数指针或绝对寻址的另一形式来引用的函数的实例,可使用对这些函数的二进制专用引用来使以下的步骤211的预编译能够进行。 For example, in May 12, 2005 submission, entitled "Function-Level Just-in-Time Translation Engine withMultiple Pass Optimization (having many times when the function level optimization timely translation engine) commonly assigned U.S. Application No. 11 / 128,699 describes a scanning method, which application is incorporated herein by reference in its entirety. scans can involve, for example according to the skilled artisan should know relatively displacing technology instruction to move the instruction pointer in the entire simulation code stream etc. When the scan code in the simulation, it is determined to establish the complexity of the function boundary of each function within the simulation code. As used herein, the term "complexity" refers to the processing time to compile and / or perform functions or resources needed Any measure, for example, can be measured according to the complexity of the function size (for example, the number of lines of code, etc.), the process difficult, etc. For example relates to the function through a function pointer or another form of addressing to absolute references, you can use Binary dedicated to these functions to make a reference to the steps 211 can be precompiled.

[0048] 在完成步骤201的扫描之后,在步骤203,就是否检测到一个或多个复杂函数作出判定。 [0048] After the scan is complete step 201, in step 203, it is detected by one or more complex functions determination is made. 如上所述,什么构成“复杂”函数可基于任何准则。 As mentioned above, what constitutes a "complex" function can be based on any criteria. 另外,可选择预定阈值,从而仅超出该阈值的函数被判定为复杂。 Further, the predetermined threshold value be selected so that only function exceeds the threshold value is determined to be complex. 如上所述,预定阈值可按照代码行作出。 As described above, the predetermined threshold may be made in accordance with the line of code. 因而,如果函数包含比阈值代码行数目多的代码行,则函数被判定为复杂。 Thus, if the function contains more lines of code than the threshold number of lines of code, the function is determined to be complicated. 阈值可基于任何数量的因素来预先确定。 Threshold may be determined in advance based on any number of factors. 例如,以下将讨论的步骤205的预编译可增加应用程序的总启动时间。 For example, the following steps will be discussed in the total start-up time can be increased 205 pre-compiled applications. 开发员等可能希望将由于这些预编译而导致的启动时间的增加保持在某一限度内。 Developer, etc. may be desirable to increase due to the result of these pre-compiled startup time is kept within certain limits. 因而,例如可选择阈值以便可在该时间限度内预编译尽可能多的被判定为复杂的函数。 Thus, for example, be selected so that the threshold value can be pre-compiled within the time limit as much as possible is determined to be a complex function.

[0049] 如果步骤203的判定结果为没有函数是复杂的,则方法200可前进到任选步骤207。 [0049] If the determination in step 203 is no function is complicated, the method 200 may proceed to optional step 207. 如果步骤203的判定结果为一个或多个函数是复杂的,则在步骤205编译这些复杂函数——这在此处被称为“预编译”,因为此编译发生在执行代码之前(以及在任何JIT翻译之前)。 If the decision result in step 203 for one or more functions are complex, then in step 205 to compile these complex functions - this is called "pre-compiled" in here, because this compilation occurs before the execution of code (and in any Before JIT translation). 根据实施例,一旦已根据步骤205对函数进行预编译,则它即准备好被执行而无需进一步进行处理。 According to an embodiment, once it has been pre-compiled based on step 205 to the function, it is ready to be executed without further processing.

[0050] 在任选步骤207,就是否检测到一个或多个“简单”函数作出判定。 [0050] In optional step 207, it is detected by one or more "simple" function to make decisions. 与复杂函数的情形一样,什么构成简单函数可基于任何准则。 And the case of complex functions, like what constitutes a simple function can be based on any criteria. 例如,简单函数可被定义为代码行数目比阈值数目小的子例程。 For example, a simple function can be defined as the number of lines of code than the threshold a small number of subroutines. 例如,可基于与执行子例程所需的处理时间相比的上下文切换所需的处理时间来选择阈值。 For example, based on the processing time compared with the processing time required to execute a subroutine of context switches to select the desired threshold. 还可考虑附加的因素,包括专用程序应用因素。 Also consider additional factors, including the special program application factor.

[0051] 例如,特定的子例程的代码行数目可能小于阈值数目,但可能在整个应用程序代码中出现众多次。 [0051] For example, the number of lines of code specific subroutine may be less than the threshold number, but there may be a number of times throughout the application code. 函数的内联可涉及本质上将该函数内的代码行拷贝到代码的主体来替代相应的函数调用。 Inline functions may involve essentially a copy of this line of code to the body of code within the function to substitute the appropriate function calls. 因而,在执行期间,函数代码可被内联编译或执行而无需与该代码所起源的子例程来回上下文切换。 Thus, during execution, inline function code can be compiled or executed without the subroutine code originated context switch back and forth. 这样的拷贝由于所复制的数据而可增加应用程序的总大小。 Because of this copy of the replicated data and to increase the total size of the application. 结果,在应用程序中出现众多次的子例程可需要进行如此多的复制,以致因内联函数所获得的处理好处可能由于增加的存储需求、内联大量函数所需的过多的处理时间等而抵销。 As a result, it appears numerous times in the application subroutines may need to be copied so much so that the process benefits obtained due to an inline function may be due to the increased storage needs, too much processing time required for inline large number of functions like offset. 结果,这些函数可能不被判定为简单,即使它们根据阈值是合格的。 As a result, these functions may not be judged to be simple, even if they are qualified in accordance with the threshold value.

[0052] 在任选步骤207,如果一个或多个函数被确定为简单,则在任选步骤209,函数被与应用程序代码的主体内联放置。 [0052] In an optional step 207, if one or more of the function is determined to be simple, at optional step 209, the function is placed within the body associated with the application code. 如上所述,内联放置代码可能需要从子例程等拷贝代码并使用该子例程代码来替代在主体中的相应的函数调用。 As described above, placed inline code may need to copy the code from the subroutine, etc. and use the subroutine code to replace in the main body of the respective function call. 图4A-B示出了将在以下讨论的内联放置函数的效果的图示。 Figure 4A-B shows will be discussed below placed inline function effects icon. 如果步骤207的判定是在任选步骤207没有函数被判定为简单,则方法200直接前进到步骤211。 If the determination in step 207 is an optional step 207 is determined to be not a simple function, then the method 200 proceeds directly to step 211.

[0053] 在步骤211,仿真代码的JIT翻译通过运行时引擎等连同代码的执行一起进行。 [0053] in conjunction with step 211, the simulation code JIT translation by the runtime engine, etc., along with the code in. 如上所述,因为复杂函数已在步骤205被预编译,这些函数不需要在步骤211翻译,并且可被直接执行。 As noted above, because of the complex function has been precompiled in step 205, these functions do not require translation in step 211, and can be executed directly. 另外,对在步骤209被内联放置的任何函数,无需执行上下文切换。 In addition, any function in step 209 is placed inline, without having to perform a context switch.

[0054] 如上所述,用于判定函数是复杂还是简单的(由此该函数分别应当被预编译还是内联放置)阈值和因素可基于各种因素,包括但不限于应用程序的所期望的引导时间。 [0054] As described above, for determining the function is complex or simple (and thus the function should be precompiled or inline placed respectively) threshold and factor may be based on various factors, including, but not limited to the application of the desired boot time. Because

9而,应当理解,实施例允许开发员等来确定由此预编译和/或内联导致的运行时好处与引导时间的相应增加之间的可接受的折衷。 9, it should be understood that the embodiment allows developers to determine the like between acceptable and thus precompiled / corresponding increase in benefits and boot times due to run inline or compromise.

[0055] 图3表示根据实施例的示例代码流程。 [0055] Figure 3 shows an example embodiment of the code flow. 函数310a-d表示应用程序的虚拟代码的主体300内的函数。 Function 310a-d denotes a function application's virtual code 300 within the body. 在运行时期间,函数310a使用JIT翻译进程320a来翻译。 During the operation, the function 310a 320a using JIT translation process to translate. 代码流程由从函数310a通向JIT翻译进程320a的箭头A来表示,接着,一旦JIT翻译进程320完成,箭头B指示随后执行函数310a。 Code 310a from a function by a process leading to an arrow A 320a JIT translation process to represent, then, once the JIT translation process 320 is completed, then performs the function indicated by arrow B 310a. 然后,仿真二进制码经由箭头C前进到函数310b。 Then, simulation of binary code to advance to the function 310b via arrow C. 函数310b还按箭头A表示由进程320b进行JIT翻译,并且按箭头B表示来执行。 310b also function represented by the arrow A JIT translation process 320b conduct, and the arrow B indicates to execute. 然而,一旦二进制到达预编译函数310c,则无需JIT翻译,因为已根据例如图2的步骤205进行了翻译的预编译函数310c准备好被执行。 However, once the reach the pre-compiled binary function 310c, it does not have JIT translation, because it has been based on for example, step 205 of FIG. 2 translation of pre-compiled function 310c is ready to be executed. 这些对于预编译函数310d也是成立的。 These pre-compiled function for 310d is also true. 因而,可了解到图3提供了根据实施例可能发生的经更改的JIT翻译进程的图示。 Thus, we can understand that Figure 3 provides JIT translation process according to example embodiments may occur by the change of the illustration.

[0056] 图4A-B根据如上结合以上连同图2的任选步骤209 —起讨论的代码的内联的示例代码流程。 [0056] Figures 4A-B, optionally together with a combination of the above step 209 of FIG. 2 according to the above - discussed within inline code sample code processes. 参看图4A,函数410a-b位于应用程序的主体400内。 Referring to Figure 4A, 410a-b function in the application's main body 400. 如箭头A所示,从函数410a-b分别调用函数子例程420a-b,并且如箭头B所示,子例程420a_b的结果返回到函数410a-b。 As indicated by A, the function 410a-b, respectively function call subroutines 420a-b, and as the results shown by the arrow B, the subroutine returns to the function 420a_b 410a-b. 如可从图4A中了解到,子例程420b被指定为“简单”,这指示例如其代码行数目小于阈值数目,与以上结合图2的步骤207所述的一样。 As can be learned from FIG. 4A, the subroutine 420b is designated as "simple", which indicates for example the number of lines of code threshold value which is smaller than the number, in conjunction with the above step 207 of FIG. 2 as said. 主体400内从函数410a到410b的代码流程由箭头C来表示。 400 from the main body function code flow 410a to 410b is represented by an arrow C.

[0057] 现在参看图4B,函数410a和子例程420a与以上结合图4A所讨论的一样。 [0057] Referring now to Figure 4B, the function subroutines 410a and 420a as discussed above in connection with Figure 4A. 然而, 可见,函数410b不包含对子例程420b的调用。 However, we can see, the function does not include sub-routine calls 410b and 420b. 相反,函数410b前进到已被放置在代码的主体400中的子例程420b。 On the contrary, the function 410b proceeds to have been placed in the main code 400 subroutine 420b. 因而,为子例程420b避免了由箭头A和B指示的调用和返回。 Therefore, in order to avoid a subroutine call and return 420b by arrows A and B instructions. 子例程420'表示由于其代码已被拷贝到代码的主体400而未被使用的原始子例程420b所占据的存储器。 Subroutine 420 'said that due to its code has been copied to the main code 400 and unused original subroutine 420b occupied memory.

[0058] 虽然已结合各个附图的实施例描述了本发明,但是应当理解,可使用其它类似实施例,而且可对所述实施例作出更改和附加以执行本发明的相同功能而不与之背离。 [0058] Although embodiments of the various figures in conjunction invention has been described, it should be understood that other similar embodiments may be used, and can make the changes and additional embodiments of the present invention to perform the same function without contrast divergences. 因此, 本发明不应当限于任何单个实施例,而相反应当根据所附权利要求的广度和范围来解释。 Thus, the present invention should not be limited to any single embodiment, but on the contrary should be based on the breadth and scope of the appended claims be interpreted.

Classifications
International ClassificationG06F9/45
Cooperative ClassificationG06F9/45504, G06F9/45516
European ClassificationG06F9/455B4
Legal Events
DateCodeEventDescription
6 Aug 2008C06Publication
1 Oct 2008C10Request of examination as to substance
8 Dec 2010C14Granted
13 Aug 2014C17Cessation of patent right