BuiltinExecutables.h [plain text]
#pragma once
#include "ExecutableInfo.h"
#include "JSCBuiltins.h"
#include "ParserModes.h"
#include "SourceCode.h"
#include "Weak.h"
#include "WeakHandleOwner.h"
namespace JSC {
class UnlinkedFunctionExecutable;
class Identifier;
class VM;
#define BUILTIN_NAME_ONLY(name, functionName, overriddenName, length) name,
enum class BuiltinCodeIndex {
JSC_FOREACH_BUILTIN_CODE(BUILTIN_NAME_ONLY)
NumberOfBuiltinCodes
};
#undef BUILTIN_NAME_ONLY
class BuiltinExecutables {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit BuiltinExecutables(VM&);
#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
UnlinkedFunctionExecutable* name##Executable(); \
SourceCode name##Source();
JSC_FOREACH_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
#undef EXPOSE_BUILTIN_EXECUTABLES
static SourceCode defaultConstructorSourceCode(ConstructorKind);
UnlinkedFunctionExecutable* createDefaultConstructor(ConstructorKind, const Identifier& name, NeedsClassFieldInitializer);
static UnlinkedFunctionExecutable* createExecutable(VM&, const SourceCode&, const Identifier&, ConstructorKind, ConstructAbility, NeedsClassFieldInitializer);
void finalizeUnconditionally();
private:
VM& m_vm;
UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&, const Identifier&, ConstructorKind, ConstructAbility);
Ref<StringSourceProvider> m_combinedSourceProvider;
UnlinkedFunctionExecutable* m_unlinkedExecutables[static_cast<unsigned>(BuiltinCodeIndex::NumberOfBuiltinCodes)] { };
};
}