#include "config.h"
#include "LLIntThunks.h"
#if ENABLE(LLINT)
#include "JSInterfaceJIT.h"
#include "JSObject.h"
#include "LinkBuffer.h"
#include "LowLevelInterpreter.h"
#include "ScopeChain.h"
namespace JSC { namespace LLInt {
static MacroAssemblerCodeRef generateThunkWithJumpTo(JSGlobalData* globalData, void (*target)())
{
JSInterfaceJIT jit;
jit.move(JSInterfaceJIT::TrustedImmPtr(bitwise_cast<void*>(target)), JSInterfaceJIT::regT0);
jit.jump(JSInterfaceJIT::regT0);
LinkBuffer patchBuffer(*globalData, &jit, GLOBAL_THUNK_ID);
return patchBuffer.finalizeCode();
}
MacroAssemblerCodeRef functionForCallEntryThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_function_for_call_prologue);
}
MacroAssemblerCodeRef functionForConstructEntryThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_function_for_construct_prologue);
}
MacroAssemblerCodeRef functionForCallArityCheckThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_function_for_call_arity_check);
}
MacroAssemblerCodeRef functionForConstructArityCheckThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_function_for_construct_arity_check);
}
MacroAssemblerCodeRef evalEntryThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_eval_prologue);
}
MacroAssemblerCodeRef programEntryThunkGenerator(JSGlobalData* globalData)
{
return generateThunkWithJumpTo(globalData, llint_program_prologue);
}
} }
#endif // ENABLE(LLINT)