harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Astapchuk <alex.astapc...@gmail.com>
Subject Re: [drlvm][jit] How to override jit compilation?
Date Mon, 30 Oct 2006 07:54:13 GMT
Tonny Lau wrote:
> 2006/10/30, Alex Astapchuk <alex.astapchuk@gmail.com>:
>>
>> Tonny,
>>
>> Tonny Lau wrote:
>> > Hi,
>> >
>> > I want to override some specific java methods with native fast path
>> > implementations. So I try to override them in
>> > compile_do_compilation_jit()(vm/vmcore/src/jit/compile.cpp), that is,
>> > I add several entries in
>> >
>> _stub_override_entries_base[](vm/vmcore/src/util/ia32/base/compile_IA32.cpp), 
>>
>> >
>> > and lookup this table
>> > before invoke jit->compile_method_with_params().
>> >
>> > It works for JET, but failed when OPT recompile these method. Does the
>> OPT
>> > go different path?
>>
>> I suppose it's because OPT inlines the methods of your interest, so they
>> simply do not go through the VM's compilation machinery.
>>
>> > If so, how can I override it? Does anyone can help me?
>>
>> Try to turn off inlining in OPT - will it help?
> 
> 
> You're right. It works for OPT after I disable inline.  :)
> But there is a performance regression when the compiler switch to OPT. I'll
> continue the investigation. Thanks!

Well, I don't see much options here rather than do the overriding in the 
OPT codebase.

VM guys may correct me here:
As far as I remember, the VM had a special machinery to override the 
methods [1].
if memory serves, the method entries were handled on class preparation 
- somewhere at [2]. So the JIT 'saw' them as native and did not try to 
inline them. Seems very close to the functionality you need.

However after a quick look on the latest srcs, it seems the machinery is 
not used anymore.


[1] Have a look at the end of vmcore\src\util\ia32\base\compile_IA32.cpp 
- it's the table for the methods handles in a special way.
[2] vmcore\src\class_support\Prepare.cpp


-- 
Thanks,
   Alex


Mime
View raw message