https://lists.webkit.org/pipermail/webkit-dev/2012-July/021584.html
As I understand in SFX all non JS functions calls go trough JITStubs:op_call_NotJSFunction function. But in which point, where, the op_call_NotJSFunction function is called? Can anyone please explain how function calls are implemented in SFX(simple jit).
It's called from code generated by the JITop_call_NotJSFunction is only referenced during the final linking phase. Actual compilation requires two distinct operations: 1) planting the call instruction and 2) linking the call target after the code has been relocated. Here is the (64-bit) version of the call + link logic: ... preserveReturnAddressAfterCall(regT3); emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC); emitPutImmediateToCallFrameHeader(0, RegisterFile::CodeBlock); storePtr(callFrameRegister, &m_globalData->topCallFrame); restoreArgumentReference(); Call callCallNotJSFunction = call(); <-- here is the call emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, callFrameRegister); restoreReturnAddressBeforeReturn(regT3); ret(); ... patchBuffer.link(callCallNotJSFunction, FunctionPtr(cti_op_call_NotJSFunction)); <-- here is us linking the call