Please review JDK-8057825
marcus.lagergren at oracle.com
Tue Nov 4 11:50:09 UTC 2014
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: http://cr.openjdk.java.net/~lagergren/8057825/ <http://cr.openjdk.java.net/~lagergren/8057825/>
Issue at: https://bugs.openjdk.java.net/browse/JDK-8057825
More information about the nashorn-dev