FTLLazySlowPath.cpp [plain text]
#include "config.h"
#include "FTLLazySlowPath.h"
#if ENABLE(FTL_JIT)
#include "FTLSlowPathCall.h"
#include "LinkBuffer.h"
namespace JSC { namespace FTL {
LazySlowPath::LazySlowPath(
CodeLocationJump patchableJump, CodeLocationLabel done,
CodeLocationLabel exceptionTarget,
const RegisterSet& usedRegisters, CallSiteIndex callSiteIndex, RefPtr<Generator> generator
)
: m_patchableJump(patchableJump)
, m_done(done)
, m_exceptionTarget(exceptionTarget)
, m_usedRegisters(usedRegisters)
, m_callSiteIndex(callSiteIndex)
, m_generator(generator)
{
}
LazySlowPath::~LazySlowPath()
{
}
void LazySlowPath::generate(CodeBlock* codeBlock)
{
RELEASE_ASSERT(!m_stub);
CCallHelpers jit(codeBlock);
GenerationParams params;
CCallHelpers::JumpList exceptionJumps;
params.exceptionJumps = m_exceptionTarget ? &exceptionJumps : nullptr;
params.lazySlowPath = this;
m_generator->run(jit, params);
LinkBuffer linkBuffer(jit, codeBlock, JITCompilationMustSucceed);
linkBuffer.link(params.doneJumps, m_done);
if (m_exceptionTarget)
linkBuffer.link(exceptionJumps, m_exceptionTarget);
m_stub = FINALIZE_CODE_FOR(codeBlock, linkBuffer, ("Lazy slow path call stub"));
MacroAssembler::repatchJump(m_patchableJump, CodeLocationLabel(m_stub.code()));
}
} }
#endif // ENABLE(FTL_JIT)