JSAsyncFunction.cpp [plain text]
#include "config.h"
#include "JSAsyncFunction.h"
#include "Error.h"
#include "JSCInlines.h"
#include "JSCJSValue.h"
#include "JSFunction.h"
#include "JSFunctionInlines.h"
#include "JSObject.h"
#include "PropertySlot.h"
#include "VM.h"
namespace JSC {
const ClassInfo JSAsyncFunction::s_info = { "AsyncFunction", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAsyncFunction) };
JSAsyncFunction::JSAsyncFunction(VM& vm, FunctionExecutable* executable, JSScope* scope, Structure* structure)
: Base(vm, executable, scope, structure)
{
}
JSAsyncFunction* JSAsyncFunction::createImpl(VM& vm, FunctionExecutable* executable, JSScope* scope, Structure* structure)
{
JSAsyncFunction* asyncFunction = new (NotNull, allocateCell<JSAsyncFunction>(vm.heap)) JSAsyncFunction(vm, executable, scope, structure);
ASSERT(asyncFunction->structure(vm)->globalObject());
asyncFunction->finishCreation(vm);
return asyncFunction;
}
JSAsyncFunction* JSAsyncFunction::create(VM& vm, FunctionExecutable* executable, JSScope* scope)
{
JSAsyncFunction* asyncFunction = createImpl(vm, executable, scope, scope->globalObject(vm)->asyncFunctionStructure());
executable->singletonFunction()->notifyWrite(vm, asyncFunction, "Allocating an async function");
return asyncFunction;
}
JSAsyncFunction* JSAsyncFunction::create(VM& vm, FunctionExecutable* executable, JSScope* scope, Structure* structure)
{
JSAsyncFunction* asyncFunction = createImpl(vm, executable, scope, structure);
executable->singletonFunction()->notifyWrite(vm, asyncFunction, "Allocating an async function");
return asyncFunction;
}
JSAsyncFunction* JSAsyncFunction::createWithInvalidatedReallocationWatchpoint(VM& vm, FunctionExecutable* executable, JSScope* scope)
{
return createImpl(vm, executable, scope, scope->globalObject(vm)->asyncFunctionStructure());
}
}