[jsc-dev] bmalloc freelist from JIT code

Yusuke SUZUKI utatane.tea at gmail.com
Thu Nov 2 12:37:04 PDT 2017


Hello JSC folks!

Recently, I introduced a String method intrinsic StringSlice into DFG.
And I'm planning to add StringSubstring and StringSubstr too, which can
share a large part of StringSlice implementation.

At that time, I noticed that these functions can become super efficient if
we can allocate bmalloc-managed object from JIT code by using freelist. If
we have such mechanism, we can allocate substringed StringImpl in JIT code.
Those object's size should be the same at the call site, thus simple free
list for a specific size works fine. (sizeof(StringImpl) + substring slot).

We already have JSRopeString. Since JSRopeString can hold an owner
JSString, we can represent substringed string with JSRopeString + JSString.
But our runtime and WebCore strongly relies on WTFString / StringImpl. Thus
they typically attempt to resolve these ropes. So, JSRopeString is
typically useful if it is used in series of + operators. And it is not so
useful if we use JSRopeString for slice/substring etc.

So, my question is, is it feasible to consider adding a freelist mechanism
to bmalloc that can be used from JIT?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/jsc-dev/attachments/20171103/c07d25b1/attachment.html>


More information about the jsc-dev mailing list