On Sat, 12 May 2012 19:15:45 +0200
Vlad Ureche <
vlad....@gmail.com> wrote:
> On Sat, May 12, 2012 at 5:37 PM, Mark Harrah <
dmha...@gmail.com> wrote:
>
> > It looks like -optimise is designed so that it doesn't affect binary
> > compatibility. Going off of Miguel's inliner walkthrough[1],
> >
> > * the inliner only inlines methods from an external library that are
> > annotated with @inline
> > * the inliner only inlines methods that call publicly accessible methods
> >
> > This might require that the implementations of @inline methods don't
> > change, but otherwise the inliner doesn't cause problems for binary
> > compatibility, right?
> >
> > -Mark
> >
> > [1]
> >
http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2011Q4/Inliner.pdf
> >
>
> Hi Mark,
>
> Short answer: Currently, it won't affect binary compatibility. It might
> affect it in the 2.10 release.
>
> Long answer: Whenever the inlined code needs access to a private/protected
> member, the inliner makes it public so it can be accessed from anywhere.
> But since there's no contract saying the member must be public, recompiling
> parts of the program or recompiling files in a different order may cause
> the members not to be made public and thus impact binary compatibility,
> especially since the inlining algorithm is sensitive to ordering.
>
> For now, member public-ization is off because of this
> but Miguel has been looking at ways to restore it. I think he can give you
> more up to date information on what's going to happen in 2.10.
Thanks for the response. I forgot about that thread. Indeed, I am looking for what Paul talks about: some way to tell the optimizer that I care about binary compatibility. If that means I have to manually adjust method accessibility, perhaps I want that. I'm not really sure what I need, since I've not really used -optimise in practice yet (but would like to, hence the question) and I'm not too familiar with the implications on binary compatibility (since I haven't done that either, but would like to).