Csdn lidp http://blog.csdn.net/perfectpdl
Javascriptcore is the JS engine provided by WebKit and implements the ecmascript 262 standard.
Although Google'sChromium uses WebKit as the rendering engine, but its JS engine uses V8 instead of javascriptcore,
Android browsers also use V8 as the JS engine by default.
Javascriptcore is released along with the WebKit source code in the source/JavaScript directory.
Like most script engines, javascriptcore contains the lexical parser, syntax parser, and interpreter.
Lexical parsing: Responsible for JSCodeLexical parsing generates a series of tokens. the lexical parsing code isParser/lexer. h and Parser/lexer. cpp directory
syntax analysis: the syntax analyzer analyzes the tockens generated by the lexical analyzer to generate the syntax tree. The code is in parser/jsparser. H and parser/jsparser. CPP.
Interpreter: The Interpreter executes the bytecode generated by the syntax analyzer. javascriptcore
there are two kinds of interpreters, one It is bytecode-based and JIT-based. The former is executed in a virtual machine and the latter generates local code. Obviously, the latter gets faster execution speed, this method is used by V8 by default. The Interpreter code can be found in JIT/
directory.