JIT stubs for functions with external linkage

Hi,

Before I go ahead and remove the generation of stubs for external functions, is there any good reason why they get generated? I can understand that the JIT wants to make stubs for the functions it compiles itself - it enables selective recompilation and replacement - but functions which are defined in a library (or in my case by the application using the JIT) can't be changed anyway. For me the extra jmp instruction for each call is significant, so I want to remove it...

m.

Before I go ahead and remove the generation of stubs for external
functions, is there any good reason why they get generated?

It depends on the target. On PPC, for example, calls have limited
displacement. By using stubs, we can ensure it's possible to reach the
external function.

They should not be generated on X86.

I can understand that the JIT wants to make stubs for the functions it
compiles itself - it enables selective recompilation and replacement -

And lazy compilation.

but functions which are defined in a library (or in my case by the
application using the JIT) can't be changed anyway. For me the extra jmp
instruction for each call is significant, so I want to remove it...

Sounds good.

-Chris