[9] RFR (L): Improve LambdaForm sharing by using LambdaFormEditor more extensively

Paul Sandoz paul.sandoz at oracle.com
Tue Sep 9 13:16:41 UTC 2014


On Sep 9, 2014, at 12:51 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:

> http://cr.openjdk.java.net/~vlivanov/8057922/webrev.00
> https://bugs.openjdk.java.net/browse/JDK-8057922
> 
> Introduce more sharing on LambdaForm level by rewriting most of the MH combinators using LambdaFormEditor.
> 
> The new code is guarded by USE_LAMBDA_FORM_EDITOR flag and turned off by default because it introduces significant peak performance regression on Octane benchmark. I'm working on the fix. Original implementation will be removed once performance degradation is fixed.
> 

Generally looks ok.


- LambdaFormEditor

 465         buf.endEdit();
 466         form = buf.lambdaForm();
 467         return putInCache(key, form);

A suggestion (feel free to ignore), that pattern repeats quite a bit. With some tweaks one could do:

  return putIntCache(but.endEdit()); // or buf.toLambdaForm()


- MethodHandles

2869     public static
2870     MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) {
2871         MethodType targetType = target.type();
2872         MethodType filterType = filter.type();
2873         filterReturnValueChecks(targetType, filterType);
2874         BoundMethodHandle result = target.rebind();
2875         BasicType rtype = BasicType.basicType(filterType.returnType());
2876         LambdaForm lform = result.editor().filterReturnForm(rtype, false);
2877         MethodType newType = targetType.changeReturnType(filterType.returnType());
2878         result = result.copyWithExtendL(newType, lform, filter);
2879         return result;
2880     }

Missing "if (USE_LAMBDA_FORM_EDITOR)".

Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20140909/0c4e2d53/signature.asc>


More information about the mlvm-dev mailing list