https://lists.webkit.org/pipermail/webkit-dev/2009-March/006930.html
want to port JIT to MIPS - can anybody explain JIT::linkCall?
The hot path for a call performs a check for a specific callee, with a
fast mechanism for making JS->JS calls. The code is generated such
that it will initially always bail out to the slow path, and the
second time the call is executed it will dynamically linked itself to
that callee. There are currently two slow paths generated for each
callee, the initial one that calls out to relink the code, and a
second form that does not. hotPathBegin & hotPathOther are used
(along with an offset) to find three things to repatch in the hot path:
(1) The JSFunction* value that is checked, to identify the callee
(2) The jump out to the slow path, so this can be relinked to the
second form (which will not attempt to relink – this is stored in
coldPathOther).
(3) The call instruction to be linked the callee's code.
The value callReturnLocation points to the call in the cold path to
the relink mechanisms. This is used by the dynamic linking mechanisms
to lookup the CallLinkInfo record describing the call to be linked,
and is also used in exception handling.
G.
On Mar 6, 2009, at 5:40 PM, x yz wrote:
>
> e.g, emitted asm code before/after patch? what does its four
> pointers do?
> MacroAssembler::CodeLocationNearCall callReturnLocation;
> MacroAssembler::CodeLocationDataLabelPtr hotPathBegin;
> MacroAssembler::CodeLocationNearCall hotPathOther;
> MacroAssembler::CodeLocationLabel coldPathOther;
> CodeBlock* callee;
>
> anywhere got doc of the JIT implementations?
> thanks a lot!
> joe