How does javascriptcore and V8 interact with WebCore?

Source: Internet
Author: User

The data structure of WebCore: frame contains the data member kjsproxy * m_jscript.CodeAdjusted to jsbridge * m_jscript. For different implementations of javascriptcore and V8, they are:
Class kjsbridge: Public jsbridge {
Public:
Kjsbridge (frame * frame): m_proxy (New kjsproxy (FRAME )){}
Virtual ~ Kjsbridge () {Delete m_proxy ;}
........................
PRIVATE:
Kjsproxy * m_proxy;
};

Class v8bridge: Public jsbridge {
Public:
Explicit v8bridge (frame * frame );
Virtual ~ V8bridge ();
.......................
PRIVATE:
V8proxy * m_proxy;
};
V8bridge: v8bridge (frame * frame ){
M_proxy = new v8proxy (FRAME );
}
V8bridge ::~ V8bridge (){
Delete m_proxy;
}

Different kjsproxy and v8proxy correspond to different JavaScript implementations, which implement the common interfaces with WebCore. Their main data structures are as follows:
Class kjsproxy {
Frame * m_frame;
KJS: protectedptr <KJS: jsdomwindow> m_globalobject;
Int m_handlerlineno;
.........................................
};

Class v8proxy {
Frame * m_frame;
V8: Persistent <V8: context> m_context;
V8: Persistent <V8: Object> m_global;
// Special handling of document wrapper;
V8: Persistent m_document;
Int m_handlerlineno;
...........................
};
Different JavaScript implementation logics are required to understand how different JavaScript implementations implement interfaces with WebCore;

If you are interested in the Implementation logic and basic principles of JavaScript, you can refer to the API and sample provided by JavaScript;

As for the implementation of Dom binding, javascriptcore and V8 are implemented in the same way. For more information, see WebCore of WebKit.
How to integrate the Javascript Implementation described in with WebCore;

From: Introduction to javascriptcore/V8 in WebKit
(Self-supplied ladder)

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.