Streams factories in Stream

Remi Forax forax at univ-mlv.fr
Wed Apr 24 04:37:18 PDT 2013


On 04/24/2013 08:18 AM, John Rose wrote:
> On Apr 23, 2013, at 10:59 PM, Peter Levart <peter.levart at gmail.com> wrote:
>
>> And if the translation used invokedynamic to obtain a cached empty array of a particular element type (like lambda metafactory does for lambdas), the overhead to obtain such would be minimal.
> Good point.  I was thinking of clunkier things like Arrays.EMPTY_OBJECT_ARRAY or private synthetic constants.  — John
>

In that case, it's better to use invokedynamic to do the whole varargs 
adaptation,
at callsite the compiler will not have to emit extra bytecodes as now and
it will be a clear marker for the VM.

Rémi



More information about the lambda-dev mailing list