Re: RFR(XS) : 8055269 : java/lang/invoke/MethodHandles/CatchExceptionTest.java fails intermittently

2015-05-19 Thread Vladimir Ivanov
slot consumption for generated signatures. Best regards, Vladimir Ivanov On 5/18/15 8:58 PM, Vladimir Ivanov wrote: Igor, Looks good. You don't need to bother computing slot size for a signature since you use only 1-slot types, do you? test/java/lang/invoke/MethodHandles/CatchExceptio

Re: RFR(XS) : 8055269 : java/lang/invoke/MethodHandles/CatchExceptionTest.java fails intermittently

2015-05-19 Thread Igor Ignatyev
58 PM, Vladimir Ivanov wrote: Igor, Looks good. You don't need to bother computing slot size for a signature since you use only 1-slot types, do you? test/java/lang/invoke/MethodHandles/CatchExceptionTest.java: Class classes[] = { Object.class,

Re: RFR(XS) : 8055269 : java/lang/invoke/MethodHandles/CatchExceptionTest.java fails intermittently

2015-05-18 Thread Vladimir Ivanov
Igor, Looks good. You don't need to bother computing slot size for a signature since you use only 1-slot types, do you? test/java/lang/invoke/MethodHandles/CatchExceptionTest.java: Class classes[] = { Object.class, long.class,

Re: RFR(XS) : 8055269 : java/lang/invoke/MethodHandles/CatchExceptionTest.java fails intermittently

2015-05-18 Thread Vladimir Ivanov
Igor, Looks good. You don't need to bother computing slot size for a signature since you use only 1-slot types, do you? test/java/lang/invoke/MethodHandles/CatchExceptionTest.java: Class classes[] = { Object.class, long.class, int.

RFR(XS) : 8055269 : java/lang/invoke/MethodHandles/CatchExceptionTest.java fails intermittently

2015-05-18 Thread Igor Ignatyev
http://cr.openjdk.java.net/~iignatyev/8055269/webrev.00/ 23 lines changed: 8 ins; 9 del; 6 mod Hi all, please review the tiny fix for CatchExceptionTest test. problem: the tests generates a target w/ 255 parameters, so a corresponding handler should have 256 parameters. that violates restrict

Re: [9] RFR (S): 8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles

2015-03-16 Thread Vladimir Kozlov
Good. thanks, Vladimir K On 3/16/15 12:05 PM, John Rose wrote: Reviewed. — John On Mar 16, 2015, at 11:47 AM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/hotspot http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/jdk https://bugs.openjdk.java.net/brow

Re: [9] RFR (S): 8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles

2015-03-16 Thread Vladimir Ivanov
Thanks, John! Best regards, Vladimir Ivanov On 3/16/15 10:05 PM, John Rose wrote: Reviewed. — John On Mar 16, 2015, at 11:47 AM, Vladimir Ivanov wrote: http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/hotspot http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/jdk https://bugs.op

Re: [9] RFR (S): 8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles

2015-03-16 Thread John Rose
Reviewed. — John On Mar 16, 2015, at 11:47 AM, Vladimir Ivanov wrote: > > http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/hotspot > http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/jdk > https://bugs.openjdk.java.net/browse/JDK-8075263 ___

[9] RFR (S): 8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles

2015-03-16 Thread Vladimir Ivanov
http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/hotspot http://cr.openjdk.java.net/~vlivanov/8075263/webrev.00/jdk https://bugs.openjdk.java.net/browse/JDK-8075263 When MethodHandle is a compile-time constant and it is inlined in MethodHandle.invoke/invokeExact there's no need in MHI::che

Re: RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-12-01 Thread Vladimir Ivanov
ote: http://cr.openjdk.java.net/~iignatyev/8039953/webrev.00 98 lines changed: 93 ins; 3 del; 2 mod; Hi all, Please review the patch: Problem: on some configurations, java/lang/invoke/MethodHandles/CatchExceptionTest.java can timeout before all test cases are run Fix: interrup

Re: RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-12-01 Thread Igor Ignatyev
del; 2 mod; Hi all, Please review the patch: Problem: on some configurations, java/lang/invoke/MethodHandles/CatchExceptionTest.java can timeout before all test cases are run Fix: interrupt test execution if it's not enough time to continue bug : https://bugs.openjdk.java.net/browse/JDK

Re: RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-12-01 Thread Igor Ignatyev
e: http://cr.openjdk.java.net/~iignatyev/8039953/webrev.00 98 lines changed: 93 ins; 3 del; 2 mod; Hi all, Please review the patch: Problem: on some configurations, java/lang/invoke/MethodHandles/CatchExceptionTest.java can timeout before all test cases are run Fix: interrupt test executio

Re: RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-12-01 Thread Vladimir Ivanov
3 del; 2 mod; Hi all, Please review the patch: Problem: on some configurations, java/lang/invoke/MethodHandles/CatchExceptionTest.java can timeout before all test cases are run Fix: interrupt test execution if it's not enough time to continue bug : https://bugs.openjdk.java.net/browse/JDK-803

Re: RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-12-01 Thread Paul Sandoz
On Nov 29, 2014, at 5:36 PM, Igor Ignatyev wrote: > http://cr.openjdk.java.net/~iignatyev/8039953/webrev.00 > 98 lines changed: 93 ins; 3 del; 2 mod; > > Hi all, > > Please review the patch: > > Problem: > on some configurations, > java/lang/invoke/MethodHandles/Ca

RFR(S) : 8039953 : [TESTBUG] Timeout java/lang/invoke/MethodHandles/CatchExceptionTest.java

2014-11-29 Thread Igor Ignatyev
http://cr.openjdk.java.net/~iignatyev/8039953/webrev.00 98 lines changed: 93 ins; 3 del; 2 mod; Hi all, Please review the patch: Problem: on some configurations, java/lang/invoke/MethodHandles/CatchExceptionTest.java can timeout before all test cases are run Fix: interrupt test execution

MethodHandles#catchException bug in jdk7u40 and jdk8ea ?

