Getting ciObject from oop/jobject

Krystal Mok rednaxelafx at
Thu Aug 1 13:16:14 UTC 2013

Hi Nick,

This topic is related to HotSpot Server Compiler instead of the Java core
library, so I'm cc'ing this email to hotspot-compiler-dev and dropping

As you already know, HotSpot compilers are shielded from VM runtime
implementation details via the Compiler Interface (CI). That's why you
shouldn't be getting raw oops in C2 code.

Where are you getting the oopInstance from? If it can be found from some
known "roots", e.g. "well-known classes", fields of "well-known classes",
or the holder class of the method to be compiled, etc., then it's already
available through CI.

- Kris

On Thu, Aug 1, 2013 at 3:17 AM, Nick Williams <
nicholas+openjdk at> wrote:

> In native code (library_call.cpp), if I have an oop (which I can convert
> to a jobject if need be), how do I get a ciObject? I see that ciEnv has a
> ciObject* get_object(oop) method, but it's private. And ciObjectFactory has
> a ciObject* get(oop) method, but I can't figure out how to get the
> ciObjectFactory instance.
> I know that ciObject keeps a jobject internally, and I know that ciObject
> has a ciObject(oop) constructor, but it's protected (for good reason).
> If it helps, I'm trying to inline a method and need to
> set_result(makecon(TypeInstPtr::make(oopInstance))). I may be going down
> the wrong path.
> Thanks in advance for any help,
> Nick

More information about the core-libs-dev mailing list