RFR 8144473: Nashorn code assumes NashornCallSiteDescriptor always

Attila Szegedi szegedia at gmail.com
Wed Dec 2 13:15:30 UTC 2015


Yeah, the assumption used to be that non-exported linkers will only ever
observe NashornCallSiteDescriptor as they only link code emitted by
Nashorn. This invariant can now obviously (well, "obviously" now that
Sundar discovered it…) get violated because an auto-loaded linker can
produce a different call site descriptor and delegate linking to
linkerServices. Good fix. There's few other cases where we presume a
NashornCallSiteDescriptor, e.g. WithObject's linkage, but as far as I can
tell, the presumption there is still true (scope of the WithObject can not
be referenced nor created externally).

FWIW, in my rework for no-such-property (which I hope to be able to submit
soon; I'm waiting for my JIRA account reactivation to be able to open the
relevant issues) I also had to remove the assumption of
NashornCallSiteDescriptor from NashornBottomLinker.

Also, and somewhat unrelated, we should also think of providing a
GuardingDynamicLinkerExporter for Nashorn itself. I was thinking of what it
would export, and weirdly enough, it should actually only export (in my
opinion) BoundCallableLinker, JavaSuperAdapterLinker, and JSObjectLinker.
NashornLinker is not on the list, as we try to wrap all native Nashorn
objects into a ScriptObjectMirror before they leave the engine. (Although
adding it just in case we still leak natives somewhere probably wouldn't
hurt much.)


On Wed, Dec 2, 2015 at 11:32 AM, Michael Haupt <michael.haupt at oracle.com>

> Hi Sundar,
> lower-case thumbs up! Next, please write a Dynalink book. :-)
> Best,
> Michael
> > Am 02.12.2015 um 10:39 schrieb Sundararajan Athijegannathan <
> sundararajan.athijegannathan at oracle.com>:
> >
> > Please review http://cr.openjdk.java.net/~sundar/8144473/ for
> https://bugs.openjdk.java.net/browse/JDK-8144473
> >
> > Piggybacking a dynalink pluggable linker sample to translate
> underscore_separated names to CamelCase names.
> > The bug in nashorn was found when attempting to use that linker. Nashorn
> call site descriptors failed (before the current fix)
> >
> > Thanks,
> > -Sundar
> --
>  <http://www.oracle.com/>
> Dr. Michael Haupt | Principal Member of Technical Staff
> Phone: +49 331 200 7277 | Fax: +49 331 200 7561
> Oracle Java Platform Group | LangTools Team | Nashorn
> Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14 | 14467 Potsdam,
> Germany
>  <http://www.oracle.com/commitment>     Oracle is committed to developing
> practices and products that help protect the environment

More information about the nashorn-dev mailing list