#include "config.h"
#include "CallData.h"
#include "CatchScope.h"
#include "Interpreter.h"
#include "JSCInlines.h"
#include "JSFunction.h"
#include "ScriptProfilingScope.h"
namespace JSC {
JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args)
{
ASSERT(callType == CallType::JS || callType == CallType::Host);
return exec->interpreter()->executeCall(exec, asObject(functionObject), callType, callData, thisValue, args);
}
JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args, NakedPtr<Exception>& returnedException)
{
VM& vm = exec->vm();
auto scope = DECLARE_CATCH_SCOPE(vm);
JSValue result = call(exec, functionObject, callType, callData, thisValue, args);
if (UNLIKELY(scope.exception())) {
returnedException = scope.exception();
scope.clearException();
return jsUndefined();
}
RELEASE_ASSERT(result);
return result;
}
JSValue profiledCall(ExecState* exec, ProfilingReason reason, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args)
{
ScriptProfilingScope profilingScope(exec->vmEntryGlobalObject(), reason);
return call(exec, functionObject, callType, callData, thisValue, args);
}
JSValue profiledCall(ExecState* exec, ProfilingReason reason, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args, NakedPtr<Exception>& returnedException)
{
ScriptProfilingScope profilingScope(exec->vmEntryGlobalObject(), reason);
return call(exec, functionObject, callType, callData, thisValue, args, returnedException);
}
}