UnlinkedFunctionCodeBlock.h [plain text]
#pragma once
#include "UnlinkedCodeBlock.h"
namespace JSC {
class CachedFunctionCodeBlock;
class UnlinkedFunctionCodeBlock final : public UnlinkedCodeBlock {
public:
typedef UnlinkedCodeBlock Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
template<typename CellType, SubspaceAccess mode>
static IsoSubspace* subspaceFor(VM& vm)
{
return vm.unlinkedFunctionCodeBlockSpace<mode>();
}
static UnlinkedFunctionCodeBlock* create(VM& vm, CodeType codeType, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
{
UnlinkedFunctionCodeBlock* instance = new (NotNull, allocateCell<UnlinkedFunctionCodeBlock>(vm.heap)) UnlinkedFunctionCodeBlock(vm, vm.unlinkedFunctionCodeBlockStructure.get(), codeType, info, codeGenerationMode);
instance->finishCreation(vm);
return instance;
}
static void destroy(JSCell*);
private:
friend CachedFunctionCodeBlock;
UnlinkedFunctionCodeBlock(VM& vm, Structure* structure, CodeType codeType, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
: Base(vm, structure, codeType, info, codeGenerationMode)
{
}
UnlinkedFunctionCodeBlock(Decoder&, const CachedFunctionCodeBlock&);
public:
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
{
return Structure::create(vm, globalObject, proto, TypeInfo(UnlinkedFunctionCodeBlockType, StructureFlags), info());
}
DECLARE_INFO;
};
}