2

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:

  1. Parsing
  2. Code Generation
  3. Execution

Based on this summary, how and when is execution context creation and execution related to steps from #1 to #3 above?

kiner_shah
4,8337 gold badges30 silver badges47 bronze badges
asked Sep 5, 2019 at 5:32
1
  • Maybe after bytecode is generated the parser calls the bytecode interpreter which interprets and executes the bytecode. Commented Sep 5, 2019 at 5:37

1 Answer 1

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.

v8 execution pipeline

answered Sep 5, 2019 at 7:57
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.