Changes between Version 2 and Version 3 of DOMInJavaScript


Ignore:
Timestamp:
Sep 26, 2012 11:22:41 PM (9 years ago)
Author:
abarth@webkit.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DOMInJavaScript

    v2 v3  
    33== Overview ==
    44
    5 In this proposal, we upload the four basic DOM pointers (firstChild, lastChild, nextSibling, previousSibling) into the JavaScript engine so that they can be accessed more quickly from JavaScript. We then provide CPP an optimized code path for reading and writing these properties.
     5In this proposal, we upload the four basic DOM pointers (firstChild, lastChild, nextSibling, previousSibling) into the JavaScript engine so that they can be accessed more quickly from JavaScript. We then provide C++ an optimized code path for reading and writing these properties.
     6
     7== JavaScript ==
     8
     9The main change in this proposal is to move the four basic DOM pointers from C++ pointers to JavaScript properties. When accessing nextSibling, for example, from JavaScript, the JavaScript engine will simply read the nextSibling property as usual (and apply all its usual optimizations). The DOM structure, then, is stored in JavaScript.
     10
     11== C++ ==
     12
     13After moving the DOM pointers into the JavaScript VM, we'll still need to provide a fast path for C++ code to access the pointers.  Today, C++ simply reads a pointer from a fixed offset in the Node object. In this proposal, C++ code will need to take a slightly more indirect route: