graal and jdk8
Remi Forax
forax at univ-mlv.fr
Thu Feb 14 11:41:57 PST 2013
Technically, invokedynamic is used when creating the lambda, not when
calling it, calling a lambda is done with an invokeinterface.
The code to bind a lambda using an invokedynamic is here:
http://hg.openjdk.java.net/lambda/lambda/jdk/file/e8f0df769883/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
Rémi
On 02/14/2013 06:27 PM, Thomas Wuerthinger wrote:
> True ;). Well, we can add invokedynamic support - and maybe we need a special handling for compiling invokedynamic into the GPU code anyway.
>
> - thomas
>
> On Feb 14, 2013, at 9:20 AM, "Frost, Gary" <Gary.Frost at amd.com> wrote:
>
>> Except (of course) for lambdas dispatching to other lambdas.... :)
>>
>>
>> -----Original Message-----
>> From: Thomas Wuerthinger [mailto:thomas.wuerthinger at oracle.com]
>> Sent: Thursday, February 14, 2013 11:10 AM
>> To: Bharadwaj Yadavalli
>> Cc: Frost, Gary; graal-dev at openjdk.java.net
>> Subject: Re: graal and jdk8
>>
>> You are right, it does not matter whether you compile Graal with JDK7 or JDK8. Atm, it does not compile the invokedynamic instruction (but bailout). However, I believe that this should not matter in the context of project Sumatra as the lambda expression themselves should not contain this bytecode (and this is the only part that would be given to the Graal compiler).
>>
>> - thomas
>>
>> On Feb 14, 2013, at 8:24 AM, Bharadwaj Yadavalli <bharadwaj.yadavalli at oracle.com> wrote:
>>
>>> Gary,
>>>
>>> On 2/14/2013 10:58 AM, Frost, Gary wrote:
>>>> Bharadwaj,
>>>>
>>>> The Sumatra project is interested in intercepting some of the upcoming Java 8 stream API features.
>>>>
>>>> Essentially we see the
>>>>
>>>> IntStream.parallel().forEach( lambda );
>>>>
>>>> As low hanging fruit for GPU acceleration.
>>> Yes, I understand this and am fully in agreement (It is in line with my post back in November '12 on Sumatra project mailing list http://mail.openjdk.java.net/pipermail/sumatra-dev/2012-November/000045.html).
>>>
>>> I am trying to figure out the various compilation steps in Hotspot/Graal framework that would allow me to recognize opportunities for code generation for alternate architectures (GPUs in this case).
>>>
>>>> So it is important for us to ensure that Graal was (will be) Java 8
>>>> compatible moving forward, we are delighted that it seems to be ;)
>>> Sure.
>>>
>>> The question was why does it matter whether we use JDK 7 or JDK 8 to build the (Graal) compiler that in turn could compile Java 8 classfiles. I am not objecting to compiling Graal with the latest JDK, but wish to understand the dependency, which I do not see.
>>>
>>> Thanks,
>>>
>>> Bharadwaj
>>>
>>>> It is true that the lambda features seem to leverage only Java 7 classfile features at this time (method handles and constant pool enhancements) so we felt fairly comfortable experimenting with Graal on Java 7. But prefer to continue our experiments with the Project Lambda and Java 8 hotspot VMs.
>>>>
>>>> Gary
>>>>
>>>> -----Original Message-----
>>>> From:graal-dev-bounces at openjdk.java.net
>>>> [mailto:graal-dev-bounces at openjdk.java.net] On Behalf Of Bharadwaj
>>>> Yadavalli
>>>> Sent: Thursday, February 14, 2013 9:36 AM
>>>> To:graal-dev at openjdk.java.net
>>>> Subject: Re: graal and jdk8
>>>>
>>>> On 2/13/2013 12:03 PM, Venkatachalam, Vasanth wrote:
>>>>> Hi,
>>>>>
>>>>> I noticed that I had to use a JDK7 VM to build Graal.
>>>>> I wasn't able to build it with JDK8. Is there a workaround for this, or does Graal require a JDK7 host VM?
>>>> I am curious as to why Graal *build* needs to be done with JDK8 so that the resulting Graal compiler would be able to compile Java 8 class files? I believe Graal sources themselves do not (yet) use Java 8 features.
>>>>> If Graal only supports JDK7, are there plans to make it compatible with JDK8?
>>>>> We're looking to leverage Graal for the Sumatra project
>>>>> (http://openjdk.java.net/projects/sumatra/)
>>>>> This work requires being able to compile JDK8 lambda constructs for the GPU.
>>>> However, it appears to me that the need is more for bringing in the ability to parse and verify Java 8 class files (along with possibly the support for indy, what else am I missing?) so that the Graal compiler has the ability to compile Java 8 class files.
>>>>
>>>> Thanks,
>>>>
>>>> Bharadwaj
>>>>
>>>>
>>>>
>>
>>
More information about the graal-dev
mailing list