[webkit-dev] Hash tables and unique string identifiers in JavaScriptCore

Stephen Lin swlin at post.harvard.edu
Tue Sep 18 22:07:57 PDT 2012


I just started working with webkit (specificially JSC) and am trying to
learn the codebase. I hope someone can bear with me enough to help me with
some questions:

1. I notice there are at least two implementations of hash tables in
JavaScriptCore/runtime, in Lookup.h and PropertyMapHashTable.h. Which, if
either, is used in, say, the normal case of accessing the properties of a
DOM element, like "window.location", etc.? And assuming it's one or the
other, what's the main use case of the other one?

2. Also, it looks like string keys in Lookup.h are always "Identifier"s,
meaning (I think) that they are guaranteed to be single unique entries in
the "identifierTable" of a JSGlobalData object. Because of this
preprocessing, string equality in the hash table implementation can be
tested just by comparing addresses. Is there any reason
why PropertyMapHashTable.h does not (as far as I can tell) do the same

3. Does the JIT side of the codebase use unique string identifiers like
Lookup.h does, or is that a whole different ballgame?

Thanks very much in advance for help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120919/e27caeac/attachment.html>

More information about the webkit-dev mailing list