Chakra, though only one of the browser subsystems – is itself comprised of several components which work together to process and execute JavaScript code. When the browser downloads a JavaScript file it hands its content over to Chakra’s parser to verify its syntactical correctness. This is the only operation that applies to the entire file. Subsequent steps are performed individually on each function (including the global function). As a function is about to be executed (the global function is run immediately after parsing) Chakra’s parser builds an abstract syntax tree (AST) representation of the code, and hands it off to the bytecode generator, which produces an intermediate form (bytecode) suitable for execution by the interpreter (but not directly by the CPU). Both the AST and the function bytecode are preserved so they don’t need to be recreated on subsequent executions. The interpreter is then invoked to run the function. As the interpreter executes individual operations it collects information (a profile) about the types of inputs it encounters and keeps track of how many times the function was called.
IE10 JavaScript enhancements detailed
Posted on Thursday, June 14 2012 @ 17:06 CEST by Thomas De Maesschalck