Can anybody point me to code that gets run when accessing a property on a DOM node in OSS rendering engines?
-
-
For Gecko the answer starts with "it depends on JIT level and type inference results" and goes on from there.
1 reply 0 retweets 1 like -
Also depends on whether the property getter is marked side-effect-free and whether there are CSE/LICM opportunities.
1 reply 0 retweets 0 likes -
And whether the property is annotated as "cached" in which case the JIT can read the cache directly without doing a vmcall.
2 replies 0 retweets 0 likes -
But assuming a vmcall happens and type inference works, you jump to something like https://dxr.mozilla.org/mozilla-central/search?q=function%3Amozilla%3A%3Adom%3A%3ANodeBinding%3A%3Aget_firstChild … direct from jitcode
1 reply 0 retweets 0 likes -
But note that there is also some jitcode overhead for the vmcall, etc.
1 reply 0 retweets 0 likes -
In general, for Gecko a prop get that does an actual vmcall will be about 20-30 machine instructions plus the C++ getter cost.
1 reply 0 retweets 0 likes -
Where C++ getter cost is not including the binding layer. For .firstChild C++ getter cost is a single mov, of course.
1 reply 0 retweets 0 likes
Oh, and if the get result needs a new reflector or is a string that will of course cost a bit more....
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.