WO2020068080A1 - Javascript environment initialization - Google Patents
Javascript environment initialization Download PDFInfo
- Publication number
- WO2020068080A1 WO2020068080A1 PCT/US2018/053036 US2018053036W WO2020068080A1 WO 2020068080 A1 WO2020068080 A1 WO 2020068080A1 US 2018053036 W US2018053036 W US 2018053036W WO 2020068080 A1 WO2020068080 A1 WO 2020068080A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- jsvm
- application
- jse
- javascript
- portions
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/45529—Embedded in an application, e.g. JavaScript in a Web browser
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/301—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3648—Debugging of software using additional hardware
- G06F11/3656—Debugging of software using additional hardware using a specific debug interface
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/45508—Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
Definitions
- FiG. 1 illustrates an example host associated with JavaScript environment initialization.
- FiG. 2 illustrates a flowchart of example operations associated with JavaScript environment initialization.
- FIG. 3 illustrates another flowchart of example operations associated with JavaScript environment initialization.
- FIG. 4 illustrates an example system associate with JavaScript environment initialization.
- FIG. 5 iiiustrates another flowchart of example operations associated with JavaScript environment initialization.
- FIG. 6 illustrates an example computing device in which example systems, and methods, and equivalents, may operate.
- JSVM JavaScript virtual machine
- pre-optimized portions may then be injected as requested into a JSVM that is also compiling and optimizing other portions of the JSVM that, for example, reach different execution states dependent on inputs.
- the preoptimized portions may include compiled and optimized code, memory and state information, and so forth such that the pre- optimized portion is ready to begin operation in the JSVM without additional preprocessing.
- Module * includes but is not limited to hardware, instructions stored on a computer-readable medium or in execution on a machine, and/or combinations of each to perform a function(s) or an action(s), and/or to cause a function or action from another module, method, and/or system.
- a module may include a microprocessor controlled via instructions executable by the microprocessor, a discrete module, an analog circuit, a digital circuit, a programmed module device, a memory device containing instructions, an so on.
- Modules may include gates, combinations of gates, or other circuit components. Where multiple logics! modules are described, it may be possible to incorporate the multiple logical modules into one physical module. Similarly, where a single logical module is described, it may be possible to distribute that single logical module between multiple physical modules
- FIG. 1 illustrates an example host 100 associated with JavaScript environment initialization.
- host 100 may be responsible for delivering content requested by an application 140
- application 140 may be a web browser
- host 100 may be a server on which content being requeste by application 140 is located. While an example of a web browser and server is used to facilitate discussion of Figure 1 , it should be appreciated that other applications 140 may incorporate JSVMs 150, and therefore techniques disclosed herein may have applicability for other non-web browser types of applications 140.
- host 100 may not be remote to application 140, as in certain examples a certain device may perform the roies of both host 100 and application 140.
- JSVM 150 may be associated with performing some function that is to be incorporated into or displayed by application 140.
- a JSVM 150 may be designed to perform a wide variety of functions because JavaScript is a core technology of the Internet that is often used to facilitate interactivity in web pages.
- JavaScript is used, for example, for gaming, productivity, user interface support, performing data analysis, and so forth.
- Application 140 may then provide the code portions to application runtime monitor 145.
- Application runtime monitor 145 will then perform a variety of tasks on the JavaScript code 110 to generate JSVM 150. These tasks may include, for example, compiling the JavaScript code 110 into instructions interpretable by a processor of a device operating application 140, opti izing the code, and so forth.
- application runtime monitor 145 may be able to compile, optimize, and control execution of the entirety of JSVM 150.
- performing a single pass optimization of a relatively larger sets of JavaScript code 1 10 may be slower due to the increasing complexity and length of the code base resulting from the expanding functionalities of embedded JSVMs 150.
- JSVMs are being used to perform data analysis on big data sets, Involve complex graphics or interactivity, and so forth as these tasks may invoke specialized libraries and/or frameworks for performing these tasks.
- Some example specialized libraries may include, for example, JGuery, AngularJS, React, Vue.JS, D3.JS, HighCharts, and so forth.
- application runtime monitors 145 have begun to build efficiency by compiling and/or optimizing portions of JavaScript Code 1 10 either just in time or as they are requested by other portions of already executing JSVM 150. However, this may still be inefficient as building the portions as needed may slow down execution of JSVM 150 if those portions take time to compile and optimize.
- JSE JavaScript environments
- the JSEs 130 may be generated by optimization module 120.
- optimization module 120 may effectively act as an application runtime monitor 145 and build JSVM 150 several times with the goal of identifying portions of JavaScript code 1 10 that optimize to a consistent state.
- optimization module 120 may build JSVM 150 using a variety of input sets to further identification of portions of JavaScript code 110 that optimize to a consistent state.
- optimization module 120 may store the portions as JSEs 130 in host 100
- the JSEs 130 may include executable code, and other state information including initialized variables and other memory information. Effectively, the stored JSEs 130 may be a binary representation of an application state of a corresponding portion of JavaScript code 1 10. The application state may then either be replayed in the future, using the preserved optimizations, or transferred to a JSVM 150 on another device and executed from the preserved state
- host 100 stores three portions of JavaScript code 110 including portion 112, portion 114, and portion 118 that are associated with building JSVM 150. These portions may be fed to optimization module 120 that identifies that portions 114 and 116 optimize to a consistent state. Optimization may then store JSE versions 134 and 136 of code portions 114 and 116 respectively. As portion 112 may not optimize to a consistent state (e.g., because its optimizations are dependent on factors that change between executions), optimization module 120 may not store a JSE 130 for code portion 112 When application 140 requests an asset associated with JSVM 150, host 100 may look to see if JSEs 130 have been created for the portions of JavaScript code 110 associated with JSVM 110.
- host 100 may transmit those portions as JavaScript code to application 140 to be built and executed as would have been done previously by application runtime monitor 145.
- host 100 may instead transmit the JSEs 130 ⁇ e.g., JSE 134, JSE 136) Consequently, instead of building the code portions from scratch, application runtime monitor 145 may inject the pre-buiit and pre-inifiaiized JSEs at the appropriate point in time, saving application runtime monitor 145 from having to optimize these portions itself.
- injecting a JSE 130 into the JSVM 150 may include inserting into a memory associated with JSVM: 150, portions of the JSE 130 in such a way that the JSVM 150 operates as if the JavaScript code 110 associated with the JSE 130 had been compiled and optimized by runtime monitor 145. This may include inserting instructions associated with the JSE 130 into memory, updating memory values and/or locations to pre-initialized values associated with JSE 130, and so forth,
- host 100 may also store an application runtime monitor 145 that supports this functionality and provide runtime monito 145 to application 140 when appropriate.
- application runtime monitor 145 may be able to be controlled to inject the JSEs 130 using debugging hooks that are native to the JSE 130.
- native runtime monitors may be designed to support injection of JSEs 130 into JSVMs 150.
- host 100 and application 140 may also negotiate code signing based on trusted authorities to ensure that code in execution is secure and wili not harm a device on which application 140 is operating.
- Pre-building and injectin JSEs 130 into a JSVM 150 may speed up the optimization process associated with executing a JSVM. This may be because application runtime monitor 145 does not have to go through the process of compiling and optimizing JavaScript code portions 110 when initializing the JSVM 150. Additionally, because JSVMs may be recreated several times due to, for example, reloading a webpage, having the JSE's ready in advance may allow the JSVM 150 to be reloaded without having to repeat the compiling and optimization process.
- Method 200 may be embodied on a non-transitor processor-readable medium storing processor- executable instructions. The instructions, when executed by a processor, may cause the processor to perform method 200. In other examples, method 200 may exist within logic gates and/or RAM: of an application specific integrated circuit (ASIC).
- ASIC application specific integrated circuit
- Method 200 may perform various tasks associated with JavaScript environment initialization.
- method 200 includes creating a JavaScript environment (JSE) at 220.
- the JSE may be created by initializing a portion of a JavaScript virtual machine (JSVM).
- the JSVM may be initialized to a point at which the portion of the JSVM; has a known consistent state in some examples, the JSE may include a binary image of a state of the portion of the JSVM .
- the JSE may include complied and optimized code, initialized variables, and so forth.
- Method 200 also includes receiving a request for an asset at 230.
- the asset may incorporate the JSVM.
- the request may be received from an application.
- the application may be, for example, a web page.
- Method 200 also includes transmitting the JSE to the application at 240. This may ailow the application to inject the JSE into a version of the JSVM that the application is building.
- Figure 3 illustrates a method 300 associated with JavaScript environment initialization.
- Method 300 includes several actions similar to those described above with reference to method 200 ( Figure 2).
- method 300 includes creating a JavaScript environment (JSE) at 320 from a portion of a JavaScript virtual machine (JSVM), receiving an asset request from an application at 330, and transmitting the JSE to the application at 340.
- JSE JavaScript environment
- JSVM JavaScript virtual machine
- Method 300 also includes identifying a point at which the portion of the JSVM has a known consistent state at 310. This may be achieved by repeatedly compiling and executing the portion of the JSVM. f0O27] Method 300 also includes transmitting an uninitialized portion of the JSV to the application at 350.
- the uninitialized portion of the JSVM may be compiled and optimized by a runtime monitor initiated by the application. The application may then incorporate the uninitialized portion and the initialized portion to perform a function.
- the application may need to use a runtime monitor that supports injecting the JSE into a portion of code that the application has compiled and optimized itself in some examples, the application may use a runtime monitor to compile and build JavaScript code to perform a function.
- method 300 may include controlling the application to inject the initialized JSE info the local runtime monitor at 375 This may use an interface of the local runtime monitor, which may facilitate injection of certain types of complied code via debugging hooks in other examples, a runtime monitor that supports injection of the initialized JSE may need to be provided to the application, in which case method 300 may proceed to action 370 and transmit the application a custom runtime monitor,
- FIG. 4 illustrates a system 400
- System 400 includes a data store 410
- Data store 410 may store a set of uncompiled portions of a JavaScript virtual machine (JSVM)
- JSVM JavaScript virtual machine
- System 400 also includes an optimization module 420.
- Optimization module 420 may build portions of the JSVM to identify portions of the JSVM that optimize to a consistent state A portion that optimizes to a consistent state may be a portion that reaches a reproducible execution point for different input sets for the JSVM.
- Optimization module 420 may also store initialized versions of the portions of the JSVM that optimize to consistent states. These initialized versions may be stored as JavaScript environments (JSEs) The JSEs may be stored in data store 410
- System 400 aiso includes a delivery module 430.
- Delivery module 430 may receive a request for an asset associated with the JSVM from an application 499
- Application 499 may be, for example, a web browser.
- delivery module 430 may deliver portions of the JSVM to a runtime monitor associated with application 499
- delivery module 430 may deliver uncompiled versions of these portions.
- delivery module 430 may the corresponding JSE.
- delivery module 430 may also control application 499 to use debugging hooks of a runtime monitor native to application 499 to inject the JSEs at appropriate locations of the JSVM
- delivery module 430 may also deliver the runtime module to application 499.
- the runtime monitor delivered to the application may support injecting the JSEs at appropriate locations of the JSVM.
- Figure 5 illustrates a method 500 associated with JavaScript environment initialization.
- Method 500 includes requesting an asset associated with a JavaScript virtual machine ⁇ JSVM) at 510.
- Method 500 also includes receiving a JavaScript environment (JSE) associated with a portion of the JSVM at 520.
- JSE JavaScript environment
- the JSE may be associated with instructions that reach a reproducible execution point when compiled and optimized, despite different input sets for the JSVM.
- the JSE may include, for exampie, an initialized binary image of a state of the portion of the JSVM.
- Method 500 also includes receiving an unoptimized portion of the JSVM at 530.
- Method 500 also includes constructing the JSVM at 540.
- the JSVM may be constructed by compiling and optimizing the unoptimized portion of the JSVM, and injecting the JSE at an appropriate point in the JSVM.
- the JSE may be injected using debugging hooks associated with a native runtime monitor in other examples, method 500 may include receiving a runtime monitor that supports injecting the JSE into the JSVM.
- FIG. 6 illustrates an exampie computing device in which exampie systems and methods, and equivalents, may operate.
- the exampie computing device may be a computer 800 that includes a processor 810 and a memory 820 connected by a bus 630.
- Computer 600 includes a JavaScript environment initialization module 840.
- JavaScript environment initialization module 840 may perform, alone or in combination, various functions described above with reference to the exampie systems, methods, and so forth in different examples, JavaScript environment initialization module 640 may be implemented as a non-transitory computer-readable medium storing processor-executable instructions, in hardware, as an application specific integrated circuit, and/or combinations thereof
- the instructions may also be presented to computer 600 as data 850 and/or process 660 that are temporarily stored in memory 820 and then executed by processor 810.
- the processor 810 may be a variety of processors including dual microprocessor and other multi-processor architectures
- Memory 620 may include non-volatile memory (e.g , read-only memory, flash memory, memristor) and/or volatile memory (e.g., random access memory).
- Memory 620 may also be, for example, a magnetic disk drive, a solid state disk drive, a floppy disk drive, a tape drive, a flash memory card, an optical disk, and so on.
- memory 620 may store process 660 and/or data 650.
- Computer 600 may also be associated with other devices including other computers, devices, peripherals, and so forth In numerous configurations (not shown).
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 Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Abstract
Examples associated with JavaScript environment initialization are described. One example includes initializing a portion of a JavaScript virtual machine (JSVM) to a point at which the portion of the JSVM has a known consistent state. This creates a JavaScript environment (JSE). A request is received for an asset that incorporates the JSE. The request is received from an application. The JSE is transmitted to the application.
Description
JAVASCRIPT ENVIRONMENT INITIALIZATION
BACKGROUND
[0001] The demand for web-based applications and services has increased over time. This is especially true due to the shift from providing users applications they run on their computers to applications run in the cloud and/or within browsers. The growth in use cases and functionality of web-based applications has led applications to rely on frameworks and libraries to extend the functionality of the applications. For example, in web browsers, a significant amount of the browser may be dedicated to loading JavaScript components of web-based applications. These components may add functionality such as layout rendering, data management and manipulation, application functionality, user experience, and so forth.
BRIEF DESCRIPTION OF THE PRAWiNGS
10002] The present application may be more fully appreciated in connection with the following detailed description taken in conjunction with the accompanying drawings.
[0003] FiG. 1 illustrates an example host associated with JavaScript environment initialization. 0004] FiG. 2 illustrates a flowchart of example operations associated with JavaScript environment initialization.
[0005] FIG. 3 illustrates another flowchart of example operations associated with JavaScript environment initialization.
[0006] FIG. 4 illustrates an example system associate with JavaScript environment initialization.
[0007] FIG. 5 iiiustrates another flowchart of example operations associated with JavaScript environment initialization.
[00083 FIG. 6 illustrates an example computing device in which example systems, and methods, and equivalents, may operate.
DETAILED DESCR P _ON
[00091 Examples associated with JavaScript environment initialization are described. As discussed above, the Increased use of web-based applications has led to an increase in the variety of applications in capability and function. This has also lead to an increase in the size and complexity of these applications. In some cases, the size and complexity of the applications may ma e it so that even with optimizations, the applications use a substantial amount of resources, take a long time to load, and so forth. This has led to an increased usage of a just-in-time programming model that tries to complete optimizations just as resources are being used. However, this may still be inefficient for complex applications.
[00101 instead, techniques disclosed herein relate to pre-compiling and preoptimizing portions of a JavaScript virtual machine (JSVM) that frequently reach a consistent execution state at some point during their use. These pre-optimized portions may then be injected as requested into a JSVM that is also compiling and optimizing other portions of the JSVM that, for example, reach different execution states dependent on inputs. The preoptimized portions may include compiled and optimized code, memory and state information, and so forth such that the pre- optimized portion is ready to begin operation in the JSVM without additional preprocessing.
[0011] it is appreciated that, in the following description, numerous specific details are set forth to provide a thorough understanding of the examples. However, it is appreciated that the examples may be practiced without limitation to these specific details. In other instances, methods and structures may not be described in detail to avoid unnecessarily obscuring the description of the examples. Also, the examples may be used in combination with each other.
[0012] “Module*, as used herein, includes but is not limited to hardware, instructions stored on a computer-readable medium or in execution on a machine, and/or combinations of each to perform a function(s) or an action(s), and/or to cause a function or action from another module, method, and/or system. A module may include a microprocessor controlled via instructions executable by the microprocessor, a discrete module, an analog circuit, a digital circuit, a programmed module device, a memory device containing instructions, an so on. Modules may include gates, combinations of gates, or other circuit components. Where multiple logics! modules are described, it may be possible to incorporate the multiple logical modules into one physical module. Similarly, where a single logical module is described, it may be possible to distribute that single logical module between multiple physical modules
[0013] Figure 1 illustrates an example host 100 associated with JavaScript environment initialization. In various examples, host 100 may be responsible for delivering content requested by an application 140 By way of illustration, application 140 may be a web browser, and host 100 may be a server on which content being requeste by application 140 is located. While an example of a web browser and server is used to facilitate discussion of Figure 1 , it should be appreciated that other applications 140 may incorporate JSVMs 150, and therefore techniques disclosed herein may have applicability for other non-web browser types of applications 140. Further, host 100 may not be remote to application 140, as in certain examples a certain device may perform the roies of both host 100 and application 140.
[0014] in various examples, JSVM 150 may be associated with performing some function that is to be incorporated into or displayed by application 140. As will be appreciated, a JSVM 150 may be designed to perform a wide variety of functions because JavaScript is a core technology of the Internet that is often used to facilitate interactivity in web pages. To that end, most web browsers have a dedicated runtime monitor 145 to compile and optimize received JavaScript code 110 and execute it as JSVM 150. JavaScript is used, for example, for gaming, productivity, user interface support, performing data analysis, and so forth.
[001 S] When application 140 requests a resource from host 100 that involves JSVM 150, host 100 will typically transmit portions of JavaScript code 110 used to build JSVM 150. Application 140 may then provide the code portions to application runtime monitor 145. Application runtime monitor 145 will then perform a variety of tasks on the JavaScript code 110 to generate JSVM 150. These tasks may include, for example, compiling the JavaScript code 110 into instructions interpretable by a processor of a device operating application 140, opti izing the code, and so forth. For examples where the amount JavaScript Code 110 needed to generate JSVM 150 is relatively small, application runtime monitor 145 may be able to compile, optimize, and control execution of the entirety of JSVM 150. However, performing a single pass optimization of a relatively larger sets of JavaScript code 1 10 may be slower due to the increasing complexity and length of the code base resulting from the expanding functionalities of embedded JSVMs 150. This is especially true when the JSVMs are being used to perform data analysis on big data sets, Involve complex graphics or interactivity, and so forth as these tasks may invoke specialized libraries and/or frameworks for performing these tasks. Some example specialized libraries may include, for example, JGuery, AngularJS, React, Vue.JS, D3.JS, HighCharts, and so forth. In the cases where it is less feasible to compile an optimize an entire JSVM 150 at once, application runtime monitors 145 have begun to build efficiency by compiling and/or optimizing portions of JavaScript Code 1 10 either just in time or as they are requested by other portions of already executing JSVM 150. However, this may still be inefficient as building the portions as needed may slow down execution of JSVM 150 if those portions take time to compile and optimize.
[0016] Consequently, techniques disclosed herein may provide faster building and execution of JSVMs 150 by application 140. This may be achieved by generating JavaScript environments (JSE) 130 and injecting the JSEs into JSVM 150 by application runtime monitor 145. The JSEs 130 may be generated by optimization module 120. To build the JSEs, optimization module 120 may effectively act as an application runtime monitor 145 and build JSVM 150 several times with the goal of identifying portions of JavaScript code 1 10 that optimize to a consistent state. In some examples, optimization module 120 may build JSVM 150 using a variety of input sets
to further identification of portions of JavaScript code 110 that optimize to a consistent state. When portions of JavaScript code 1 10 that optimize to a consistent state are identified, optimization module 120 may store the portions as JSEs 130 in host 100 The JSEs 130 may include executable code, and other state information including initialized variables and other memory information. Effectively, the stored JSEs 130 may be a binary representation of an application state of a corresponding portion of JavaScript code 1 10. The application state may then either be replayed in the future, using the preserved optimizations, or transferred to a JSVM 150 on another device and executed from the preserved state
[00173 By way of illustration, in this example, host 100 stores three portions of JavaScript code 110 including portion 112, portion 114, and portion 118 that are associated with building JSVM 150. These portions may be fed to optimization module 120 that identifies that portions 114 and 116 optimize to a consistent state. Optimization may then store JSE versions 134 and 136 of code portions 114 and 116 respectively. As portion 112 may not optimize to a consistent state (e.g., because its optimizations are dependent on factors that change between executions), optimization module 120 may not store a JSE 130 for code portion 112 When application 140 requests an asset associated with JSVM 150, host 100 may look to see if JSEs 130 have been created for the portions of JavaScript code 110 associated with JSVM 110. For code portions which are not associated with a JSE 130 (e.g , portion 112) host 100 may transmit those portions as JavaScript code to application 140 to be built and executed as would have been done previously by application runtime monitor 145. However, for portions of JavaScript code 110 for which a JSE 130 exists (e.g., portion 114, portion 116), hosts 100 may instead transmit the JSEs 130 {e.g., JSE 134, JSE 136) Consequently, instead of building the code portions from scratch, application runtime monitor 145 may inject the pre-buiit and pre-inifiaiized JSEs at the appropriate point in time, saving application runtime monitor 145 from having to optimize these portions itself.
[00183 injecting a JSE 130 into the JSVM 150 may include inserting into a memory associated with JSVM: 150, portions of the JSE 130 in such a way that the JSVM 150 operates as if the JavaScript code 110 associated with the JSE 130 had
been compiled and optimized by runtime monitor 145. This may include inserting instructions associated with the JSE 130 into memory, updating memory values and/or locations to pre-initialized values associated with JSE 130, and so forth,
[0019] it should be appreciated however, that the ability to inject a JSE 130 into other JavaScript code to facilitate building a JSVM 150 may not be allowed by certain applications 140 and/or application runtime monitors 145, To that end, host 100 may also store an application runtime monitor 145 that supports this functionality and provide runtime monito 145 to application 140 when appropriate. In other examples, application runtime monitor 145 may be able to be controlled to inject the JSEs 130 using debugging hooks that are native to the JSE 130. Eventually, native runtime monitors may be designed to support injection of JSEs 130 into JSVMs 150, To prevent injection of malicious code using techniques described herein, host 100 and application 140 may also negotiate code signing based on trusted authorities to ensure that code in execution is secure and wili not harm a device on which application 140 is operating.
[0020J Pre-building and injectin JSEs 130 into a JSVM 150 may speed up the optimization process associated with executing a JSVM. This may be because application runtime monitor 145 does not have to go through the process of compiling and optimizing JavaScript code portions 110 when initializing the JSVM 150. Additionally, because JSVMs may be recreated several times due to, for example, reloading a webpage, having the JSE's ready in advance may allow the JSVM 150 to be reloaded without having to repeat the compiling and optimization process.
£00213 Figure 2 Illustrates an example method 200 Method 200 may be embodied on a non-transitor processor-readable medium storing processor- executable instructions. The instructions, when executed by a processor, may cause the processor to perform method 200. In other examples, method 200 may exist within logic gates and/or RAM: of an application specific integrated circuit (ASIC).
[00223 Method 200 ma perform various tasks associated with JavaScript environment initialization. For example, method 200 includes creating a JavaScript environment (JSE) at 220. The JSE may be created by initializing a portion of a
JavaScript virtual machine (JSVM). The JSVM may be initialized to a point at which the portion of the JSVM; has a known consistent state in some examples, the JSE may include a binary image of a state of the portion of the JSVM . Thus, the JSE may include complied and optimized code, initialized variables, and so forth.
10023] Method 200 also includes receiving a request for an asset at 230. The asset may incorporate the JSVM. The request may be received from an application. The application may be, for example, a web page.
[0024] Method 200 also includes transmitting the JSE to the application at 240. This may ailow the application to inject the JSE into a version of the JSVM that the application is building.
[0025] Figure 3 illustrates a method 300 associated with JavaScript environment initialization. Method 300 includes several actions similar to those described above with reference to method 200 (Figure 2). For example, method 300 includes creating a JavaScript environment (JSE) at 320 from a portion of a JavaScript virtual machine (JSVM), receiving an asset request from an application at 330, and transmitting the JSE to the application at 340.
10026] Method 300 also includes identifying a point at which the portion of the JSVM has a known consistent state at 310. This may be achieved by repeatedly compiling and executing the portion of the JSVM. f0O27] Method 300 also includes transmitting an uninitialized portion of the JSV to the application at 350. The uninitialized portion of the JSVM may be compiled and optimized by a runtime monitor initiated by the application. The application may then incorporate the uninitialized portion and the initialized portion to perform a function.
[0028] To incorporate the uninitialized portion and the initialized portion together, the application may need to use a runtime monitor that supports injecting the JSE into a portion of code that the application has compiled and optimized itself in some examples, the application may use a runtime monitor to compile and build JavaScript code to perform a function. If it is determined at 360 that a runtime monitor
avasiabie to the application supports injection of the JSE, method 300 may include controlling the application to inject the initialized JSE info the local runtime monitor at 375 This may use an interface of the local runtime monitor, which may facilitate injection of certain types of complied code via debugging hooks in other examples, a runtime monitor that supports injection of the initialized JSE may need to be provided to the application, in which case method 300 may proceed to action 370 and transmit the application a custom runtime monitor,
[00293 Figure 4 illustrates a system 400, System 400 includes a data store 410 Data store 410 may store a set of uncompiled portions of a JavaScript virtual machine (JSVM)
[00303 System 400 also includes an optimization module 420. Optimization module 420 may build portions of the JSVM to identify portions of the JSVM that optimize to a consistent state A portion that optimizes to a consistent state may be a portion that reaches a reproducible execution point for different input sets for the JSVM. Optimization module 420 may also store initialized versions of the portions of the JSVM that optimize to consistent states. These initialized versions may be stored as JavaScript environments (JSEs) The JSEs may be stored in data store 410
[00313 System 400 aiso includes a delivery module 430. Delivery module 430 may receive a request for an asset associated with the JSVM from an application 499 Application 499 may be, for example, a web browser. In response to the request, delivery module 430 may deliver portions of the JSVM to a runtime monitor associated with application 499 For portions of the JSVM that are not associated with a JSE in data store 410, delivery module 430 may deliver uncompiled versions of these portions. For portions of the JSVM that are associated with a JSE, delivery module 430 may the corresponding JSE.
[00323 In some examples, delivery module 430 may also control application 499 to use debugging hooks of a runtime monitor native to application 499 to inject the JSEs at appropriate locations of the JSVM In other examples, delivery module 430 may also deliver the runtime module to application 499. In these examples, the
runtime monitor delivered to the application may support injecting the JSEs at appropriate locations of the JSVM.
[0033] Figure 5 illustrates a method 500 associated with JavaScript environment initialization. Method 500 includes requesting an asset associated with a JavaScript virtual machine {JSVM) at 510.
[0034] Method 500 also includes receiving a JavaScript environment (JSE) associated with a portion of the JSVM at 520. The JSE may be associated with instructions that reach a reproducible execution point when compiled and optimized, despite different input sets for the JSVM. The JSE may include, for exampie, an initialized binary image of a state of the portion of the JSVM.
[0033] Method 500 also includes receiving an unoptimized portion of the JSVM at 530. Method 500 also includes constructing the JSVM at 540. The JSVM may be constructed by compiling and optimizing the unoptimized portion of the JSVM, and injecting the JSE at an appropriate point in the JSVM. In some examples, the JSE may be injected using debugging hooks associated with a native runtime monitor in other examples, method 500 may include receiving a runtime monitor that supports injecting the JSE into the JSVM.
[0033] Figure 6 illustrates an exampie computing device in which exampie systems and methods, and equivalents, may operate. The exampie computing device may be a computer 800 that includes a processor 810 and a memory 820 connected by a bus 630. Computer 600 includes a JavaScript environment initialization module 840. JavaScript environment initialization module 840 may perform, alone or in combination, various functions described above with reference to the exampie systems, methods, and so forth in different examples, JavaScript environment initialization module 640 may be implemented as a non-transitory computer-readable medium storing processor-executable instructions, in hardware, as an application specific integrated circuit, and/or combinations thereof
[0037] The instructions may also be presented to computer 600 as data 850 and/or process 660 that are temporarily stored in memory 820 and then executed by
processor 810. The processor 810 may be a variety of processors including dual microprocessor and other multi-processor architectures Memory 620 may include non-volatile memory (e.g , read-only memory, flash memory, memristor) and/or volatile memory (e.g., random access memory). Memory 620 may also be, for example, a magnetic disk drive, a solid state disk drive, a floppy disk drive, a tape drive, a flash memory card, an optical disk, and so on. Thus, memory 620 may store process 660 and/or data 650. Computer 600 may also be associated with other devices including other computers, devices, peripherals, and so forth In numerous configurations (not shown).
[00381 it is appreciated that the previous description of the disclosed examples is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these examples will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other examples without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not Intended to be limited to the examples shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
What is claimed is:
1. A method, comprising:
create a JavaScript environment (JSE) b initializing a portion of a JavaScript virtual machine (JSVM) to a point at which the portion of the JSVM has a known consistent state;
receiving a request for an asset that incorporates the JSVM from an application; and
transmitting the JSE to the application.
2. The method of claim 1, comprising transmitting the application a customized runtime monitor that supports injecting the JSE.
3. The method of claim 1 , comprising controlling the application to inject the initialized JSE into a local runtime monitor using an interface of the local runtime monitor
4. The method of claim 1 , comprising transmitting an uninitialized portion of the JSVM to the application
5. The method of claim 4, where the uninitialized portion of the JSVM is compiled and optimized by a runtime monitor initiated by the application, and where the application incorporates the uninitialized portion and the initialized portion to perform a function.
8. The method of claim 1 , repeatedly compiling an executing the portion of the JSVM several times to identify the point at which the portion of the JSVM has the known consistent state.
7. The method of claim 1 , where the JSE includes a binary image of a state of the portion of the JSVM including compiled and optimized code, and initialized variables
8, A system, comprising:
a data store to store a set of uncompiled portions of a JavaScript virtual machine (JSVM);
an optimization module to build portions of the JSVM to identify portions of the JSVM that optimize to a consistent state, and to store initialized versions of the portions of the JSV that optimize to a consistent state in the data store as
JavaScript environments; and
a delivery module to, in response to a request for an asset associated with the JSVM from an application, deliver to a runtime monitor associated with the application, uncompiled portions of the JSVM for portions of the JS M that are not associated with a JavaScript environment, and JavaScript environments tor portions of the JSVM for which a JavaScript environment has been stored.
9. The system of clai 8, where a portion that optimizes to a consistent state Is a portion that reaches a reproducible execution point for different input sets for the JSVM.
10 The system of claim 8, where the delivery module also delivers the runtime monitor to the application, and where the runtime monitor delivered to the application supports Injecting lie JavaScript environments at appropriate locations of the JSVM
11 The system of claim 8, where the delivery module controls the application to use debugging hooks of a runtime monitor native to the application to inject the JavaScript environments at appropriate locations of the JSVM.
12. The system of claim 8 where the application is a web browser.
13. A non-fransitory computer-readable medium storing processor executable instructions that, when executed by a computer, control the computer to: request an asset associated with a JavaScript virtual machine (JSVM);
receive a JavaScript environment (JSE) associated with a portion of the JSVM, where the JSE is associated with instructions that when optimized, reach a reproducible execution point for different input sets for the JSVM, and where the JSE includes an Initialized binary image of a state the portion of the JSVM;
receive an unoptimized portion of the JSVM; and
construct the JSVM: by compiling and optimizing the unoptimized portion of the JSVM and injecting the JSE at an appropriate point in the JSVM.
14. The non-transitory computer-readable medium of claim 13, where the instructions further control the computer to receive a runtime monitor that supports injecting the JSE into the JSVM
15. The non-transitory computer-readable medium of claim 13, where the JSE is injected using debugging hooks associated with a native runtime monitor.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/US2018/053036 WO2020068080A1 (en) | 2018-09-27 | 2018-09-27 | Javascript environment initialization |
| US17/046,855 US20210216340A1 (en) | 2018-09-27 | 2018-09-27 | Javascript environment initialization |
| CN201880093043.5A CN112041814A (en) | 2018-09-27 | 2018-09-27 | JAVASCRIPT Environment initialization |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/US2018/053036 WO2020068080A1 (en) | 2018-09-27 | 2018-09-27 | Javascript environment initialization |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020068080A1 true WO2020068080A1 (en) | 2020-04-02 |
Family
ID=69950126
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/US2018/053036 Ceased WO2020068080A1 (en) | 2018-09-27 | 2018-09-27 | Javascript environment initialization |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20210216340A1 (en) |
| CN (1) | CN112041814A (en) |
| WO (1) | WO2020068080A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114035799B (en) * | 2021-11-15 | 2022-12-06 | 上海闪马智能科技有限公司 | Network file compiling method and device, storage medium and electronic device |
| CN113867902B (en) * | 2021-12-03 | 2022-03-08 | 北京翼辉信息技术有限公司 | Method, device and storage medium for controlling program execution |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060101468A1 (en) * | 2004-10-25 | 2006-05-11 | Microsoft Corporation | Cooperative threading in a managed code execution environment |
| US20070186150A1 (en) * | 2006-02-03 | 2007-08-09 | Raosoft, Inc. | Web-based client-local environment for structured interaction with a form |
| US20090024986A1 (en) * | 2007-07-19 | 2009-01-22 | Microsoft Corporation | Runtime code modification |
| US20130227354A1 (en) * | 2012-02-23 | 2013-08-29 | Qualcomm Innovation Center, Inc. | Device, method, and system to enable secure distribution of javascripts |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7512664B1 (en) * | 1999-01-28 | 2009-03-31 | Texas Instruments Incorporated | System and method for loading resolved java class files to a client device |
| US7065755B2 (en) * | 2001-03-15 | 2006-06-20 | Sun Microsystems, Inc. | Method and apparatus for removing class initialization barriers from shared compiled methods |
| US7426720B1 (en) * | 2003-12-22 | 2008-09-16 | Sun Microsystems, Inc. | System and method for dynamic preloading of classes through memory space cloning of a master runtime system process |
| US8539464B2 (en) * | 2008-10-30 | 2013-09-17 | International Business Machines Corporation | Distributed just-in-time compilation |
-
2018
- 2018-09-27 WO PCT/US2018/053036 patent/WO2020068080A1/en not_active Ceased
- 2018-09-27 CN CN201880093043.5A patent/CN112041814A/en active Pending
- 2018-09-27 US US17/046,855 patent/US20210216340A1/en not_active Abandoned
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060101468A1 (en) * | 2004-10-25 | 2006-05-11 | Microsoft Corporation | Cooperative threading in a managed code execution environment |
| US20070186150A1 (en) * | 2006-02-03 | 2007-08-09 | Raosoft, Inc. | Web-based client-local environment for structured interaction with a form |
| US20090024986A1 (en) * | 2007-07-19 | 2009-01-22 | Microsoft Corporation | Runtime code modification |
| US20130227354A1 (en) * | 2012-02-23 | 2013-08-29 | Qualcomm Innovation Center, Inc. | Device, method, and system to enable secure distribution of javascripts |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112041814A (en) | 2020-12-04 |
| US20210216340A1 (en) | 2021-07-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Gackstatter et al. | Pushing serverless to the edge with webassembly runtimes | |
| US9645804B2 (en) | Extracting source code | |
| US8533666B2 (en) | Interactive design environments to visually model, debug and execute resource oriented programs | |
| US8799889B2 (en) | Application downloading | |
| US8832690B1 (en) | Multi-threaded virtual machine processing on a web page | |
| WO2013091556A1 (en) | Browser based application program extension method and device | |
| CN105224363A (en) | Method and device for loading application program | |
| US9880943B2 (en) | Cache management in a multi-threaded environment | |
| US11176223B1 (en) | Page rendering by an intermediary system that uses a truncated library | |
| Mickens et al. | Crom: Faster Web Browsing Using Speculative Execution. | |
| US20210216340A1 (en) | Javascript environment initialization | |
| CN116305011A (en) | Application protection method and installation method | |
| US8694961B2 (en) | Thread-agile execution of dynamic programming language programs | |
| US20260004384A1 (en) | Page rendering method | |
| CN107066255A (en) | A kind of the Internet of Things apparatus control method and device of shared Internet of Things apparatus logic | |
| CN114995847A (en) | Hot update method, device, equipment and computer readable storage medium | |
| CN111190693A (en) | Method and device for building cloud platform based on Roc platform | |
| Kozlovics | The Web Computer and Its Operating System: A New Approach for Creating Web Applications. | |
| Puder | A cross-language framework for developing ajax applications | |
| US11237826B2 (en) | Application ownership enforcement | |
| KR102863879B1 (en) | A code refinement device for analyzing apk file and a security system including the same | |
| Tricoire et al. | KevoreeJS: Enabling dynamic software reconfigurations in the Browser | |
| Husák | Client-side execution of PHP applications compiled to. NET | |
| CN115587623A (en) | Method for constructing virtual environment for training model and method for training model | |
| Duszyński | The Future of. NET |
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: 18935508 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18935508 Country of ref document: EP Kind code of ref document: A1 |