[Webkit-unassigned] [Bug 99118] JSC Should atomize constant strings before handing them to WebCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 12 12:58:07 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99118





--- Comment #6 from Eric Seidel <eric at webkit.org>  2012-10-12 12:58:50 PST ---
(In reply to comment #5)
> JSC does intern all string literals in source code.  I'm unsure how feasible sharing jsc's interned strings with AtomicString is (multiple JSC contexts have separate interned strings for the same literal for example).  Also it would require some communication between JSC and WebCore of the sort that would be easier if we weren't having to deal with two JS engines.

For what it's worth, I believe v8 has the same bug.

> That said, what strings are we seeing that aren't being atomised?

The case is that "*" or "div" or whatever the author has specified is correctly being Interned (as you noted above), but then that same Interned StringImpl is being handed to getElementsByTagName, getElementById, etc. every time.  Since that StringImpl is not marked isAtomic(), we do a hash-lookup to find the corresponding Atomized StringImpl (which is slow):
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/text/AtomicString.h#L176

A win here would either be to have JSC use the same underlying StringImpl as WebCore (or vice-versa), or to have some fancy way to map between them.

One possible fix might be to pre-warm JSC's unique StringImpl table with the ones from WebCore?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list