JS engine javascriptcore

Source: Internet
Author: User
Tags lexer

 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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.