2013-09-27 Thread Jochen Theodorou
Hi again, I have a Groovy-indy program looking like this https://gist.github.com/abargnesi/6628656 This did work in 7u25 and does not work in 7u40 or the developer preview of jdk8. What I found out is, if you remove an argument the IllegalArgumentException is not thrown What I have (using 7u4

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-23 Thread Remi Forax
On 03/23/2013 04:30 PM, Peter Levart wrote: > > On 03/22/2013 11:50 AM, Remi Forax wrote: >> On 03/22/2013 11:12 AM, Jochen Theodorou wrote: >>> Am 22.03.2013 10:35, schrieb Remi Forax: On 03/22/2013 10:24 AM, Jochen Theodorou wrote: > Am 22.03.2013 10:11, schrieb Remi Forax: > [...] >

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-23 Thread Peter Levart
On 03/22/2013 11:50 AM, Remi Forax wrote: On 03/22/2013 11:12 AM, Jochen Theodorou wrote: Am 22.03.2013 10:35, schrieb Remi Forax: On 03/22/2013 10:24 AM, Jochen Theodorou wrote: Am 22.03.2013 10:11, schrieb Remi Forax: [...] I don't think it's a good idea to expose directly method handles t

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Remi Forax
On 03/22/2013 11:12 AM, Jochen Theodorou wrote: > Am 22.03.2013 10:35, schrieb Remi Forax: >> On 03/22/2013 10:24 AM, Jochen Theodorou wrote: >>> Am 22.03.2013 10:11, schrieb Remi Forax: >>> [...] I don't think it's a good idea to expose directly method handles to users, it's better to en

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Jochen Theodorou
Am 22.03.2013 10:35, schrieb Remi Forax: > On 03/22/2013 10:24 AM, Jochen Theodorou wrote: >> Am 22.03.2013 10:11, schrieb Remi Forax: >> [...] >>> I don't think it's a good idea to expose directly method handles to users, >>> it's better to encapsulate it into a Groovy object corresponding to a >>

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Remi Forax
On 03/22/2013 10:24 AM, Jochen Theodorou wrote: > Am 22.03.2013 10:11, schrieb Remi Forax: > [...] >> I don't think it's a good idea to expose directly method handles to users, >> it's better to encapsulate it into a Groovy object corresponding to a >> function or a closure so you can add a bunch o

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Jochen Theodorou
Am 22.03.2013 10:11, schrieb Remi Forax: [...] > I don't think it's a good idea to expose directly method handles to users, > it's better to encapsulate it into a Groovy object corresponding to a > function or a closure so you can add a bunch of invoke overloads. what invoke overloads are you thin

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Remi Forax
On 03/22/2013 10:06 AM, Remi Forax wrote: > On 03/22/2013 07:52 AM, Jochen Theodorou wrote: >> Am 21.03.2013 20:49, schrieb Remi Forax: >> [...] >>> I suppose you take a look to the instances. >>> You can do something similar actually by using invokedynamic + >>> a guardWithTest that checks already

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Remi Forax
thodHandle.invoke/invokeExact (which invokeWithArguments() will call), >> and it looks at what MethodHandles get passed in. >> When that work lands in HotSpot, your example will be a source of >> profile pollution just like the well-known megamorphic callsites in the >> ol

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-22 Thread Remi Forax
On 03/22/2013 07:52 AM, Jochen Theodorou wrote: > Am 21.03.2013 20:49, schrieb Remi Forax: > [...] >> I suppose you take a look to the instances. >> You can do something similar actually by using invokedynamic + >> a guardWithTest that checks already seen instances instead of doing a >> plain mh.in

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread Jochen Theodorou
s a (JIT-)compiled-time constant to be able to do > inlining across the MethodHandle.invoke/invokeExact boundary. ah yes, I forgot that. > I'm working on adding profiling support for > MethodHandle.invoke/invokeExact (which invokeWithArguments() will call), > and it looks at what

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread Jochen Theodorou
Am 21.03.2013 20:49, schrieb Remi Forax: [...] > I suppose you take a look to the instances. > You can do something similar actually by using invokedynamic + > a guardWithTest that checks already seen instances instead of doing a > plain mh.invoke* > I think Duncan and Georges do something like tha

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread Remi Forax
odHandle is a (JIT-)compiled-time constant to be able to do > inlining across the MethodHandle.invoke/invokeExact boundary. > > I'm working on adding profiling support for > MethodHandle.invoke/invokeExact (which invokeWithArguments() will call), > and it looks at what MethodHandles ge

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread Krystal Mo
the MethodHandle.invoke/invokeExact boundary. I'm working on adding profiling support for MethodHandle.invoke/invokeExact (which invokeWithArguments() will call), and it looks at what MethodHandles get passed in. When that work lands in HotSpot, your example will be a source of profile poll

Re: another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread MacGregor, Duncan (GE Energy Management)
Maybe I'm misunderstanding your question, but whether mh.invokeWithArguments(args) internally generates a mono, poly, or megamorphic call site internally in the JVM is going to depend on the implementation and just how many subclasses of MethodHandle there are. If you're concerned about the implem

another question about megamorphic call sites in combination with MethodHandles

2013-03-21 Thread Jochen Theodorou
Hi all, assuming I have in Java a method: public static Object invoke(MethodHandle mh, Object[] args) { try { return mv.invokeWithArguments(args); } catch (Throwable th) { ExceptionUtils.sneakyThrow(th); } } (sneakyThrow is to work around checked exceptions and does basically

Re: LambdaForm toString() of MethodHandles

2012-11-19 Thread John Rose
On Nov 18, 2012, at 5:50 PM, Douglas Campos wrote: > When doing MH.toString(), the LambdaForm output (as enabled by > java.lang.invoke.MethodHandle.DEBUG_NAMES) is WAY more readable. Any reasons > for not using it as the default beyond perf cost? Hi Douglas! The debugging output reveals lots o

LambdaForm toString() of MethodHandles

2012-11-18 Thread Douglas Campos
Howdy! When doing MH.toString(), the LambdaForm output (as enabled by java.lang.invoke.MethodHandle.DEBUG_NAMES) is WAY more readable. Any reasons for not using it as the default beyond perf cost? -- qmx ___ mlvm-dev mailing list [email protected]

Re: Question about MethodHandles#explicitCastArgument

2012-11-15 Thread Jochen Theodorou
Am 16.11.2012 00:32, schrieb John Rose: [...] > What you are seeing is a bug. I can reproduce this in JDK 7 but not in > JDK 8. The upcoming JDK 7 update will fix this, since it is a backport > from 8. ah, finally the backport of jdk8 ;) I hope it does not break other things;) Btw, I noticed th

