On-demand loading of dynamic scripting language code for reduced memory usage
Abstract
A computer-implemented method and system for reducing the amount of memory space required to store applications written in dynamic scripting languages loads a program module into memory and removes a category of program code, such as debug information or function definitions, from the program module. The method and system also receives a request for debug information, or a function call or query, and determines whether or not the corresponding program code is in memory. If not, then the location in storage is identified where the program module is stored, and another copy containing the corresponding program code is loaded into memory. The corresponding program code is located and copied into the program module in memory, and a response is provided to the request.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for on-demand loading of code, the method comprising:
compiling, by one or more processors, a dynamic scripting language program source code into compiled bytecode, with the compiling the dynamic scripting language program source code including removing one or more function portions of one or more functions, the one or more removed function portions including debug information; receiving, by the one or more processors, a call or query request for a removed function portion of the compiled bytecode; obtaining, by the one or more processors in response to the call or query request, a replacement function source code corresponding to the removed function portion, the replacement function source code being in the dynamic scripting language; compiling, by the one or more processors, the replacement function source code to generate a compiled replacement bytecode for the removed function portion; and modifying, by the one or more processors, the compiled bytecode using the compiled replacement bytecode.
2 . The method of claim 1 , wherein the one or more removed function portions are removed from the dynamic scripting language program source code.
3 . The method of claim 1 , wherein the one or more removed function portions are removed from the compiled bytecode.
4 . The method of claim 1 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions.
5 . The method of claim 1 , further comprising the one or more processors generating one or more placeholders in the compiled bytecode, the one or more placeholders corresponding to the one or more removed portions.
6 . The method of claim 1 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions, with the one or more placeholders used in the modifying step to modify the compiled bytecode using the compiled replacement bytecode.
7 . The method of claim 1 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions, the one or more placeholders indicating where the replacement source code is stored.
8 . The method of claim 1 , the compiling, by the one or more processors, the replacement source code comprises:
creating, by the one or more processors, a compiled tree structure of the function, the compiled tree structure comprising the requested removed function portion; searching, by the one or more processors, the compiled tree structure to get the requested removed function portion.
9 . The method of claim 5 , wherein the modified compiled bytecode is executed within a virtual machine.
10 . A device comprising:
a memory comprising instructions; and one or more processors in communication with the memory, the one or more processors execute the instructions to: compile a dynamic scripting language program source code into compiled bytecode, with the compiling the dynamic scripting language program source code including removing one or more function portions of one or more functions, the one or more removed function portions including debug information; receive a call or query request for a removed function portion of the compiled bytecode; obtain in response to the call or query request, a replacement function source code corresponding to the removed function portion, the replacement function source code being in the dynamic scripting language; compile the replacement function source code to generate a compiled replacement bytecode for the removed function portion; and modify the compiled bytecode using the compiled replacement bytecode.
11 . The device of claim 10 , wherein the one or more removed function portions are removed from the dynamic scripting language program source code.
12 . The device of claim 10 , wherein the one or more removed function portions are removed from the compiled bytecode.
13 . The device of claim 10 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions.
14 . The device of claim 10 , further comprising the one or more processors generating one or more placeholders in the compiled bytecode, the one or more placeholders corresponding to the one or more removed portions.
15 . The device of claim 10 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions, with the one or more placeholders used in the modifying step to modify the compiled bytecode using the compiled replacement bytecode.
16 . The device of claim 10 , further comprising the one or more processors generating one or more placeholders corresponding to the one or more removed portions, the one or more placeholders indicating where the replacement source code is stored.
17 . The device of claim 10 , wherein the compiling, by the one or more processors, the replacement source code comprises:
creating, by the one or more processors, a compiled tree structure of the function, the compiled tree structure comprising the requested removed function portion; searching, by the one or more processors, the compiled tree structure to get the requested removed function portion.
18 . The device of claim 10 , wherein the modified compiled bytecode is executed within a virtual machine.Join the waitlist — get patent alerts
Track US2020249925A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.