harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregory Shimansky <gshiman...@gmail.com>
Subject Re: [drlvm][ti] calbacks in compile_jit_a_method
Date Fri, 08 Dec 2006 21:41:46 GMT
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


Mime
View raw message