JVMCI: HotSpotObjectConstantImpl

Juan Fumero juan.fumero at ed.ac.uk
Thu Oct 20 08:47:30 UTC 2016


Great, it works with SnippetReflectionProvider.

Thanks
Juan

On Wed, 2016-10-19 at 09:36 -0700, Christian Wimmer wrote:
> The best way to look into object constants is by using the 
> SnippetReflectionProvider.  You can get that via getCapability() from
>> GraalRuntime.
> 
> Note that most parts of Graal must not look inside object constants, 
> since that breaks compiler-VM separation. But if you are already in 
> HotSpot specific code, it is not too bad.
> 
> -Christian
> 
> 
> On 10/19/2016 04:43 AM, Doug Simon wrote:
> > 
> > This class cannot be made public as it hides unsafe API, especially
> > this method you’re referring to. You should use one of the asObject
> > methods in jdk.vm.ci.hotspot.HotSpotObjectConstant.
> > 
> > -Doug
> > 
> > > 
> > > On 19 Oct 2016, at 13:32, Juan Fumero <juan.fumero at ed.ac.uk>
> > > wrote:
> > > 
> > > Hi all,
> > >   is there any reason why the class HotSpotObjectConstantImpl is
> > > not
> > > public? As well as the method object() ?
> > > 
> > > I want to access to its object value:
> > > 
> > > <code>
> > > Constant value = ...
> > > if (value instanceof HotSpotObjectConstant) {
> > >   HotSpotObjectConstantImpl constantValue =
> > > (HotSpotObjectConstantImpl)
> > > value;
> > >   Object data = constantValue.object();
> > >   ...
> > > }
> > > </code>
> > > 
> > > 
> > > So in my own JVMCI version I made it public but just wondering if
> > > it
> > > could be public for future releases if it makes sense.
> > > 
> > > Thanks
> > > Juan
> > > 
> > > --
> > > The University of Edinburgh is a charitable body, registered in
> > > Scotland, with registration number SC005336.
> > > 

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the graal-dev mailing list