Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-08 Thread Peter Levart
Just one more thought... In lines: 358 } else if (stale 0 k.get() == null) { 359 stale = i; // remember 1st stale entry index 360 } ...an index to 1st stale entry is remembered while scanning the array so that at the end,

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-08 Thread Paul Sandoz
On Dec 6, 2014, at 1:30 PM, Peter Levart peter.lev...@gmail.com wrote: Now what scares me (might be that I don't have an intimacy with LambdaForm class like you do). There is a situation where you publish LambdaForm instances via data race. One form of LambdaForm.transformCache is an array

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-08 Thread Vladimir Ivanov
Peter, Thanks for looking into that and for you initial prototype! So WeakReferences did not hold LambdaForms long enough even with strong back-reference from LambdaForm to the lambda form 'this' was derived from? So final derived LambdaForms (leaves) are not kept referenced from the code? Or

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-08 Thread Vladimir Ivanov
Peter, First, just a nit. I think that in LambdaFormEditor: 289 private LambdaForm putInCache(Transform key, LambdaForm form) { 290 key = key.withResult(form); 291 for (int pass = 0; ; pass++) { 292 Object c = lambdaForm.transformCache; 293

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-06 Thread Peter Levart
Hi Vladimir, First, just a nit. I think that in LambdaFormEditor: 289 private LambdaForm putInCache(Transform key, LambdaForm form) { 290 key = key.withResult(form); 291 for (int pass = 0; ; pass++) { 292 Object c = lambdaForm.transformCache; 293

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-06 Thread Peter Levart
(Sorry for a re-send, forgot to include core-libs-dev)... Hi Vladimir, First, just a nit. I think that in LambdaFormEditor: 289 private LambdaForm putInCache(Transform key, LambdaForm form) { 290 key = key.withResult(form); 291 for (int pass = 0; ; pass++) { 292

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-05 Thread Peter Levart
On 12/01/2014 05:58 PM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8057020/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8057020 There are 2 major LambdaForm caches: LambdaFormEditor-based and MethodTypeForm. The former is per-LambdaForm and the latter is per method

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-03 Thread Vladimir Ivanov
Aleksey, thanks for the review. I haven't tried -XX:SoftRefLRUPolicyMSPerMB=0, but I did extensive testing on Octane/Nashorn with multiple low -Xmx levels + frequent Full GCs (8060147 [1] was the result of those experiments) and stress tested cache eviction with jdk/java/lang/invoke/LFCache

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-02 Thread Vladimir Ivanov
Thanks, Paul! Updated webrev in place. On Dec 1, 2014, at 5:58 PM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: http://cr.openjdk.java.net/~vlivanov/8057020/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8057020 That LambdaFormEditor.putInCache method just got more gnarly :-)

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-02 Thread Paul Sandoz
On Dec 2, 2014, at 5:20 PM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: Thanks, Paul! Updated webrev in place. +1. Paul. signature.asc Description: Message signed with OpenPGP using GPGMail ___ mlvm-dev mailing list

Re: [9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

2014-12-02 Thread John Rose
Reviewed. I sympathize with Paul's gnarly comment. Nice bit of stream-ology (rheology) in the test code. Regarding: On Dec 2, 2014, at 8:20 AM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: In src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java 366