Please review JDK-8057825

Hannes Wallnoefer hannes.wallnoefer at
Tue Nov 4 12:57:42 UTC 2014

I think the NodeVisitor in ApplySpecialization#hasApplies will enter 
into nested functions. Shouldn't it just look at the current function?

I wonder how hot the TransformFailedException constructor may get. 
Should we worry about string concatenation there?

Otherwise looks good.


Am 2014-11-04 um 12:50 schrieb Marcus Lagergren:
> Logic in RecompilableScriptFunctionData
> 1) Apply transform succeeds when a callsite is first encountered
> 2) It is the best callsite available when we do another call, but the fit isn’t exact, which it has to be for apply2call to work - i.e. exactly the right number of parameters with the exact types
> 3) In that case recompile a specialization
> 4) Do addCode on it iff it was a successful apply2call transform
> Basically the problem was that 4 should be
> 4) Do addcode on it, always
> As Attila’s excellent repro managed to capture. We reuse the apply2call specialization for one object argument, undefined, for the array apply, which fits and doesn’t cause a linkage error since Object holds anything, even [“foo”, “bar”].
> Also some housekeeping on the apply2call transform, not making it iterate over the code for applies if there are none, better logging sanitized output and so on.
> Webrev at: <>
> Issue at:
> Regards
> Marcus

More information about the nashorn-dev mailing list