[webkit-dev] Replacing symbol files with source level annotations

Hajime Morrita morrita at chromium.org
Mon Nov 21 02:28:46 PST 2011

Hi folks,

I'm working on replacing the symbol lists with source-level annotations.
And I'd like to ask for your help and review the work.

The first target is JavaScriptCore.exp since JSC is smaller than
WebCore thus easier to attack, and the Mac port maintains the most
comprehensive symbol list.

My plan is to use an automation tool for rewriting the code.
The tool inserts JSC_EXPORT_PRIVATE and its variants for functions and variables
whose symbols are specified in JavaScriptCore.exp.

Here is the current result:

 * The tool: https://github.com/omo/ListExportables
   README.txt explains how to run it.Note that it's for Mac OS and Mac port.

 * A snapshot diff of the generated rewrite:

 * To make the rewrite build-able, we need to land a few changes:
   * https://bugs.webkit.org/show_bug.cgi?id=72862
   * https://bugs.webkit.org/show_bug.cgi?id=72853
   * https://bugs.webkit.org/show_bug.cgi?id=72858

After applying these changes, rewritten code can be built on Mac Snow
Leopard without the export list. I guess it's also buidable for other
versions of Mac with no ... or few modifications.

The advantages of this automate rewrite are:

 * We can write whole JSC code at once. So the result is verifiable
   before landing it.

 * We can land it anytime. For example, I can run the script and land
   the result at the weekend midnight. This would minimize the impact
   of landing.

 * There are fewer chances to over-export and miss-export symbols
   because the rewrite locations are based on the exp file.

I'd like to ask, especially for some Mac build expert ...

 * Please try the rewrite result. You can run the tool by yourself,
   or I can generate the result for specific revision of WebKit for you.

 * Please review blocking problems: http://webkit.org/b/72862,
http://webkit.org/b/72853, http://webkit.org/b/72858
   I think these are trivial and is no harm to land this even without
the rewrite.

 * Once the idea looks OK for you, rubberstamp the rewrite result ;-)

Once this rewrite is in the tree. it would be easy to attack other
ports like GTK and Windows.
There are some remaining tasks for using this tool against WebCore.
But I think JSC is a good starting point.

Here is the master bug: https://bugs.webkit.org/show_bug.cgi?id=67852

Any advice, feedbacks and reviews are welcome!
I hope our frequent build breakers to retire.


More information about the webkit-dev mailing list