Concurrent parsing and processing of HTML and JAVASCRIPT®
First Claim
1. A method for executing a markup language code in a processor, comprising:
- receiving in the processor a request to load a web page;
receiving markup language code associated with the requested web page, the markup language code including embedded scripting language code;
parsing the received markup language code to generate parse data until a segment of scripting language code is encountered;
packaging the encountered segment of scripting language code and parsing state information in an execution state package upon encountering the segment of scripting language code;
storing the execution state package in a scripting language script queue;
continuing parsing the received markup language code;
obtaining the segment of scripting language code from the scripting language script queue;
executing the obtained segment of scripting language code concurrent with continued parsing of the markup language code;
determining whether markup language code generated from the execution of the obtained segment of scripting language code is well formed;
when it is determined that the generated markup language code is well formed, storing the generated markup language code; and
when it is determined that the generated markup language is not well formed;
retrieving the parsing state information packaged in the execution state package;
discarding parse data resulting from parsing of the markup language code after a point in the markup language code identified by the retrieved execution state package; and
re-initiating parsing of the markup language code from the point in the markup language code identified by the retrieved execution state package.
1 Assignment
0 Petitions
Accused Products
Abstract
The aspects enable a processor to concurrently execute markup language code (e.g., HTML) having embedded scripting language code (e.g., JAVASCRIPT®) during a page load operation by a browser. A markup language parser parses markup language code until embedded scripting language code is encountered. The segment of embedded scripting language code is extracted for execution by a scripting language engine which proceeds concurrently with speculative parsing of the markup language code. Markup language code generated by execution of scripting language code is evaluated to determine if it is well formed, and a partial rollback of the markup language parse and re-parsing of portions of the markup language code is accomplished if not. Concurrent parsing of markup language code and execution of scripting language code, with partial roll back of the parsing process when necessary, continues until all markup language code has been parsed and all scripting language code has been executed.
-
Citations
36 Claims
-
1. A method for executing a markup language code in a processor, comprising:
-
receiving in the processor a request to load a web page; receiving markup language code associated with the requested web page, the markup language code including embedded scripting language code; parsing the received markup language code to generate parse data until a segment of scripting language code is encountered; packaging the encountered segment of scripting language code and parsing state information in an execution state package upon encountering the segment of scripting language code; storing the execution state package in a scripting language script queue; continuing parsing the received markup language code; obtaining the segment of scripting language code from the scripting language script queue; executing the obtained segment of scripting language code concurrent with continued parsing of the markup language code; determining whether markup language code generated from the execution of the obtained segment of scripting language code is well formed; when it is determined that the generated markup language code is well formed, storing the generated markup language code; and when it is determined that the generated markup language is not well formed; retrieving the parsing state information packaged in the execution state package; discarding parse data resulting from parsing of the markup language code after a point in the markup language code identified by the retrieved execution state package; and re-initiating parsing of the markup language code from the point in the markup language code identified by the retrieved execution state package. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A computing device for executing a markup language, comprising:
-
a memory; and a processor coupled to the memory, wherein the processor is configured with processor-executable instructions to perform operations comprising; receiving in the processor a request to load a web page; receiving markup language code associated with the requested web page, the markup language code including embedded scripting language code; parsing the received markup language code to generate parse data until a segment of scripting language code is encountered; packaging the encountered segment of scripting language code and parsing state information in an execution state package upon encountering the segment of scripting language code; storing the execution state package in a scripting language script queue; continuing parsing the received markup language code; obtaining the segment of scripting language code from the scripting language script queue; executing the obtained segment of scripting language code concurrent with continued parsing of the markup language code; determining whether markup language code generated from the execution of the obtained segment of scripting language code is well formed; when it is determined that the generated markup language code is well formed, storing the generated markup language code; and when it is determined that the generated markup language is not well formed; retrieving the parsing state information packaged in the execution state package; discarding parse data resulting from parsing of the markup language code after a point in the markup language code identified by the retrieved execution state package; and re-initiating parsing of the markup language code from the point in the markup language code identified by the retrieved execution state package. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
-
25. A non-transitory storage medium having stored thereon processor-executable software instructions configured to cause a processor to perform operations for executing a markup language code, the operations comprising:
-
receiving in the processor a request to load a web page; receiving markup language code associated with the requested web page, the markup language code including embedded scripting language code; parsing the received markup language code to generate parse data until a segment of scripting language code is encountered; packaging the encountered segment of scripting language code and parsing state information in an execution state package upon encountering the segment of scripting language code; storing the execution state package in a scripting language script queue; continuing parsing the received markup language code; obtaining the segment of scripting language code from the scripting language script queue; executing the obtained segment of scripting language code concurrent with continued parsing of the markup language code; determining whether markup language code generated from the execution of the obtained segment of scripting language code is well formed; when it is determined that the generated markup language code is well formed, storing the generated markup language code; and when it is determined that the generated markup language is not well formed; retrieving the parsing state information packaged in the execution state package; discarding parse data resulting from parsing of the markup language code after a point in the markup language code identified by the retrieved execution state package; and re-initiating parsing of the markup language code from the point in the markup language code identified by the retrieved execution state package. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
Specification