It seems the problem is in the number of actual arguments.
Try to use
  emit_callhelper(func);
instead of 
  emit_callhelper_prof2(func, CORINFO_PRUEBA, from,
to);

regards, 
  Alexei Nikitin

 --- Vladimir Fedorov <[EMAIL PROTECTED]> escribió:
> ...if part of your project is to create your own
> infrastructure than you can mimic your own code off
> the code for the profiler callback. In particular
> look at the emit_callhelper_prof2(...) macro in
> fjitdef.h. This macro emits the code for the call
> into the jitted function. You can create a new but
> very similar macro to call your function.
>
I tried with the emit_callhelper_prof2 macro inserting
a call to this function before the JitResult =
compileCEE_CALL();

void insertNativeCall(){
  ULONG func = (ULONG) jitInfo->getHelperFtn
(CORINFO_PRUEBA);
  UINT_PTR from = 0;
  UINT_PTR to = 0;
  emit_callhelper_prof2(func, CORINFO_PRUEBA, from,
to);
}

Where CORINFO_PRUEBA is a new helper I added in
CorInfoHelpFunc (corinfo.h) and is registered in
VMHELPDEF hlpFuncTable[] with the
JITHELPER(CORINFO_PRUEBA, prueba) macro.
the method prueba is declared as follows:
static void __stdcall Prueba();
and it only contains a printf.
I think everithing is right, however when I execute
buildall I get an Assert Failure several times with
the following message "ESP not correct on method exit.
Did you forget a leave?" in file fjitdef.h (method
void HELPER_CALL check_stack(int frameSize, BYTE* fp,
BYTE* sp{..}). If I select Retry and finish the build
process and execute clix I get the same Assert Failure
just after the method prueba has executed (just after
the printf message has appeared on the console). I
hope someone can tell me why this happens or what I am
doing wrong.

Thank you

>
>
>
> -----Original Message-----
> From: Miguel Tomás [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 04, 2003 8:12 AM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET-ROTOR] Modification on Fjit - help
>
> Hi! I'm a spanish student and I've just started
> working on sscli. I'm doing some modifications on it
> but I have a problem with Fjit. I want to modify the
> jitCompile method in fjit.cpp, in particular the big
> "switch (opcode)"; when the case CEE_CALL is entered
> I want to insert a call in native code to a method
> written in C++ so every time the jitted method is
> executed it performs a call to my method before
> doing the call that it is supposed to do but I don't
> know how to do it. I hope I have explained it well.
> If anyone can help me I would be very grateful.
> Thank you.
>
> ---------------------------------
> Yahoo! Móviles
> Personaliza tu móvil con tu logo y melodía favorito

___________________________________________________
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito
en http://moviles.yahoo.es

Reply via email to