Gregory,
thank you for answers.

I remember there was a reason why I
moved the functions from compile_do_compilation, I think they were not
called in case of methods recompilation.

The situation is opposite (but probalby this is exactly you want to):
compile_me stub is called once during the first method invocation - it
populates method vtable with a real method address .
compile_do_compilation_jit() is an interface function which is called
by an execution manager for each recompilation.

I need to change the code anyway according to
http://wiki.apache.org/harmony/Code_Inspection%3a_compile%2ecpp - but
no need to rush wit that.

What other functions do you mean?
There are totally five jvmti callbacks in the code - I will putthem
all in a list:

jvmti_process_native_method_bind_event( (jmethodID) method,
(NativeCodePtr)func, (NativeCodePtr*)&func);
jvmti_get_compilation_flags(&flags);
jvmti_send_compiled_method_load_event(method);
jvmti_set_pending_breakpoints(method);
jvmti_set_single_step_breakpoints_for_method(ti, p_TLS_vmthread, method);

The last one gets ti environment as an argument, while other obtain it
internally. BTW, won't you object if I put the functions in a separate
jvmti_compile.h file? According to the wiki page I emntioned I need to
reduce a number of .h files in the prolog, and currently it includes
the whole jvmti_internal.h

Thanks again!

On 12/8/06, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
Alexei Fedotov wrote:
> Gregory, All,
>
> I started looking into the compile.cpp file and found new ti callbacks
> in compile_jit_a_method jit stub. I've got several questions.
>
> DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
> if(ti->isEnabled() && ti->is_single_step_enabled()
>    && !method->is_native())
> {
>    jvmti_set_single_step_breakpoints_for_method(ti, p_TLS_vmthread,
> method);
> }
>
> * Why ti->isEnabled() checks are repeated inside and outside the call
> to jvmti_set_single_step_breakpoints_for_method()?

The function jvmti_set_single_step_breakpoints_for_method is used in
other places as well. Maybe checks are not consistent, but it is not a
big deal.

> * Why not to use compile_do_compilation_jit() function for this
> callback - this function is called for java methods?

You are probably right. We have several methods with no clear contract
which do java methods compilation. I remember there was a reason why I
moved the functions from compile_do_compilation, I think they were not
called in case of methods recompilation. Now that I checked the code it
seems quite a lot of things have changed.

> * Is it ok to use a global ti environment? Can we hide access to the
> environment on your side as it is done in other functions to avoid
> touching this code later when you decide to support multiple
> environments?

What other functions do you mean?

> The questions are probably quite easy for you to answer, but I
> hesitate that I missed some basics and ask you to comment.

The code is simple. There is nothing to miss in it. Your questions are
valid but I don't see a big reason to change what is already working.

--
Gregory




--
With best regards,
Alexei,
ESSD, Intel

Reply via email to