Bug 72231 - Add export macros to JSCore heap classes
Summary: Add export macros to JSCore heap classes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kevin Ollivier
URL:
Keywords:
Depends on:
Blocks: 27551 67852
  Show dependency treegraph
 
Reported: 2011-11-13 17:04 PST by Kevin Ollivier
Modified: 2011-12-10 15:09 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.50 KB, patch)
2011-11-13 17:06 PST, Kevin Ollivier
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Ollivier 2011-11-13 17:04:42 PST
Add export macros to JSCore heap classes
Comment 1 Kevin Ollivier 2011-11-13 17:06:24 PST
Created attachment 114869 [details]
Patch
Comment 2 Geoffrey Garen 2011-11-14 11:26:27 PST
I still don't like this idiom. I don't see the upside to it, and I don't know how to avoid breaking it in future.
Comment 3 Simon Hausmann 2011-11-16 03:21:18 PST
(In reply to comment #2)
> I still don't like this idiom. I don't see the upside to it, and I don't know how to avoid breaking it in future.

What are the options?

I see:

1) The project will only support building JSC as shared lib if you use port & platform specific export files.
2) We add the export macro to _classes_, resulting in slightly more exported symbols that aaabsolutely necessary. (easier to maintain)
3) We add the export macro to classes and individual functions (like in attachment 114869 [details]). (harder to maintain, but closer to option 1)

I would prefer option number 2, but the decision lies probably in the hands of the JSC folks :)
Comment 4 Kevin Ollivier 2011-11-16 07:48:26 PST
(In reply to comment #3)
> (In reply to comment #2)
> > I still don't like this idiom. I don't see the upside to it, and I don't know how to avoid breaking it in future.
> 
> What are the options?
> 
> I see:
> 
> 1) The project will only support building JSC as shared lib if you use port & platform specific export files.
> 2) We add the export macro to _classes_, resulting in slightly more exported symbols that aaabsolutely necessary. (easier to maintain)
> 3) We add the export macro to classes and individual functions (like in attachment 114869 [details]). (harder to maintain, but closer to option 1)
> 
> I would prefer option number 2, but the decision lies probably in the hands of the JSC folks :)

I'd obviously prefer number 2 as well, and IMHO it's much less maintenance work, but the JSC folks did not want people to think they can, or be able to, use the exported classes as public API, so I have been told that if we're to do it it has to be per-symbol (as the current approach is).

In a few cases, though, we actually do have to export the whole class when WebCore, etc. needs access to things like the viable that are only exported when you export the class, so you may see that from time to time. I only do that when it's necessary to get it linking, though.
Comment 5 Kevin Ollivier 2011-11-16 22:02:36 PST
(In reply to comment #2)
> I still don't like this idiom. I don't see the upside to it, and I don't know how to avoid breaking it in future.

I'm not sure I understand. If all the ports building JSCore shared use this approach, which is the necessary end result of this process, I don't see how it can break for any port because for any common symbol change, you'll need to add the export macro to get it linking, and once you do that, all ports get updated at the same time. For port-specific stuff, the port that needs it adds it, and the rest of the ports ignore it, so again no breakage AFAICT.

In contrast, right now, it's easy to add an export symbol to only one port and break the others, and any new port that wants to build JSCore shared must craft their own export symbol files and commit to maintaining them. To be honest, I don't see what the upside to doing it that way is, and it was my understanding that it was decided to do things this way before multiple ports were in the tree.
Comment 6 Kevin Ollivier 2011-12-10 15:09:35 PST
This bug is superseded by work to automate the adding of header macros.