[Webkit-unassigned] [Bug 60950] Port the SmallStrings cache to Weak<T>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 17 16:46:46 PDT 2011


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





--- Comment #2 from Geoffrey Garen <ggaren at apple.com>  2011-05-17 16:46:46 PST ---
> - As a test to see if I could make it actually work I ported everything to Weak<T> and made the JIT try to get the JSString from inside the Weak<T> now exposed in the API.

That sounds fine. It just adds one pointer load to the cost of charCodeAt.

Did you measure the performance of your patch?

> This seems to work (in some cases), but I'm not sure if it makes any sense. In particular, I understand that the data behind a Weak<T> can change at any moment as a side effect of GC, so perhaps it just does not make any sense to generate code that does this.

If the JIT loads the JSString from the Weak<T>, it won't matter if the JSString in the Weak<T> has changed -- the JIT will correctly see the new value.

Is something going wrong in your code? It would be easier to diagnose if you posted your patch.

> I'm not sure who put that there, 

I did.

> If it's really necessary to have weak behaviour, we have sufficient control of this data to implement weak semantics directly in the buffer.

We have that now, but the implementation is a bit awkward. If the cost of an extra pointer load in these cases is not measurable, I think it would be an improvement to switch over to the more general Weak<T> implementation.

-- 
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