For JS code to be executed, it is parsed by a parser line by line and if the code is invalid, an error message is displayed. If everything is correct then the parser produces a data structure known as Abstract Syntax Tree. This Abstract Syntax Tree is then used to generate the bytecode for an interpreter for execution.
The above quick analysis can be summarized into:
- Parsing
- Code Generation
- Execution
Based on this summary, how and when is execution context creation and execution related to steps from #1 to #3 above?
-
Maybe after bytecode is generated the parser calls the bytecode interpreter which interprets and executes the bytecode.kiner_shah– kiner_shah2019年09月05日 05:37:23 +00:00Commented Sep 5, 2019 at 5:37
1 Answer 1
JS engines are a bit more complex these days. There is a great up-to-date explanation here. It provides in-depth details on each step of the JS execution pipeline.