overriding NewObject snippets

Deneau, Tom tom.deneau at amd.com
Wed Sep 11 15:55:35 PDT 2013


Doug and others...

OK, this DelegatingRuntime infrastructure sounds like a great idea.
When do you think something like this will be available?

-- Tom


-----Original Message-----
From: Doug Simon [mailto:doug.simon at oracle.com] 
Sent: Wednesday, September 11, 2013 11:32 AM
To: Deneau, Tom
Cc: graal-dev at openjdk.java.net
Subject: Re: overriding NewObject snippets


https://lafo.ssw.uni-linz.ac.at/hg/basic-graal/rev/91e5f927af63

On Sep 11, 2013, at 5:54 PM, "Deneau, Tom" <tom.deneau at amd.com> wrote:

> Glancing at HotSpotRuntime,
> yes, probably all the snippets will have to be overridden but there 
> are clearly some things we would want to reuse such as
> 	getArrayBaseOffset
> 	getArrayIndexScale
>       etc.

Those methods are static in HotSpotRuntime so subclassing is not necessary.

> For that reason I would think we would want to subclass HotSpotRuntime

I think it's better not to subclass but to delegate. Since I think this is the way PTX should go as well, we should probably provide a DelegatingRuntime class to simplify the GPU specific backends.

> (I did not see a PTXHotSpotRuntime by the way).

It's in a recently added project:

https://lafo.ssw.uni-linz.ac.at/hg/basic-graal/rev/91e5f927af63

You need to re-run 'mx eclipseinit' and import the new project.

-Doug

> -----Original Message-----
> From: Doug Simon [mailto:doug.simon at oracle.com]
> Sent: Wednesday, September 11, 2013 10:44 AM
> To: Deneau, Tom
> Subject: Re: overriding NewObject snippets
> 
> 
> On Sep 11, 2013, at 5:32 PM, "Deneau, Tom" <tom.deneau at amd.com> wrote:
> 
>> Doug --
>> 
>> Right, your answer to Vasanth made sense for my question as well.
>> 
>> Are there any existing overrides of the GraalCodeCacheProvider class that we can look at as templates?
> 
> Only HotSpotRuntime ;-)
> 
> I'm also thinking that PTXHotSpotRuntime should not subclass HotSpotRuntime (and should thus be renamed to something like PTXRuntime).
> 
> -Doug
> 
>> 
>> -----Original Message-----
>> From: Doug Simon [mailto:doug.simon at oracle.com]
>> Sent: Wednesday, September 11, 2013 10:06 AM
>> To: Deneau, Tom
>> Cc: graal-dev at openjdk.java.net
>> Subject: Re: overriding NewObject snippets
>> 
>> This is related to the message I sent about http://cr.openjdk.java.net/~tdeneau/graal-webrevs/webrev-r15changes/webrev/.
>> 
>> There needs to be separate GraalCodeCacheProvider subclass for HSAIL that defines and uses it's own snippets. It can always delegate to the HotSpotRuntime snippets but I suspect most of theme won't be reusable for HSAIL.
>> 
>> -Doug
>> 
>> On Sep 11, 2013, at 1:06 AM, "Deneau, Tom" <tom.deneau at amd.com> wrote:
>> 
>>> For the HSAIL backend,  I want to override some of the existing NewObjectSnippets with some different java code.
>>> What is the right way to do this?
>>> 
>>> -- Tom
>> 
>> 
>> 
> 
> 
> 





More information about the graal-dev mailing list