Changes between Version 9 and Version 10 of DOMInJavaScript


Ignore:
Timestamp:
Sep 27, 2012 12:13:59 AM (12 years ago)
Author:
abarth@webkit.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DOMInJavaScript

    v9 v10  
    1616Node* Node::nextSibling()
    1717{
    18     m_wrapper->getAtKnownOffset(kNextSiblingOffset)->impl();
     18    m_wrapper->getPropertyAtKnownOffset(kNextSiblingOffset)->impl();
    1919}
    2020
    2121void Note::setNextSibling(Node* node)
    2222{
    23     m_wrapper->setAtKnownOffset(kNextSiblingOffset, node->m_wrapper);
     23    m_wrapper->setPropertyAtKnownOffset(kNextSiblingOffset, node->m_wrapper);
    2424}
    2525}}}
     
    2727In order to get or set the nextSibling property, the C++ code needs to consult its JavaScript wrapper. (Note: This implies that we'll need to eagerly create JavaScript wrappers for DOM nodes.) In this approach, the JavaScript wrapper stores the four DOM pointers at fixed offsets in memory, letting the C++ code read or write the property directly rather than having to do a hash table lookup.
    2828
    29 My understanding is that getAtKnownOffset is similar to JSC::JSObject::getDirectOffset. The key is to create JavaScript wrappers for DOM nodes in such a way that initial offsets are know to correspond to particular properties (e.g., the four basic DOM pointers.)
     29My understanding is that getPropertyAtKnownOffset is similar to JSC::JSObject::getDirectOffset. The key is to create JavaScript wrappers for DOM nodes in such a way that initial offsets are know to correspond to particular properties (e.g., the four basic DOM pointers.)