8150829: Enhanced drop-args, identity and default constant, varargs adjustment

Reviewed-by: psandoz, mhaupt, jrose
This commit is contained in:
Shilpi Rastogi 2016-04-13 15:48:14 +02:00
parent 33a3b1cdf0
commit 284ec15fed
8 changed files with 490 additions and 66 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -216,13 +216,7 @@ public class MethodHandleProxies {
}
private static MethodHandle bindCaller(MethodHandle target, Class<?> hostClass) {
MethodHandle cbmh = MethodHandleImpl.bindCaller(target, hostClass);
if (target.isVarargsCollector()) {
MethodType type = cbmh.type();
int arity = type.parameterCount();
return cbmh.asVarargsCollector(type.parameterType(arity-1));
}
return cbmh;
return MethodHandleImpl.bindCaller(target, hostClass).withVarargs(target.isVarargsCollector());
}
/**