Re: Question about MethodHandles#explicitCastArgument

2012-11-15 Thread Jochen Theodorou
Hi John, Am 16.11.2012 04:09, schrieb John Rose: > On Nov 15, 2012, at 3:32 PM, John Rose wrote: > >> It can be right, but only if the actual argument is a null reference. >> If it is a non-null Byte, it must unbox to a byte and then widen to a >> float. > > Well, actually, in this case, the NPE

Re: Question about MethodHandles#explicitCastArgument

2012-11-15 Thread John Rose
On Nov 15, 2012, at 3:32 PM, John Rose wrote: > It can be right, but only if the actual argument is a null reference. If it > is a non-null Byte, it must unbox to a byte and then widen to a float. Well, actually, in this case, the NPE should not happen either. Nulls are explicitly cast (though

Re: Question about MethodHandles#explicitCastArgument

2012-11-15 Thread John Rose
[Repost, moving from jvm-l list.] On Nov 14, 2012, at 6:16 AM, Jochen Theodorou wrote: > I have a call to MethodHandles#explicitCastArgument with first argument being > my MethodHandle(Groovy3135Bug,String,float,float,float,float,float)Object and > the type I cast to being > (G

Question about MethodHandles#explicitCastArgument

2012-11-14 Thread Jochen Theodorou
Hi, I have a call to MethodHandles#explicitCastArgument with first argument being my MethodHandle(Groovy3135Bug,String,float,float,float,float,float)Object and the type I cast to being (Groovy3135Bug,String,Byte,Short,Integer,Long,Float)Object Ignoring the first two I should have some kind

Re: MethodHandles and class initialization

2012-07-19 Thread John Rose
On Jul 19, 2012, at 7:04 PM, Dain Sundstrom wrote: > I have some code that tries to get the value of a static final field using a > MethodHandle, and I find that the field is null because the class isn't > initialized. Is calling a method handle supposed to cause a class to > initialize (run th

MethodHandles and class initialization

2012-07-19 Thread Dain Sundstrom
I have some code that tries to get the value of a static final field using a MethodHandle, and I find that the field is null because the class isn't initialized. Is calling a method handle supposed to cause a class to initialize (run the method)? In a related question, what is the best way t

Re: Looping construction using only MethodHandles

2011-12-08 Thread MLeo
s them). > > > > > > Now my question, is there something I can do to make it completely tail > call > > optimized? I've tried to 'rotate' the call graph/tree but that obviously > > wouldn't work (it's still a direct recursion, no matter if you

Re: Looping construction using only MethodHandles

2011-12-05 Thread Charles Oliver Nutter
d? I've tried to 'rotate' the call graph/tree but that obviously > wouldn't work (it's still a direct recursion, no matter if you do it > directly or in the combiner of a foldArguments). It seems that it is almost > completely TCO already, but I haven't

Looping construction using only MethodHandles

2011-12-05 Thread MLeo
ack. It's definitely leaking less stack than a simple recursion. Or will we need a special looping combinator here? I initially tried to create a while combinator, however it seems that guardWithTest does not accept MethodHandles returning void (for the target and fallback). If this can be ma

Re: IMPORTANT: Missing feature in MethodHandles?

2011-06-10 Thread Charles Oliver Nutter
I think I got it! MethodHandle result = MethodHandles.catchException(foo, postException); # handles exceptional path of finally and throws result = MethodHandles.foldArgments(postCall, result); # handles non-exceptional path of finally. Am I right?! On Fri, Jun 10, 2011 at 7:12 PM, Charles Olive

Re: IMPORTANT: Missing feature in MethodHandles?

2011-06-10 Thread Charles Oliver Nutter
I just posted your trick (a "duh" moment for me) to JVM-L, along with an explanation of why it doesn't solve the try/finally problem. The exceptional and non-exceptional paths need to be exclusive to match what try/finally does. - Charlie On Fri, Jun 10, 2011 at 7:05 PM, Charles Oliver Nutter wr

Re: IMPORTANT: Missing feature in MethodHandles?

2011-06-10 Thread Charles Oliver Nutter
On Fri, Jun 10, 2011 at 6:55 PM, John Rose wrote: > On Jun 10, 2011, at 4:39 PM, Charles Oliver Nutter wrote: > >> Please tell me I'm wrong, or tell me that we can modify catchException >> in some way to also allow post-processing of non-exceptional results >> (with return value inserted where the

Re: IMPORTANT: Missing feature in MethodHandles?

2011-06-10 Thread John Rose
On Jun 10, 2011, at 4:39 PM, Charles Oliver Nutter wrote: > Please tell me I'm wrong, or tell me that we can modify catchException > in some way to also allow post-processing of non-exceptional results > (with return value inserted where the Throwable would go)! I think this does what you want:

IMPORTANT: Missing feature in MethodHandles?

2011-06-10 Thread Charles Oliver Nutter
Please, please have a look at my recent threads on JVM-L. I am worried I've found a major hole in what MethodHandles can do. Specifically, there's no way to post-process a given handle, receiving both its arguments and its return value and deciding what to do, for something like this t

Re: Inlining of MethodHandles chain possible/planned?

2011-05-18 Thread Rémi Forax
On 05/18/2011 09:03 PM, John Rose wrote: > On May 18, 2011, at 11:59 AM, Rémi Forax wrote: > >> All others are hard because the value of the method handle is not >> statically known >> i.e the method handle cannot be considered as constant. > It can be optimistically inlined, which is what we do fo

Re: Inlining of MethodHandles chain possible/planned?

2011-05-18 Thread John Rose
On May 18, 2011, at 11:59 AM, Rémi Forax wrote: > All others are hard because the value of the method handle is not > statically known > i.e the method handle cannot be considered as constant. It can be optimistically inlined, which is what we do for invokedynamic instructions. -- John ___

Re: Inlining of MethodHandles chain possible/planned?

2011-05-18 Thread Rémi Forax
On 05/18/2011 06:44 PM, Charles Oliver Nutter wrote: > On Wed, May 18, 2011 at 5:34 AM, Szymon Jachim wrote: >> I have to questions to you guys about possible (and planned) JIT >> optimizations for MethodHandles. >> 1. Assuming that there will be a chain of MH's: >

Re: Inlining of MethodHandles chain possible/planned?

2011-05-18 Thread Charles Oliver Nutter
On Wed, May 18, 2011 at 5:34 AM, Szymon Jachim wrote: > I have to questions to you guys about possible (and planned) JIT > optimizations for MethodHandles. > 1. Assuming that there will be a chain of MH's: >       mh1(invoker) -> mh2 -> aMethod() >    and there will be

Inlining of MethodHandles chain possible/planned?

2011-05-18 Thread Szymon Jachim
I have to questions to you guys about possible (and planned) JIT optimizations for MethodHandles. 1. Assuming that there will be a chain of MH's: mh1(invoker) -> mh2 -> aMethod() and there will be no other references to mh2. Will JIT/GC be able to optimize unneeded mh2 a

Re: MethodHandles for Kawa and other functional languages?

2010-10-11 Thread Rémi Forax
would a language like Kawa > benefit from using invokedynamic - or MethodHandles in some > other way.\? Some potential benefits: > > * Reduce boxing - e.g passing an int to an unknown function > which in turns expects an int. > * A better implementation of "multi-methods" - whi

Re: MethodHandles for Kawa and other functional languages?

2010-10-11 Thread Helmut Eller
* Per Bothner [2010-10-10 23:38] writes: > An example I was considering was: > > (define (twice f x) >(f (f x))) > > My initial thought was to compile this as: > > public static Object (Procedure f, Object x) { >MethodHandle f$mh = f.asMethodHandle(); >return f$mh.invoke(f$mh.invoke(x)

Re: MethodHandles for Kawa and other functional languages?

2010-10-10 Thread Per Bothner
why do you want to use invokedynamic here ? That is the question - how much would a language like Kawa benefit from using invokedynamic - or MethodHandles in some other way.\? Some potential benefits: * Reduce boxing - e.g passing an int to an unknown function which in turns expects an

Re: MethodHandles for Kawa and other functional languages?

2010-10-10 Thread Per Bothner
On 10/10/2010 02:20 PM, Rémi Forax wrote: > Le 10/10/2010 20:08, Per Bothner a écrit : >> So we've determined that to make use of 292 Kawa should keep its >> abstract gnu.mapping.Procedure class, but add a new method: >> MethodHandle asMethodHandle() >> >> I mis-concluded that the compiler sho

Re: MethodHandles for Kawa and other functional languages?

2010-10-10 Thread Rémi Forax
Le 10/10/2010 20:08, Per Bothner a écrit : > So we've determined that to make use of 292 Kawa should keep its > abstract gnu.mapping.Procedure class, but add a new method: > MethodHandle asMethodHandle() > > I mis-concluded that the compiler should therefore generate code > to call asMethodHand

Re: MethodHandles for Kawa and other functional languages?

2010-10-10 Thread Per Bothner
So we've determined that to make use of 292 Kawa should keep its abstract gnu.mapping.Procedure class, but add a new method: MethodHandle asMethodHandle() I mis-concluded that the compiler should therefore generate code to call asMethodHandle() and then the MethdHandle#invoke method. However, t

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Alessio Stalla
On Thu, Sep 30, 2010 at 4:03 PM, Helmut Eller wrote: > * Alessio Stalla [2010-09-30 13:28] writes: > >>> I guess you could avoid reflection if you generate a custom bootstrap >>> method for each callsite.  Hmm.. probably just as clumsy as reflection. >> >> Yeah, clumsy and suffering from code bloa

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Helmut Eller
* Alessio Stalla [2010-09-30 13:28] writes: >> I guess you could avoid reflection if you generate a custom bootstrap >> method for each callsite.  Hmm.. probably just as clumsy as reflection. > > Yeah, clumsy and suffering from code bloat - I'm already disturbed to > have one static block register

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Alessio Stalla
On Thu, Sep 30, 2010 at 3:11 PM, Helmut Eller wrote: > * Alessio Stalla [2010-09-30 11:52] writes: > >> On Thu, Sep 30, 2010 at 12:48 PM, Helmut Eller  wrote: >>> >>> Just out of curiosity: what do you do if the package was renamed (say >>> from SOME-LISP-PACKAGE to ANOTHER-LISP-PACKAGE) before th

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Helmut Eller
* Alessio Stalla [2010-09-30 11:52] writes: > On Thu, Sep 30, 2010 at 12:48 PM, Helmut Eller wrote: >> >> Just out of curiosity: what do you do if the package was renamed (say >> from SOME-LISP-PACKAGE to ANOTHER-LISP-PACKAGE) before the bootstrap >> method gets executed? > > It'll fail miserably

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Alessio Stalla
On Thu, Sep 30, 2010 at 12:48 PM, Helmut Eller wrote: > * Alessio Stalla [2010-09-30 07:44] writes: > >> InvokeDynamic.#"SOME-LISP-PACKAGE:FOO"(...) >> >> and in the bootstrap method, roughly, >> >> ... >> Symbol sym = readFromString(methodName); >> MethodHandle mh = sym.getSymbolFunctionOrDie().a

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Helmut Eller
* Alessio Stalla [2010-09-30 07:44] writes: > InvokeDynamic.#"SOME-LISP-PACKAGE:FOO"(...) > > and in the bootstrap method, roughly, > > ... > Symbol sym = readFromString(methodName); > MethodHandle mh = sym.getSymbolFunctionOrDie().asMethodHandle(); > ... Just out of curiosity: what do you do if

Re: MethodHandles for Kawa and other functional languages?

2010-09-30 Thread Alessio Stalla
thodHandle?  A Procedure?  Something else? >> There seem to be different kind of MethodHandles, so perhaps something >> is appropriate.  Is there some blog article or cookbook discussing this? > > Quick answer to your next-to-last question:  The language-specific APIs > s

Re: MethodHandles for Kawa and other functional languages?

2010-09-29 Thread John Rose
rent kind of MethodHandles, so perhaps something > is appropriate. Is there some blog article or cookbook discussing this? Quick answer to your next-to-last question: The language-specific APIs should use their own interfaces or classes, so continue to use Procedure. But if and when you go t

MethodHandles for Kawa and other functional languages?

2010-09-29 Thread Per Bothner
I'm interested into (at least) evaluating MethodHandles for Kawa (and similar languages with first-class functions). But I'm not quite sure where to start, or what is the right abstraction. Kawa's function implementation is fairly efficient. Calls to known functions compile t

Re: I would like to discuss the MethodHandles factory

2009-08-17 Thread Fredrik Öhrström
ce an > interface with lots of special magic treatment. > > Or maybe {int => String}.class would be a MethodType. As I said, some > distortion is likely. > Yes, some distortion is likely. But MethodHandles are so close to closures (no pun intended) that it would be a waste, no

News from the backport: Hitches in MethodHandles

2009-06-04 Thread Rémi Forax
While hacking the backport, I found some hitches in MethodHandles doc, here is my notes: - The documentation of spread/collectArgument talk about an array type T[] but T is not defined. The question here is: Can T be a primitive type or not ? - Mismatch between spread/collectArguments

Re: I would like to discuss the MethodHandles factory

2009-05-27 Thread John Rose
On May 27, 2009, at 9:16 PM, Charles Oliver Nutter wrote: > we *must* give the keys to the castle to language > developers, by opening up the very guts of the JVM's optimizing > pipeline I agree that static type checking for method handles would be very useful, but the language design work is d

Re: I would like to discuss the MethodHandles factory

2009-05-27 Thread Charles Oliver Nutter
ing! Having spent a lot more time playing with MethodHandles and imagining the potential, I must say I strongly agree with Fredrik. In the face of compiler systems like LLVM and to a lesser extent the CLR/DLR's expression tree support, I believe in order for the JVM to survive as a dominant

Re: Javac syntax for MethodHandle (Was Re: I would like to discuss the MethodHandles factory)

2009-05-12 Thread Patrick Wright
There was some discussion on a proposal like this for Project Coin (small language changes for Java 7); see this mail thread: http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000388.html I don't believe this is currently under consideration for Java 7. > All the runtime access methods l

Javac syntax for MethodHandle (Was Re: I would like to discuss the MethodHandles factory)

2009-05-12 Thread Fredrik Öhrström
Rémi Forax skrev: > On javac support: your javac support is close to a closure proposal :) > I think we can output a spec without a complete (typecked) support > of MethodHandles in Java to avoid the closure trap :) > All the runtime access methods like findVirtual, findSpecial an

Re: I would like to discuss the MethodHandles factory

2009-05-11 Thread Rémi Forax
://groups.google.com/group/jvm-languages/browse_thread/thread/47b4423aa99be008 Particularly, the inner class Guard. I agree with you that it could avoid to implement lot of static methods in MethodHandles. Anyway, some of them like convert, spread/collect, bind are very common and I think it's a good ide

I would like to discuss the MethodHandles factory

2009-05-11 Thread Fredrik Öhrström
where adapter code is generated by calling for example MethodHandles.appendArgument(). I am not entirely comfortable with this construction. Mostly because JRockit does not have an interpreter. So, following a recommendation from John, that I should blog about jsr292. :-) Here is the link: http://

MethodHandles

2008-10-07 Thread Rémi Forax
I've continue to implement the backport last evening and I hope to be able to publish it in 2 weeks (more or less). Some remarks: - there is a bug in the doc comments of MethodHandles.insertArgument(), "The pos may range between zero and N (inclusively)" Hum, you forget to take a look int