ARM: Support for JVMTI notifications from JIT compiler on code generation

Andrew Haley aph at redhat.com
Wed Apr 25 07:33:20 PDT 2012


On 04/25/2012 03:28 PM, Andrew Dinn wrote:
> On 25/04/12 14:28, Andrew Haley wrote:

>>>    jinfo_str.code_base = code_base;
>>> @@ -7580,6 +7597,27 @@
>>>    if (compiled_offset == 0) return 0;
>>>    thumb_entry.compiled_entrypoint = slow_entry + compiled_offset;
>>>    thumb_entry.osr_entry = (unsigned)cmethod->osr_entry | TBIT;
>>> +  {
>>> +    // we need to notify a Jvmti compiled_method_load event
>>> +
>>> +    // notify the whole generated code region for this Java method
>>> +    // from slow_entry through to the end of the osr table. some
>>> +    // of it is data not code but that's not a problem.
>>
>> I have a personal preference for sentences in comments.
> 
> By my reading the opening 2 lines of the second comment /are/ a sentence
> (with a verb in the imperative mood). of course, your mileage (and
> grammar) may vary.
> 
> I am happy to add a full stop after the sentence in the first comment
> and some ','s to place  the 'not code' properly in apposition if you like.

Full stops and capitals are nice.  But what does
"we need to notify a Jvmti compiled_method_load event" refer to?
What is being notified?  I'm not being arsey, I really don't
understand this comment.

>> This is a bit unfortunate.  I presume we have to do it because JvmtiExport
>> doesn't give us what we need.
> 
> Yes, the client API method provided for the other compilers expects an
> nmethod instance so using it would drag us into creating nmethods which
> means supporting the full AbstractCompiler lifecycle.

I see.

> There is another API method which is provided for use if you already
> have a handle on a JvmtiEnv -- not sure where it is actually used but I
> think it is intended for agent implementations to use. Using it would
> require the ARM JIT code to do the iteration over the JvmtiEnv list and
> I regarded that as something which ought to be kept internal to
> JvmtiExport. Hence the invention of this new API method.

OK.

> I am not certain about the value of the declared
> JvmtiJavaThreadEventTransition. I am assuming that it is needd to retain
> a handle on the thread when we enter into JVMI agent code in case of
> either GCs or exceptions. Perhaps someone can comment on whether this is
> i) necessary and ii) sufficient (e.g. do we also need to declare a
> HandleMark for the methodOop?).

Ewww.  Dunno, sorry.  Perhaps it couldn't hurt?

Andrew.




More information about the distro-pkg-dev mailing list