WO2012045238A1 - 一种移动设备上应用程序的启动方法及装置 - Google Patents
一种移动设备上应用程序的启动方法及装置 Download PDFInfo
- Publication number
- WO2012045238A1 WO2012045238A1 PCT/CN2011/071142 CN2011071142W WO2012045238A1 WO 2012045238 A1 WO2012045238 A1 WO 2012045238A1 CN 2011071142 W CN2011071142 W CN 2011071142W WO 2012045238 A1 WO2012045238 A1 WO 2012045238A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- jit
- startup process
- module
- code
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44578—Preparing or optimising for loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
- G06F9/45516—Runtime code conversion or optimisation
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for starting an application on a mobile device. Background technique
- Java application an application developed using the Java language on a mobile device currently used may be referred to as a Java application, and has the advantages of good portability, one-time compilation and operation, low development difficulty, high development efficiency, and low development cost. Since the Java language is an interpreted language, its execution efficiency is relatively low, so Java applications will experience severe slow startup problems.
- One of the methods is to optimize the Java application according to its own processing logic, and use lazy loading and lazy initialization to speed up the startup. The effectiveness of this method. It is only applicable to a single Java application itself, and its methods are closely related to the characteristics of Java applications.
- Another method is to use pre-launch, pre-load, pre-initialize, and copy-on-write in the mobile software platform. COW), application processes are cached on exit, etc. to speed up the startup of Java applications. This method speeds up the startup of all Java applications and does not require any modification by the application.
- JIT Just in Time
- JIT is a timely compilation mechanism that compiles Java code into native language to avoid interpretation and execution, thus greatly improving the speed of Java applications.
- the existing JIT is to execute the code in the Java application to a certain number of times before the code is compiled into the local language to execute; in addition, the JIT compilation result is discarded as the Java application exits, the Java application There is no JIT compilation result that can be used when running again, and it needs to be compiled again during this run. Since the application startup process is only executed once when the application is launched, this causes the Java application startup process to not be accelerated with JIT.
- JIT does not compile code that is executed only once, and Java application startup is the beginning of the Java application running again, and no JIT compilation results can be executed. Therefore, the prior art JIT cannot improve the startup speed of Java applications. Similarly, applications developed on mobile devices using other interpreted languages with JIT compilation mechanisms will encounter the same problem.
- the present invention discloses a method and an apparatus for starting an application on a mobile device, which can improve the startup speed of an application on the mobile device.
- the present invention provides an apparatus for starting an application on a mobile device, including an application manager module, a virtual machine module, and a memory management module;
- the application manager module is configured to start a virtual machine module operation based on an application to be run, and control the virtual machine module to execute the application code;
- the virtual machine module is configured to invoke the memory management module to separately load the application code and the JIT compilation result of the startup process of the application into the memory, and execute each segment
- the application starts the process code segment the local JIT compiled code corresponding to the startup process code segment to be executed is searched in the JIT compilation result, and the found local JIT compiled code is executed; the memory management module is used by The JIT compilation result obtained by saving and reading the application code and the JIT compilation of the startup process of the application, the JIT compilation result includes the JIT compiled code corresponding to each piece of the startup process code segment that has been JIT compiled.
- the invention also provides a method for starting an application on a mobile device, comprising:
- the application manager module starts the virtual machine module operation based on the application to be run, and controls the virtual machine module to execute the application code;
- the virtual machine module calls the memory management module to respectively load the application code and the JIT compilation result of the startup process of the application into the memory, and execute the JIT compilation result when executing the startup process code segment of each segment of the application. Find the local JIT compiled code corresponding to the startup process code segment to be executed, and execute the found local JIT compiled code.
- the application manager module starts the operation of the virtual machine module based on the application to be run, and the virtual machine module calls the memory management module respectively.
- the startup process code segment of each segment of the application the localization corresponding to the startup process code segment to be executed is searched in the JIT compilation result.
- the JIT compiles the code and executes the local JIT compiled code that is found.
- the corresponding JIT local compilation result can be executed without explanation for the startup process code segment to be executed, thereby improving the startup speed of the application.
- 1 is a schematic structural diagram of an apparatus for starting an application on a mobile device according to an embodiment of the present invention
- 2 is a schematic flowchart of a method for starting an application on a mobile device according to an embodiment of the present invention
- FIG. 3 is a logical structural diagram of a Java application startup device in an Android mobile phone software platform according to an embodiment of the present invention
- FIG. 4 is a schematic flowchart of a method for starting an activity in an Android mobile phone platform software according to an embodiment of the present invention. detailed description
- the basic idea of the present invention is: an application manager module for starting a virtual machine module operation based on an application to be run; a virtual machine module, a JIT compilation result for loading the application code, and an application startup process to In the memory, when executing the startup process code segment of each segment of the application, searching for the local JIT compiled code corresponding to the startup process code segment to be executed in the JIT compilation result, and executing the found local JIT compiled code; A memory management module for saving and reading application code and JIT compilation results obtained after JIT compilation of the application startup process.
- an embodiment of the present invention provides an apparatus and method for starting an application on a mobile device.
- FIG. 1 is a schematic structural diagram of an apparatus for starting an application on a mobile device according to an embodiment of the present invention.
- an apparatus for starting an application on the mobile device includes: an application manager module 101, a virtual machine module 102, and a memory. Management module 103; wherein
- An application manager module 101 configured to start the virtual machine module 102 based on the application to be run, and control the virtual machine module 102 to execute the application code;
- the virtual machine module 102 is configured to invoke the memory management module 103 to respectively load the application code and the JIT compilation result of the startup process of the application into the memory, and execute the JIT compilation when executing the startup process code segment of each segment of the application. Finding the local JIT compiled code corresponding to the startup process code segment to be executed in the result, and executing the found local JIT compiled code;
- the memory management module 103 is configured to save and read the application code, and the JIT compilation result obtained by performing JIT compilation on the startup process of the application, where the JIT compilation result includes a segment of the startup process code segment that has been JIT compiled. JIT compiled code.
- the launching device of the application on the mobile device may further include a JIT compiler module 104, where:
- the virtual machine module 102 is further configured to notify the JIT compiler module 104 to perform JIT on the startup process code segment to be executed when the local JIT compiled code corresponding to the startup process code segment to be executed is not found in the JIT compilation result. Compile and execute the startup process code to be executed in an interpreted manner;
- the JIT compiler module 104 is configured to perform JIT compilation on the startup process code segment to be executed when the memory space allocated by the virtual machine module 102 has a remaining space according to the notification of the virtual machine module 102.
- the JIT compiler module queries whether the memory space allocated when configuring the virtual machine module 102 has enough space to save the compiled code of the startup process code segment to be executed, if any If there is enough space to save, JIT will be compiled for the startup process code segment to be executed; otherwise, the startup process code segment to be executed will be discarded.
- the application manager module 101 is configured to obtain identification information of the application to be run, and transmit the acquired identification information of the application to the virtual machine module 102 while the virtual machine module 102 is started to run.
- the identifier information of the application controls the virtual machine module to execute the application code;
- the virtual machine module 102 is configured to invoke the memory management module 103 to load the application code and the application respectively according to the identification information of the application.
- the first segment startup process code segment of the application is obtained; and the local JIT compiled code corresponding to the first segment startup process code segment currently being executed is searched in the JIT compilation result, and When the local JIT compiled code corresponding to the code segment is found, the found local JIT compiled code is executed, and when the local JIT compiled code corresponding to the code segment is not found, the JIT compiler module is notified to the application.
- the code segment currently to be executed is JIT compiled, and the code segment is executed in an interpreted manner; if the startup process of the application is not executed, the startup process of the application to be executed next is determined according to the execution result of the code segment. The code segment, and returns to the previous step, until the execution of the application's startup process ends.
- the startup process code segment involved in the embodiment of the present invention may include one code or multiple pieces of code, which is specifically determined by a JIT compiler supported by the system executing the application.
- a JIT compiler supported by the system executing the application.
- the virtual machine module searches for the JIT compilation result in the JIT compilation result file and executes the JIT compiled code corresponding to the code segment, when the JIT compiled code is executed, it is equivalent to a piece of code that has executed the code as a starting point.
- the code to be executed in the next paragraph can be determined based on the result of the compilation performed by the execution.
- the identification information of the application may include a program name, a software package name, and the like of the application.
- the application manager module 101 can also be used to determine whether the JIT compilation is performed during the execution process of the application startup process after the execution process of the confirmation application is finished, and when the determination result is yes,
- the JIT compiled code corresponding to the startup process of the application is obtained from the JIT compiler module 104, and the JIT compiled code is passed to the memory management module 103, and the memory management module 103 can be used for the JIT of the startup process of the received application.
- the compiled code is saved in the specified external memory.
- the memory management module 103 starts the JIT compiled code of the process code segment and saves it in the external memory in a certain format during the startup process of the received application.
- the application involved in the embodiment of the present invention may be a Java application. also may It is an application developed by other interpreted languages with JIT compilation mechanism.
- the save format of the JIT compilation result saved by the storage manager may be a table, as shown in Table 1, the keyword of the table is the startup process code of the application compiled by the JIT in the application.
- the location in the code, the content of the table is the location of the local JIT compiled code obtained after the JIT compilation of the application's startup process code.
- the location of the first JIT compiled code in the code segment of the compiled code segment is used as a key to query the location of the local JIT compiled code. Therefore, the compilation result corresponding to the code address in the compilation result table may be not only the compilation result of the code, but also the compilation result of a piece of code starting from the code.
- the keyword when the keyword is 100, it indicates that the content is the storage location of the local JIT compiled code obtained after the JIT compilation of the startup process code starting from 100 in the code of the application; similarly, when the keyword is 340, Indicates that the content is the location of the local JIT compiled code obtained after the JIT compilation of the startup process code starting from 340 in the code of the application; when the keyword is 800, the content is the start of the application in the code of the application. The location where the process code is JIT compiled and the local JIT compiled code is stored.
- the JIT compilation results are saved in a tabular manner because they are compared in this way. It is easy to find the code of the startup process of the application to be executed and its corresponding JIT compilation result, and this method is easy to maintain, and is also a relatively common storage method.
- the application manager module 101 is further configured to notify the virtual machine module 102 after the execution of the startup process of the confirmation application ends, and the virtual machine module 102 is further configured to: after learning that the startup process of the application is completed, Determining whether JIT compilation is performed during execution of the startup process of the application, and when the determination result is YES, acquiring JIT compiled code corresponding to the startup process of the application from the JIT compiler module 104, and passing the JIT compiled code
- the memory management module 103 is configured to save the JIT compiled code of the startup process of the received application in a specified external memory.
- the application manager module 101 is further configured to notify the JIT compiler module 104 after the execution of the startup process of the confirmation application ends, and the JIT compiler module 104 is further configured to: after learning that the startup process of the application is completed Determining whether the JIT compilation is performed during the execution process of the application, and when the determination result is YES, passing the JIT compiled code to the memory management module 103; the memory management module 103 is specifically configured to receive the received application.
- the JIT compiled code of the program's startup process is saved in the specified external memory.
- the embodiment of the present invention further provides a method for starting an application on a mobile device.
- the principle of solving the problem is similar to the startup device of the application. Therefore, the implementation of the method can be implemented by referring to the implementation of the device. It will not be repeated here.
- FIG. 2 is a schematic flowchart of a method for starting an application on a mobile device according to an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
- the application manager module starts a virtual machine module operation based on the application to be run, and controls the virtual machine module to execute the application code.
- the virtual machine module calls the memory management module to respectively load the application code and the JIT compilation result of the application startup process into the memory, and execute the startup process code segment of each piece of the application in the JIT compilation result. Find the startup process code to be executed The local JIT compiled code corresponding to the segment, and the local JIT compiled code found is executed.
- the method for starting the application on the mobile device may further include: when the virtual machine module does not find the local JIT compiled code corresponding to the startup process code segment to be executed in the JIT compilation result, The JIT compiler module performs JIT compilation on the startup process code segment to be executed, and executes the startup process code to be executed in an interpreted manner; and the JIT compiler module confirms the configuration according to the notification of the virtual machine module When there is remaining space in the memory space divided by the virtual machine module, JIT compilation is performed on the startup process code segment to be executed.
- the application manager module obtains the identifier information of the application to be run, and the identifier information may include the program name and the software package name of the application; and starts the virtual machine module, and simultaneously transmits the obtained identifier information to the virtual
- the machine module controls the virtual machine module to execute the application code by using the identification information.
- the virtual machine module calls the memory management module to load the application code and the JIT compilation result of the application startup process into the memory according to the identification information of the application passed by the application manager module; and obtain the application to be executed.
- the application manager module determines whether the startup process of the application ends. If not, the virtual machine module determines the startup process code segment of the application to be executed according to the execution result of the code segment, and uses it as the current code to be executed. The segment returns to execute the above process of determining whether the currently starting process code segment has a JIT compilation result until the application manager module confirms that the application startup process execution ends.
- the application manager module when the application manager module confirms that the startup process of the application is finished, it is determined whether the JIT compilation is performed during the execution process of the application, and if so, Then, the JIT compiled code corresponding to the startup process of the application is obtained from the JIT compiler module, and the obtained JIT compiled code is passed to the memory management module; the memory management module compiles the JIT of the startup process of the received application. The code is saved in the specified external memory.
- the JIT compilation result can be saved in the same external memory or in different external memories.
- the virtual machine module may be notified; after the execution of the startup process of the application is completed, the virtual machine module determines the startup process of the application. Whether JIT compilation is performed during execution, and when the judgment result is YES, the JIT compiled code corresponding to the startup process of the application is obtained from the JIT compiler module, and the obtained JIT compiled code is passed to the memory management module; The management module saves the JIT compiled code of the received startup process of the application in the specified external memory.
- the JIT compiler module may be notified; the JIT compiler module determines the application after the execution process of the application startup process is completed. Whether the startup process was performed during the execution process
- the JIT is compiled, and when the judgment result is YES, the JIT compiled code is passed to the memory management module; the memory management module saves the received JIT compiled code of the application startup process in the designated external memory.
- the application involved in the embodiment of the present invention may be a Java application.
- a startup method of a Java application on a mobile device belongs to a performance improvement method of a platform class, and does not need to tamper with any Java application, and is applicable to all mobile devices.
- Java-based applications including mobile devices such as MID (Mobile Internet Devices), MP4 (MPEG-4, Moving Picture Expert Group), PSP (Play Station Portable, portable games) Machine) and mobile phones.
- MID Mobile Internet Devices
- MP4 MPEG-4, Moving Picture Expert Group
- PSP Play Station Portable, portable games
- the application of the Android mobile phone software platform is developed in the Java language, and the virtual machine has the JIT function.
- Figure 3 is a logical structure diagram of a Java application launching device in the Android mobile phone software platform.
- the application manager module is divided into two software module entities: an application management server (Activity Manager Service) And the application client (Activity Thread), wherein the ActivityManagerService runs in a separate system process, the ActivityThread runs in the process of the application; the JIT compiler module corresponds to a thread software module entity, runs in the process of the application;
- the management module package install manager (Package Manager), which has corresponding software module entities such as functions/classes and Java virtual machine modules, and they all run in the main thread of the application process.
- an application interface (Activity) in the Android mobile phone software platform is taken as an example for description.
- an Activity can be thought of as a Java application, and the first window of the Activity is displayed to mark its startup.
- the JIT compilation result is stored in a specified external memory in the form of a table.
- the flow diagram of the activity startup method in the Android mobile phone platform software includes the following steps:
- ActivityManagerService creates a new process to run the Activity.
- the new process creates a Java virtual machine module.
- the Java virtual machine module executes the code of the ActivityThread.
- ActivityThread and ActivityManagerService establish a communication connection.
- the ActivityManagerService sends the identification information of the startup process of the activity to be started to the ActivityThread.
- the identifier information of the activity startup process of the ActivityManagerService sent to the ActivityThread includes the name of the Activity and the name of the software package. 5406.
- the ActivityThread passes the identifier information of the received Activity to the Java virtual machine module.
- the Java virtual machine module obtains the JIT compilation result of the code of the activity to be run and the startup process of the Activity from the PackageManager.
- the Java virtual machine module opens the activity code and the startup process of the activity
- JIT compiles the result and reads it into memory
- the Java virtual machine module stores the result of the Activity code and the JIT of the activity's startup process, and stores them in the code (code) storage area and the JIT-cache storage area (JIT cache);
- the PackageManager reads the JIT compilation result of the activity startup process from the specified external memory, and the Java virtual machine module reads the JIT compilation result into the memory.
- the Java virtual machine module obtains the first piece of code from the code storage area as a code segment to be executed currently.
- the Java virtual machine module confirms whether the currently executed code segment has a corresponding JIT compilation result, and if so, executes S412, otherwise, executes S411;
- the Java virtual machine module searches for the JIT compilation result in the JIT-cache storage area by using the location of the code segment currently being executed in the code of the Activity as a key, and if the keyword has corresponding content,
- the content is a pointer to the local JIT compiled code obtained by storing the currently executed code for JIT compilation. According to the pointer, the local JIT compiled code corresponding to the currently executed code can be obtained.
- the Java virtual machine module executes the currently executed code in an interpreted manner, and notifies the JIT compiler module to compile the current code segment to be executed, and sets the JIT compilation startup process identifier to true, and sets the code segment to be executed next. .
- the Java virtual machine module executes the local JIT compiled code corresponding to the currently executed code segment, and sets a code segment to be executed next. 5413.
- the ActivityManagerService confirms whether the start flow end flag of the Activity is true. If yes, execute S415, otherwise execute S414.
- the next section of code sets to be executed (this is the mechanism by the JIT compiler and virtual machine mechanism j ava guaranteed), the next step will be set to be executed
- the code segment acts as the current code segment to be executed.
- ActivityManagerService determines whether the JIT compiler module startup process identifier is true. If true, execute S416, otherwise execute S417.
- ActivityManagerService obtains the JIT compiled compiled code from the JIT compiler module during the activity startup process, and passes it to the PackageManager.
- the PackageManager is saved in the form of the table in the installation directory of the activity.
- the embodiment of the present invention can improve the JIT mechanism, and the code segment executed by the startup process of the Java application can be compiled by the JIT to compile the code, and the JIT compilation result can be saved, thereby solving the maximum startup process of the Java application. Performance bottlenecks improve the startup speed of Java applications.
- an application manager module starts a virtual machine module operation based on an application to be run, and the virtual machine module calls a memory management
- the module respectively loads the application code and the JIT compilation result of the startup process of the application into the memory.
- the local JIT compiles the code and executes the local JIT compiled code that is found, so that when the application is launched, since the JIT compilation result of the startup process code segment to be executed for the application startup process is saved, only Directly execute the corresponding JIT local compilation result, There is no need to interpret the startup process code snippet to be executed, which increases the startup speed of the application.
- the spirit and scope of the invention Thus, it is intended that the present invention cover the modifications and the modifications of the invention
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Description
一种移动设备上应用程序的启动方法及装置 技术领域
本发明涉及通信技术领域, 尤其涉及一种移动设备上应用程序的启动 方法及装置。 背景技术
随着 3G 和智能机时代的来临, 手机等移动设备上的应用程序越来越 多。 用户对手机等移动设备上的应用程序的使用模式具有启动频繁、 每次 使用时间不长的特点, 这对应用程序的启动速度提出了较高要求。 如果应 用程序的启动速度过于緩慢, 用户等待应用程序的启动时间可能跟真正使 用该应用程序的时间相同甚至更多, 这将大大降低手机等移动设备的用户 体验。
例如, 目前常用的移动设备上使用 Java语言开发的应用程序, 可称为 Java应用程序, 具有移植性好、 一次编译运行、 开发难度低、 开发效率高、 开发成本低等优点。 由于 Java语言是解释型语言, 其执行效率比较低, 因 此, Java应用程序会遇到严重的启动速度比较慢的问题。
目前, 提高 Java应用程序的启动速度的方法有很多, 其中, 一类方法 是 Java应用程序根据自身处理逻辑进行优化, 釆用延迟加载和懒惰初始化 等手段来加快启动速度, 这类方法的有效性只适用于单个 Java应用程序本 身, 并且其釆用的手段跟 Java应用程序的特点密切相关; 还有一类方法是 在手机软件平台中, 釆用预先启动、 预先加载、 预先初始化、 写时拷贝 ( COW )、应用进程在退出时进行緩存等来加速 Java应用程序的启动速度, 这类方法对所有 Java应用程序启动速度都能起加速作用, 并且不需要应用 做任何修改。
由于 Java应用程序启动速度的瓶颈在于 Java应用程序是解释执行的 , 因此, 现有方法对提高 Java应用程序的启动速度并没有良好的效果。 JIT ( Just in Time )是一种及时编译机制, 它把 Java代码编译成本地语言来执 行, 避免解释执行, 从而大大提高了 Java应用程序的运行速度。 但是, 现 有的 JIT是要 Java应用程序中的代码执行到一定次数时才会把代码编译成 本地语言来执行; 另外, JIT的编译结果随着 Java应用程序的退出而丟弃, Java应用程序再次运行时没有任何 JIT编译结果可以利用 ,需要在本次运行 过程中再次编译。 由于应用启动流程只在应用程序启动时执行一次, 这就 导致了 Java应用程序启动流程无法利用 JIT获得加速。 因为 JIT不会编译 只执行一次的代码, 同时 Java应用程序启动是 Java应用程序再次运行的开 始阶段, 也没有任何 JIT编译结果可以执行。 因此, 现有技术中 JIT无法提 高 Java应用程序的启动速度。 类似的, 移动设备上使用其它具有 JIT编译 机制的解释型语言开发的应用程序也会遇到同样的问题。
因此,如何利用 JIT来提高应用程序的启动速度成为现有技术中亟待解 决的问题之一。 发明内容
有鉴于此, 本发明公开了一种移动设备上应用程序的启动方法及装置 , 能够提高移动设备上应用程序的启动速度。
为达到上述目的, 本发明的技术方案是这样实现的:
本发明提供一种移动设备上应用程序的启动装置, 包括应用管理器模 块、 虚拟机模块和存储器管理模块; 其中,
所述应用管理器模块, 用于基于要运行的应用程序启动虚拟机模块运 行, 并控制所述虚拟机模块执行所述应用程序代码;
所述虚拟机模块, 用于调用所述存储器管理模块分别加载所述应用程 序代码、以及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段
应用程序的启动流程代码段时,在所述 JIT编译结果中查找所述要执行的启 动流程代码段对应的本地 JIT编译代码,并执行查找到的本地 JIT编译代码; 所述存储器管理模块, 用于保存和读取应用程序代码、 以及对应用程 序的启动流程进行 JIT编译后得到的 JIT编译结果, 所述 JIT编译结果包括 已进行 JIT编译的各段启动流程代码段对应的 JIT编译代码。
本发明还提供一种移动设备上应用程序的启动方法, 包括:
应用管理器模块基于要运行的应用程序启动虚拟机模块运行, 并控制 所述虚拟机模块执行所述应用程序代码;
所述虚拟机模块调用存储器管理模块分别加载所述应用程序代码、 以 及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用程序的 启动流程代码段时,在所述 JIT编译结果中查找所述要执行的启动流程代码 段对应的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码。
本发明实施例提供的移动设备上应用程序的启动装置及方法, 在应用 程序的启动过程中, 应用管理器模块基于要运行的应用程序启动虚拟机模 块运行, 该虚拟机模块调用存储器管理模块分别加载应用程序代码、 以及 该应用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用程序的 启动流程代码段时,在该 JIT编译结果中查找要执行的启动流程代码段对应 的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码, 这样, 在启动应 用程序时, 由于保存了对应用程序的启动流程的当前要执行的启动流程代 码段的 JIT编译结果, 因此只需直接执行对应的 JIT本地编译结果即可, 无 需对要执行的启动流程代码段以解释方式执行, 从而提高了应用程序的启 动速度。 附图说明
图 1 为本发明实施例中, 移动设备上应用程序的启动装置的结构示意 图;
图 2为本发明实施例中, 移动设备上应用程序的启动方法的流程示意 图;
图 3为本发明实施例中, Android手机软件平台中 Java应用程序启动装 置的逻辑结构图;
图 4为本发明实施例中, Android手机平台软件中 Activity的启动方法 的流程示意图。 具体实施方式
本发明的基本思想是: 应用管理器模块, 用于基于要运行的应用程序 启动虚拟机模块运行; 虚拟机模块, 用于加载所述应用程序代码、 以及应 用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用程序的启动 流程代码段时,在所述 JIT编译结果中查找所述要执行的启动流程代码段对 应的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码; 存储器管理模 块, 用于保存和读取应用程序代码、 以及对应用程序的启动流程进行 JIT 编译后得到的 JIT编译结果。
为了实现提高移动设备上的应用程序的启动速度, 本发明实施例提供 了一种移动设备上的应用程序的启动装置及方法。
以下结合说明书附图对本发明的优选实施例进行说明, 应当理解, 此 处所描述的优选实施例仅用于说明和解释本发明, 并不用于限定本发明, 合。
图 1 为本发明实施例中, 移动设备上应用程序的启动装置的结构示意 图, 如图 1 所示, 该移动设备上应用程序的启动装置包括: 应用管理器模 块 101、 虚拟机模块 102和存储器管理模块 103; 其中,
应用管理器模块 101 , 用于基于要运行的应用程序启动虚拟机模块 102 运行, 并控制虚拟机模块 102执行该应用程序代码;
虚拟机模块 102,用于调用存储器管理模块 103分别加载该应用程序代 码、以及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用 程序的启动流程代码段时,在该 JIT编译结果中查找该要执行的启动流程代 码段对应的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码;
存储器管理模块 103 , 用于保存和读取应用程序代码、 以及对应用程序 的启动流程进行 JIT编译后得到的 JIT编译结果, 该 JIT编译结果包括已进 行 JIT编译的各段启动流程代码段对应的 JIT编译代码。
具体实施中,移动设备上应用程序的启动装置还可以包括 JIT编译器模 块 104, 其中:
虚拟机模块 102,还用于在 JIT编译结果中未查找到要执行的启动流程 代码段对应的本地 JIT编译代码时,通知所述 JIT编译器模块 104对该要执 行的启动流程代码段进行 JIT编译,并釆用解释方式执行该要执行的启动流 程代码;
JIT编译器模块 104, 用于根据虚拟机模块 102的通知, 确认配置虚拟 机模块 102 时划分的内存空间有剩余空间时, 对该要执行的启动流程代码 段进行 JIT编译。
具体的, JIT编译器模块在接收到虚拟机模块的通知后, 查询配置虚拟 机模块 102 时划分的内存空间是否还有足够的空间来保存该要执行的启动 流程代码段的编译代码, 如果有足够的空间保存, 便会对要执行的启动流 程代码段进行 JIT编译; 否则, 丟弃该要执行的启动流程代码段。
具体的,应用管理器模块 101 ,用于获取要运行的应用程序的标识信息, 并在启动虚拟机模块 102运行的同时将获取到的该应用程序的标识信息传 递给虚拟机模块 102 ,通过该应用程序的标识信息控制所述虚拟机模块执行 所述应用程序代码; 虚拟机模块 102, 用于才艮据该应用程序的标识信息, 调 用存储器管理模块 103 分别加载应用程序代码、 以及应用程序的启动流程
的 JIT编译结果到内存中之后, 获取该应用程序的第一段启动流程代码段; 在所述 JIT编译结果中查找当前要执行的该第一段启动流程代码段对应的 本地 JIT编译代码, 并在查找到该代码段对应的本地 JIT编译代码时, 执行 查找到的本地 JIT编译代码,在未查找到该代码段对应的本地 JIT编译代码 时, 通知所述 JIT编译器模块对所述应用程序当前要执行的该代码段进行 JIT编译, 并釆用解释方式执行该代码段; 如果应用程序的启动流程未执行 结束, 则根据该代码段的执行结果确定下一步要执行的应用程序的启动流 程代码段, 并返回执行上一步, 直至应用程序的启动流程执行结束。
具体实施中, 本发明实施例涉及的启动流程代码段可以包括一条代码 也可以包括多条代码, 这由执行应用程序的系统支持的 JIT 编译器具体决 定。 具体的, 虚拟机模块在 JIT编译结果文件中查找 JIT编译结果并执行代 码段对应的 JIT编译代码时, 当该 JIT编译代码执行完后, 相当于已经执行 了该代码为起始的一段代码, 则下一段要执行的代码可以根据由执行的编 译结果来决定。
具体实施中, 应用程序的标识信息可以包括所述应用程序的程序名称 和软件包名称等。
具体实施中,应用管理器模块 101 , 还可以用于在确认应用程序的启动 流程执行结束后, 判断在该应用程序的启动流程执行过程中是否进行了 JIT 编译, 并在判断结果为是时,从 JIT编译器模块 104获取该应用程序的启动 流程对应的 JIT编译代码,并将该 JIT编译代码传递给存储器管理模块 103 , 存储器管理模块 103可以用于将接收到的应用程序的启动流程的 JIT编译代 码保存在指定的外部存储器中。
具体的, 存储器管理模块 103 在接收到应用程序的启动过程中, 启动 流程代码段的 JIT编译代码后以一定的格式保存在外部存储器中。
较佳的, 本发明实施例中涉及的应用程序可以为 Java应用程序。 也可
以是其它具有 JIT编译机制的解释型语言开发的应用程序。
特别的,应用程序的启动流程中涉及的代码可能由于各种 JIT的实现技 术的限制, 例如内存容量的限制而不会被全部编译, 只有部分被编译的情 况, 本发明实施例也适用于这种情况。
较佳的,本发明实施例中,存储管理器保存的 JIT编译结果的保存格式 可以为表格,如表 1所示,该表格的关键字是被 JIT编译的应用程序的启动 流程代码在应用程序代码中的位置, 该表格的内容是该应用程序的启动流 程代码进行 JIT编译后得到的本地 JIT编译代码的存放位置。 当所涉及的代 码段由多条代码组成时, 以被编译的代码段中第一条代码在应用程序代码 中的位置作为关键字去查询本地 JIT编译代码的存放位置。 因此,编译结果 表格中的代码地址所对应的编译结果, 可能不仅仅是该代码的编译结果, 也可能是以该代码为起始的一段代码的编译结果。
表 1
如表 1所示, 关键字为 100时, 表明内容是应用程序的代码中位置为 100开始的启动流程代码进行 JIT编译后得到的本地 JIT编译代码的存放位 置; 同样, 关键字为 340时, 表明内容是应用程序的代码中位置为 340开 始的启动流程代码进行 JIT编译后得到的本地 JIT编译代码的存放位置; 关 键字为 800时, 表明内容是应用程序的代码中位置为 800开始的启动流程 代码进行 JIT编译后得到的本地 JIT编译代码的存放位置。
在具体实施中,以表格的方式保存 JIT编译结果是因为在该方式下比较
容易查找将要执行的应用程序的启动流程的代码与其对应的 JIT编译结果, 并且该方式易于维护, 也是较为常见的保存方式。
具体实施中,应用管理器模块 101 , 还可以用于在确认应用程序的启动 流程执行结束后, 通知虚拟机模块 102; 虚拟机模块 102, 还用于在获知应 用程序的启动流程执行结束后, 判断在该应用程序的启动流程执行过程中 是否进行了 JIT编译, 并在判断结果为是时, 从 JIT编译器模块 104获取应 用程序的启动流程对应的 JIT编译代码,并将该 JIT编译代码传递给存储器 管理模块 103 ; 存储器管理模块 103 , 具体用于将接收到的应用程序的启动 流程的 JIT编译代码保存在指定的外部存储器中。
具体实施中,应用管理器模块 101 ,还用于在确认应用程序的启动流程 执行结束后, 通知 JIT编译器模块 104; JIT编译器模块 104, 还用于在获 知应用程序的启动流程执行结束后, 判断在该应用程序的启动流程执行过 程中是否进行了 JIT编译, 并在判断结果为是时, 将 JIT编译代码传递给存 储器管理模块 103; 存储器管理模块 103 , 具体用于将接收到的应用程序的 启动流程的 JIT编译代码保存在指定的外部存储器中。
基于上述装置, 本发明实施例中还提供了一种移动设备上应用程序的 启动方法, 由于该方法解决问题的原理与应用程序的启动装置相似, 因此 该方法的实施可以参见装置的实施, 重复之处不再赘述。
图 2为本发明实施例中, 移动设备上应用程序的启动方法的流程示意 图, 如图 2所示, 该方法包括如下步骤:
S201、 应用管理器模块基于要运行的应用程序启动虚拟机模块运行, 并控制该虚拟机模块执行该应用程序代码;
S202、 虚拟机模块调用存储器管理模块分别加载该应用程序代码、 以 及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用程序的 启动流程代码段时,在所述 JIT编译结果中查找所述要执行的启动流程代码
段对应的本地 JIT编译代码 , 并执行查找到的本地 JIT编译代码。
具体实施中, 移动设备上应用程序的启动方法, 还可以包括: 所述虚拟机模块在所述 JIT编译结果中未查找到所述要执行的启动流 程代码段对应的本地 JIT编译代码时,通知 JIT编译器模块对所述要执行的 启动流程代码段进行 JIT编译,并釆用解释方式执行所述要执行的启动流程 代码; 以及该 JIT编译器模块根据该虚拟机模块的通知,确认配置所述虚拟 机模块时划分的内存空间有剩余空间时, 对所述要执行的启动流程代码段 进行 JIT编译。
具体的, 应用管理器模块获取要运行的应用程序的标识信息, 该标识 信息可以包括该应用程序的程序名称和软件包名称; 并启动虚拟机模块, 同时, 将获取到的标识信息传递给虚拟机模块, 通过该标识信息控制虚拟 机模块执行应用程序代码。 虚拟机模块根据应用管理器模块传递过来的应 用程序的标识信息, 调用存储器管理模块分别加载应用程序代码、 以及应 用程序的启动流程的 JIT编译结果到内存中;并获得要执行的应用程序的第 一段启动流程代码段, 把它作为当前要执行的代码段; 虚拟机模块查找到 该代码段对应的本地 JIT编译代码确认当前要执行的代码段是否有 JIT编译 结果, 如果有, 虚拟机模块执行查找到的本地 JIT编译代码; 否则, 虚拟机 模块通知 JIT编译器模块, 对当前要执行的启动流程代码段进行 JIT编译, 同时, 以解释的方式执行该代码段。 应用管理器模块判断应用程序的启动 流程是否执行结束, 如果没有结束, 虚拟机模块根据该代码段的执行结果 确定下一步要执行的应用程序的启动流程代码段, 把它作为当前要执行的 代码段,并返回执行上述判断当前要执行的启动流程代码段是否有 JIT编译 结果的流程, 直至应用管理器模块确认应用程序的启动流程执行结束。
具体实施中, 当应用管理器模块在确认应用程序的启动流程执行结束 后,判断在该应用程序的启动流程执行过程中是否进行了 JIT编译,如果是,
则从所述 JIT编译器模块获取应用程序的启动流程对应的 JIT编译代码,并 将获取到的 JIT编译代码传递给存储器管理模块;该存储器管理模块将接收 到的应用程序的启动流程的 JIT编译代码保存在指定的外部存储器中。
具体的,该 JIT编译结果可以保存在同一外部存储器中,也可以保存在 不同的外部存储器中。
具体实施中, 当应用管理器模块在确认应用程序的启动流程执行结束 后, 还可以通知虚拟机模块; 该虚拟机模块在获知应用程序的启动流程执 行结束后, 判断在该应用程序的启动流程执行过程中是否进行了 JIT编译, 并在判断结果为是时, 从 JIT 编译器模块获取应用程序的启动流程对应的 JIT编译代码, 并将获取到的 JIT编译代码传递给存储器管理模块; 该存储 器管理模块将接收到的应用程序的启动流程的 JIT编译代码保存在指定的 外部存储器中。
具体实施中, 当应用管理器模块在确认应用程序的启动流程执行结束 后, 还可以通知 JIT编译器模块; 该 JIT编译器模块在获知应用程序的启动 流程执行结束后, 判断在所述应用程序的启动流程执行过程中是否进行了
JIT编译, 并在判断结果为是时, 将 JIT编译代码传递给存储器管理模块; 该存储器管理模块将接收到的应用程序的启动流程的 JIT编译代码保存在 指定的外部存储器中。
较佳的, 本发明实施例涉及的应用程序可以为 Java应用程序。
具体的, 本发明实施例涉及的应用程序为 Java应用程序时, 移动设备 上 Java应用程序的启动方法, 属于平台类的性能改进方法, 不需要爹改任 何 Java应用程序, 适用于移动设备上所有的基于 Java开发的应用程序, 所 涉及的移动设备包括 MID ( Mobile Internet Devices,移动互联网设备)、 MP4 ( MPEG-4, Moving Picture Expert Group, 动态图像专家组)、 PSP ( Play Station Portable, 便携游戏机) 以及手机等。
为了更好的理解本发明实施例的实施方式, 下面通过具体的实施例对 行描述, Android手机软件平台的应用程序釆用 Java语言开发,并且其虚拟 机具有 JIT功能。 图 3为 Android手机软件平台中 Java应用程序启动装置 的逻辑结构图, 如图所示, 在 Android手机软件平台中, 应用管理器模块分 成了两个软件模块实体: 应用管理服务器(Activity Manager Service )和应 用客户端 (Activity Thread ), 其中, ActivityManagerService在单独的一个 系统进程中运行, ActivityThread在应用程序的进程中运行; JIT编译器模 块对应一个线程软件模块实体, 在应用程序的进程中运行; 存储器管理模 块包安装管理器 (Package Manager ), 它和 Java虚拟机模块分别有对应的 函数 /类等软件模块实体, 同时, 它们都在应用程序进程的主线程中运行。
本发明实施例中, 以 Android手机软件平台中一个应用界面( Activity ) 的启动为例进行描述。 在 Android中, 一个 Activity可以看作是一个 Java 应用程序, Activity的第一个窗口被显示出来就标志着其启动完毕。 本发明 实施例中, JIT编译结果以表格的形式存放在指定的外部存储器中。
如图 4所示, 为 Android手机平台软件中, Activity的启动方法的流程 示意图, 包括如下步骤:
5401、 ActivityManagerService创建一个新的进程, 以便运行 Activity。
5402、 新的进程创建 Java虚拟机模块。
S403、 Java虚拟机模块执行 ActivityThread的代码。
5404、 ActivityThread与 ActivityManagerService之间建立通信连接。
5405、 ActivityManagerService向 ActivityThread发送要启动的 Activity 的启动流程的标识信息;
具体的, ActivityManagerService向 ActivityThread发送的 Activity的启 动流程的标识信息中包括 Activity的名称和软件包的名称等。
5406、 ActivityThread将接收到的 Activity的标识信息传递给 Java虚拟 机模块。
5407、 Java虚拟机模块从 PackageManager获取将要运行的 Activity的 代码和 Activity的启动流程的 JIT编译结果。
S408、 Java虚拟机模块打开 Activity的代码和该 Activity的启动流程的
JIT编译结果, 并将其读入内存;
Java虚拟机模块将要 Activity的代码和该 Activity的启动流程的 JIT编 译结果后, 分别存放在 code (代码)存储区和 JIT-cache存储区 ( JIT緩存 ) 中;
具体的, PackageManager中从指定的外部存储器中读取 Activity的启 动流程的 JIT编译结果, Java虚拟机模块将该 JIT编译结果读入内存。
S409、 Java虚拟机模块从 code存储区获取第一段代码作为当前要执行 的代码段。
5410、 Java虚拟机模块确认当前要执行的代码段是否有对应的 JIT编 译结果, 如果有, 执行 S412, 否则, 执行 S411 ;
具体的, Java虚拟机模块以当前要执行的代码段在该 Activity的代码 中存放的位置作为关键字, 查找 JIT-cache存储区中的 JIT编译结果, 如果 该关键字有对应的内容, 则该内容就是指向存放该当前要执行的代码进行 JIT编译后得到的本地 JIT编译代码的指针, 根据该指针, 便可以获取当前 要执行的代码对应的本地 JIT编译代码。
5411、 Java虚拟机模块以解释的方式执行当前要执行的代码, 并通知 JIT编译器模块编译当前要执行的代码段, 并将 JIT编译启动流程标识置为 真, 设置下一步将要执行的代码段。
S412、 Java虚拟机模块执行当前要执行的代码段对应的本地 JIT编译 代码, 设置下一条将要执行的代码段。
5413、 ActivityManagerService确认 Activity的启动流程结束标志是否 为真, 如果是, 执行 S415 , 否则执行 S414。
5414、 执行下一步将要执行的代码段, 并返回执行 S410;
由于 S411或者 S412中, 当前要执行的代码执行完毕后, 会设置下一 条要执行的代码段(这是由 JIT编译机制和 java虚拟机机制所保证的 ), 将 设置的下一步要执行的代码段作为当前要执行的代码段。
5415、 ActivityManagerService判断 JIT编译器模块启动流程标识是否 为真, 如果为真, 执行 S416, 否则执行 S417。
5416、 保存本次启动流程中的 JIT编译代码;
ActivityManagerService从 JIT编译器模块获取本次 Activity启动的过程 中进行 JIT编译的编译代码, 并传递给 PackageManager, PackageManager 以表格的格式保存在该 Activity的安装目录下。
S417、 本次 Activity启动流程结束。
本发明实施例通过改进 JIT机制, 让 Java应用程序的启动流程所执行 的代码段能够被 JIT编译成本地 JIT编译代码, 并且该 JIT编译结果可以保 存起来, 从而解决了 Java应用程序启动流程最大的性能瓶颈, 提高了 Java 应用程序的启动速度。
本发明实施例提供的一种移动设备上应用程序的启动装置及方法, 在 应用程序的启动过程中, 应用管理器模块基于要运行的应用程序启动虚拟 机模块运行, 该虚拟机模块调用存储器管理模块分别加载应用程序代码、 以及该应用程序的启动流程的 JIT编译结果到内存中 ,在执行每一段应用程 序的启动流程代码段时,在该 JIT编译结果中查找要执行的启动流程代码段 对应的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码, 这样, 在启 动应用程序时, 由于保存了对应用程序的启动流程的当前要执行的启动流 程代码段的 JIT编译结果,因此只需直接执行对应的 JIT本地编译结果即可,
无需对要执行的启动流程代码段以解释方式执行, 从而提高了应用程序的 启动速度。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。
Claims
1、 一种移动设备上应用程序的启动装置, 其特征在于, 该装置包括: 应用管理器模块、 虚拟机模块和存储器管理模块; 其中,
所述应用管理器模块, 用于基于要运行的应用程序启动虚拟机模块运 行, 并控制所述虚拟机模块执行所述应用程序代码;
所述虚拟机模块, 用于调用所述存储器管理模块分别加载所述应用程 序代码、以及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段 应用程序的启动流程代码段时,在所述 JIT编译结果中查找所述要执行的启 动流程代码段对应的本地 JIT编译代码,并执行查找到的本地 JIT编译代码; 所述存储器管理模块, 用于保存和读取应用程序代码、 以及对应用程 序的启动流程进行 JIT编译后得到的 JIT编译结果, 所述 JIT编译结果包括 已进行 JIT编译的各段启动流程代码段对应的 JIT编译代码。
2、 如权利要求 1所述的装置, 其特征在于, 该装置还包括 JIT编译器 模块; 其中,
所述虚拟机模块,还用于在所述 JIT编译结果中未查找到所述要执行的 启动流程代码段对应的本地 JIT编译代码时,通知所述 JIT编译器模块对所 述要执行的启动流程代码段进行 JIT编译,并釆用解释方式执行所述要执行 的启动流程代码;
所述 JIT编译器模块,用于根据所述虚拟机模块的通知,确认所述虚拟 机模块的内存空间有剩余空间时,对所述要执行的启动流程代码段进行 JIT 编译。
3、 如权利要求 2所述的装置, 其特征在于,
所述应用管理器模块, 还用于获取要运行的应用程序的标识信息, 并 在启动所述虚拟机模块运行的同时将获取到的所述应用程序的标识信息传 递给所述虚拟机模块, 通过所述应用程序的标识信息控制所述虚拟机模块 执行所述应用程序代码;
所述虚拟机模块, 还用于根据所述应用程序的标识信息, 调用所述存 储器管理模块分别加载应用程序代码、以及应用程序的启动流程的 JIT编译 结果到内存中; 获取所述应用程序的第一段启动流程代码段; 在所述 JIT 编译结果中查找当前要执行的该第一段启动流程代码段对应的本地 JIT编 译代码,并在查找到该代码段对应的本地 JIT编译代码时,执行查找到的本 地 JIT编译代码, 在未查找到该代码段对应的本地 JIT编译代码时, 通知所 述 JIT编译器模块对所述应用程序当前要执行的该代码段进行 JIT编译,并 釆用解释方式执行该代码段; 如果应用程序的启动流程未执行结束, 则根 据该代码段的执行结果确定下一步要执行的应用程序的启动流程代码段, 并返回执行上一步, 直至应用程序的启动流程执行结束。
4、 如权利要求 2或 3所述的装置, 其特征在于,
所述应用管理器模块, 还用于在确认应用程序的启动流程执行结束后, 判断在所述应用程序的启动流程执行过程中是否进行了 JIT编译,并在判断 结果为是时,从 JIT编译器模块获取所述应用程序的启动流程对应的 JIT编 译代码, 并将获取到的 JIT编译代码传递给存储器管理模块;
所述存储器管理模块,用于将接收到的应用程序的启动流程的 JIT编译 代码保存在指定的外部存储器中。
5、 如权利要求 2或 3所述的装置, 其特征在于,
所述应用管理器模块, 还用于在确认应用程序的启动流程执行结束后, 通知虚拟机模块;
所述虚拟机模块, 还用于在获知应用程序的启动流程执行结束后, 判 断在所述应用程序的启动流程执行过程中是否进行了 JIT编译,并在判断结 果为是时,从 JIT编译器模块获取所述应用程序的启动流程对应的 JIT编译 代码, 并将获取到的 JIT编译代码传递给存储器管理模块; 所述存储器管理模块, 具体用于将接收到的应用程序的启动流程的 JIT 编译代码保存在指定的外部存储器中。
6、 如权利要求 2或 3所述的装置, 其特征在于,
所述应用管理器模块, 还用于在确认应用程序的启动流程执行结束后, 通知 JIT编译器模块;
所述 JIT编译器模块, 还用于在获知应用程序的启动流程执行结束后, 判断在所述应用程序的启动流程执行过程中是否进行了 JIT编译,并在判断 结果为是时, 将所述 JIT编译代码传递给存储器管理模块;
所述存储器管理模块,用于将接收到的应用程序的启动流程的 JIT编译 代码保存在指定的外部存储器中。
7、 如权利要求 1所述的装置, 其特征在于, 所述应用程序为 Java应用 程序。
8、 一种移动设备上应用程序的启动方法, 其特征在于, 该方法包括: 应用管理器模块基于要运行的应用程序启动虚拟机模块运行, 并控制 所述虚拟机模块执行所述应用程序代码;
所述虚拟机模块调用存储器管理模块分别加载所述应用程序代码、 以 及应用程序的启动流程的 JIT编译结果到内存中,在执行每一段应用程序的 启动流程代码段时,在所述 JIT编译结果中查找所述要执行的启动流程代码 段对应的本地 JIT编译代码, 并执行查找到的本地 JIT编译代码。
9、 如权利要求 8所述的方法, 其特征在于, 该方法还包括:
所述虚拟机模块在所述 JIT编译结果中未查找到所述要执行的启动流 程代码段对应的本地 JIT编译代码时,通知 JIT编译器模块对所述要执行的 启动流程代码段进行 JIT编译,并釆用解释方式执行所述要执行的启动流程 代码;
所述 JIT编译器模块根据所述虚拟机模块的通知,确认所述虚拟机模块 的内存空间有剩余空间时, 对所述要执行的启动流程代码段进行 JIT编译。
10、 如权利要求 9所述的方法, 其特征在于, 所述应用管理器模块基 于要运行的应用程序启动虚拟机模块运行, 并控制所述虚拟机模块执行所 述应用程序代码为:
所述应用管理器模块获取要运行的应用程序的标识信息, 并在启动所 述虚拟机模块运行的同时将获取到的所述应用程序的标识信息传递给所述 虚拟机模块, 通过所述应用程序的标识信息控制所述虚拟机模块执行所述 应用程序代码。
11、 如权利要求 10所述的方法, 其特征在于, 所述应用程序的启动流 程的执行步骤为:
所述虚拟机模块根据所述应用程序的标识信息, 调用存储器管理模块 分别加载应用程序代码、 以及应用程序的启动流程的 JIT编译结果到内存 中;
获取所述应用程序的第一段启动流程代码段;
所述虚拟机模块在所述 JIT编译结果中查找当前要执行的该第一段启 动流程代码段对应的本地 JIT 编译代码, 并在查找到该代码段对应的本地 JIT编译代码时, 执行查找到的本地 JIT编译代码, 在未查找到该代码段对 应的本地 JIT编译代码时,通知所述 JIT编译器模块对所述应用程序当前要 执行的该代码段进行 JIT编译, 并釆用解释方式执行该代码段;
应用管理器模块判断应用程序的启动流程是否执行结束, 如果否, 所 述虚拟机模块根据该代码段的执行结果确定下一步要执行的应用程序的启 动流程代码段, 并返回执行上一步, 直至应用管理器模块确认应用程序的 启动流程执行结束。
12、 如权利要求 9至 11任一项所述的方法, 其特征在于, 该方法还包 括: 所述应用管理器模块在确认应用程序的启动流程执行结束后, 判断在 所述应用程序的启动流程执行过程中是否进行了 JIT编译,并在判断结果为 是时,从 JIT编译器模块获取所述应用程序的启动流程对应的 JIT编译代码, 并将所述获取到的 JIT编译代码传递给存储器管理模块;
所述存储器管理模块将接收到的应用程序的启动流程的 JIT 编译代码 保存在指定的外部存储器中。
13、 如权利要求 9至 11任一项所述的方法, 其特征在于, 该方法还包 括:
所述应用管理器模块在确认应用程序的启动流程执行结束后, 通知虚 拟机模块;
所述虚拟机模块在获知应用程序的启动流程执行结束后, 判断在所述 应用程序的启动流程执行过程中是否进行了 JIT 编译, 并在判断结果为是 时,从所述 JIT编译器模块获取所述应用程序的启动流程对应的 JIT编译代 码, 并将获取到的 JIT编译代码传递给存储器管理模块;
所述存储器管理模块将接收到的应用程序的启动流程的 JIT 编译代码 保存在指定的外部存储器中。
14、 如权利要求 9至 11任一项所述的方法, 其特征在于, 该方法还包 括:
所述应用管理器模块在确认应用程序的启动流程执行结束后, 通知 JIT 编译器模块;
所述 JIT编译器模块在获知应用程序的启动流程执行结束后,判断在所 述应用程序的启动流程执行过程中是否进行了 JIT编译,并在判断结果为是 时, 将所述 JIT编译代码传递给存储器管理模块;
所述存储器管理模块将接收到的应用程序的启动流程的 JIT 编译代码 保存在指定的外部存储器中。
15、 如权利要求 8所述的方法, 其特征在于, 所述应用程序为 Java应 用程序。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP11830194.4A EP2521033B1 (en) | 2010-10-09 | 2011-02-21 | Startup method and device for application program on mobile device |
US13/575,550 US8726249B2 (en) | 2010-10-09 | 2011-02-21 | Bootup method and device for application program in mobile equipment |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010504978.3A CN101957770B (zh) | 2010-10-09 | 2010-10-09 | 一种移动设备上应用程序的启动方法及装置 |
CN201010504978.3 | 2010-10-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2012045238A1 true WO2012045238A1 (zh) | 2012-04-12 |
Family
ID=43485112
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2011/071142 WO2012045238A1 (zh) | 2010-10-09 | 2011-02-21 | 一种移动设备上应用程序的启动方法及装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US8726249B2 (zh) |
EP (1) | EP2521033B1 (zh) |
CN (1) | CN101957770B (zh) |
WO (1) | WO2012045238A1 (zh) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957770B (zh) * | 2010-10-09 | 2015-09-02 | 中兴通讯股份有限公司 | 一种移动设备上应用程序的启动方法及装置 |
KR101930510B1 (ko) * | 2011-09-16 | 2018-12-19 | 삼성전자주식회사 | 네트워크 상의 객체 검색 방법 및 시스템 |
CN102508694B (zh) * | 2011-10-14 | 2015-05-06 | 深圳市江波龙电子有限公司 | 一种虚拟机文件运行方法及系统 |
CN103324508A (zh) * | 2013-06-26 | 2013-09-25 | 宇龙计算机通信科技(深圳)有限公司 | 启动应用的方法及装置 |
US9363264B2 (en) * | 2013-11-25 | 2016-06-07 | At&T Intellectual Property I, L.P. | Networked device access control |
CN103824004A (zh) * | 2014-02-26 | 2014-05-28 | 可牛网络技术(北京)有限公司 | 应用程序的保护方法和装置 |
CN103927207B (zh) * | 2014-04-10 | 2017-07-25 | 安一恒通(北京)科技有限公司 | 软件加速方法和装置 |
US9286085B2 (en) * | 2014-06-27 | 2016-03-15 | International Business Machines Corporation | Correlating class loader objects across execution environments |
CN104536728B (zh) * | 2014-12-01 | 2017-12-22 | 苏州乐米信息科技有限公司 | 手机游戏轻量化方法 |
US9424006B2 (en) | 2014-12-24 | 2016-08-23 | International Business Machines Corporation. | Execution optimization of mobile applications |
US9696973B1 (en) * | 2016-02-24 | 2017-07-04 | Semmle Limited | Compilation cache with imports scanner |
CN107450937B (zh) * | 2016-05-31 | 2021-02-19 | 中兴通讯股份有限公司 | 一种应用程序的运行方法和运行装置 |
CN107657172A (zh) * | 2016-07-25 | 2018-02-02 | 腾讯科技(深圳)有限公司 | 代码处理方法、装置及系统 |
US10474568B2 (en) * | 2017-09-20 | 2019-11-12 | Huawei Technologies Co., Ltd. | Re-playable execution optimized for page sharing in a managed runtime environment |
US11243790B2 (en) * | 2017-09-20 | 2022-02-08 | Huawei Technologies Co., Ltd. | Re-playable execution optimized for page sharing in a managed runtime environment |
CN108334325A (zh) * | 2017-12-26 | 2018-07-27 | 努比亚技术有限公司 | 一种编译方法、计算机及计算机可读存储介质 |
CN112948026A (zh) * | 2019-11-26 | 2021-06-11 | Oppo广东移动通信有限公司 | 热点代码处理方法、装置、服务器、电子设备及存储介质 |
CN111782297A (zh) * | 2020-06-30 | 2020-10-16 | 珠海全志科技股份有限公司 | 基于Android虚拟机快速提升应用启动性能的方法 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002073345A (ja) * | 2000-08-25 | 2002-03-12 | Fujitsu Ltd | 情報処理装置及び記録媒体 |
US6779188B1 (en) * | 2000-09-28 | 2004-08-17 | International Business Machines Corporation | Apparatus and method for improved devirtualization of method calls |
JP2005284729A (ja) * | 2004-03-30 | 2005-10-13 | Fujitsu Ltd | バイトコードをネイティブコードにコンパイルする仮想マシン |
CN100354826C (zh) * | 2001-11-07 | 2007-12-12 | 富士通株式会社 | 配有jit编译器的虚拟计算机及其方法 |
US20090055821A1 (en) * | 2007-08-22 | 2009-02-26 | International Business Machines Corporation | Systems, methods, and computer products for just-in-time compilation for virtual machine environments for fast application startup and maximal run-time performance |
CN101957770A (zh) * | 2010-10-09 | 2011-01-26 | 中兴通讯股份有限公司 | 一种移动设备上应用程序的启动方法及装置 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7530059B2 (en) * | 2005-02-18 | 2009-05-05 | International Business Machines Corporation | Method for inlining native functions into compiled java code |
US7568190B2 (en) * | 2005-03-08 | 2009-07-28 | International Business Machines Corporation | Late binding of optimization information for just in time compilation |
JP2009211190A (ja) * | 2008-02-29 | 2009-09-17 | Hitachi Ltd | 情報処理装置 |
-
2010
- 2010-10-09 CN CN201010504978.3A patent/CN101957770B/zh active Active
-
2011
- 2011-02-21 WO PCT/CN2011/071142 patent/WO2012045238A1/zh active Application Filing
- 2011-02-21 EP EP11830194.4A patent/EP2521033B1/en not_active Not-in-force
- 2011-02-21 US US13/575,550 patent/US8726249B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002073345A (ja) * | 2000-08-25 | 2002-03-12 | Fujitsu Ltd | 情報処理装置及び記録媒体 |
US6779188B1 (en) * | 2000-09-28 | 2004-08-17 | International Business Machines Corporation | Apparatus and method for improved devirtualization of method calls |
CN100354826C (zh) * | 2001-11-07 | 2007-12-12 | 富士通株式会社 | 配有jit编译器的虚拟计算机及其方法 |
JP2005284729A (ja) * | 2004-03-30 | 2005-10-13 | Fujitsu Ltd | バイトコードをネイティブコードにコンパイルする仮想マシン |
US20090055821A1 (en) * | 2007-08-22 | 2009-02-26 | International Business Machines Corporation | Systems, methods, and computer products for just-in-time compilation for virtual machine environments for fast application startup and maximal run-time performance |
CN101957770A (zh) * | 2010-10-09 | 2011-01-26 | 中兴通讯股份有限公司 | 一种移动设备上应用程序的启动方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
US8726249B2 (en) | 2014-05-13 |
EP2521033A1 (en) | 2012-11-07 |
US20120304166A1 (en) | 2012-11-29 |
EP2521033A4 (en) | 2013-11-06 |
EP2521033B1 (en) | 2015-10-21 |
CN101957770A (zh) | 2011-01-26 |
CN101957770B (zh) | 2015-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2012045238A1 (zh) | 一种移动设备上应用程序的启动方法及装置 | |
US10949191B2 (en) | Patch-upgrade-based file processing method and apparatus, terminal, and storage medium | |
US10713091B2 (en) | Streaming program execution method of intelligent terminal | |
WO2020078314A1 (zh) | 加速应用的冷启动的方法、装置和终端 | |
US9342326B2 (en) | Allocating identified intermediary tasks for requesting virtual machines within a trust sphere on a processing goal | |
US11188347B2 (en) | Virtual function driver loading method and server using global and local identifiers corresponding to locations of the virtual functions | |
CN102591726A (zh) | 一种多进程通信方法 | |
WO2012155698A1 (zh) | 基于浏览器引擎的动态加载微件的方法及移动终端 | |
WO2014202009A1 (zh) | 一种众核系统的任务管理方法和装置 | |
CN116643778B (zh) | 一种应用程序优化方法及电子设备 | |
WO2023274135A1 (zh) | 一种数据的处理系统、方法以及装置 | |
US8555001B2 (en) | Cache memory, including miss status/information and a method using the same | |
US8909892B2 (en) | Method, apparatus, and computer program product for fast context switching of application specific processors | |
CN108958807B (zh) | 一种终端系统启动方法及终端 | |
CN104714792A (zh) | 多进程共享数据处理方法和装置 | |
WO2015165057A1 (zh) | 一种硬盘执行应用代码的方法及装置 | |
KR20040071831A (ko) | 자바 프로그램에서 클래스 로딩 과정을 단축시키는 시스템및 방법 | |
US12113878B2 (en) | Methods and systems for scheduling a workflow | |
KR101662030B1 (ko) | 태스크 이동 시스템 및 그 방법 | |
WO2017128589A1 (zh) | 可运行文件生成方法、art虚拟机运行方法和装置 | |
CN107220101B (zh) | 一种容器创建方法和装置 | |
KR20200084294A (ko) | 핫스팟 추출을 이용하여 코드 블록을 탐색하는 운용 서버 및 이를 포함하는 운용 플랫폼 시스템 | |
US20150031346A1 (en) | Sharing wireless connection profiles between multiple operating systems | |
WO2011060656A1 (zh) | 一种usb数据卡及其网络注册方法、系统 | |
WO2024207824A1 (zh) | 一种指令提取的方法及相关装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 11830194 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 13575550 Country of ref document: US |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2011830194 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |