#include "config.h"
#include "LLIntThunks.h"
#if ENABLE(LLINT)
#include "JSInterfaceJIT.h"
#include "JSObject.h"
#include "LinkBuffer.h"
#include "LowLevelInterpreter.h"
namespace JSC { namespace LLInt {
#if !ENABLE(LLINT_C_LOOP)
static MacroAssemblerCodeRef generateThunkWithJumpTo(VM* vm, void (*target)(), const char *thunkKind)
{
JSInterfaceJIT jit;
jit.move(JSInterfaceJIT::TrustedImmPtr(bitwise_cast<void*>(target)), JSInterfaceJIT::regT0);
jit.jump(JSInterfaceJIT::regT0);
LinkBuffer patchBuffer(*vm, &jit, GLOBAL_THUNK_ID);
return FINALIZE_CODE(patchBuffer, ("LLInt %s prologue thunk", thunkKind));
}
MacroAssemblerCodeRef functionForCallEntryThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_function_for_call_prologue, "function for call");
}
MacroAssemblerCodeRef functionForConstructEntryThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_function_for_construct_prologue, "function for construct");
}
MacroAssemblerCodeRef functionForCallArityCheckThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_function_for_call_arity_check, "function for call with arity check");
}
MacroAssemblerCodeRef functionForConstructArityCheckThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_function_for_construct_arity_check, "function for construct with arity check");
}
MacroAssemblerCodeRef evalEntryThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_eval_prologue, "eval");
}
MacroAssemblerCodeRef programEntryThunkGenerator(VM* vm)
{
return generateThunkWithJumpTo(vm, llint_program_prologue, "program");
}
#endif // !ENABLE(LLINT_C_LOOP)
} }
#endif // ENABLE(LLINT)