#ifndef GetByIdVariant_h
#define GetByIdVariant_h
#include "CallLinkStatus.h"
#include "ConstantStructureCheck.h"
#include "IntendedStructureChain.h"
#include "JSCJSValue.h"
#include "PropertyOffset.h"
#include "StructureSet.h"
namespace JSC {
class CallLinkStatus;
class GetByIdStatus;
struct DumpContext;
class GetByIdVariant {
public:
GetByIdVariant(
const StructureSet& structureSet = StructureSet(), PropertyOffset offset = invalidOffset,
const IntendedStructureChain* chain = nullptr,
std::unique_ptr<CallLinkStatus> callLinkStatus = nullptr);
~GetByIdVariant();
GetByIdVariant(const GetByIdVariant&);
GetByIdVariant& operator=(const GetByIdVariant&);
bool isSet() const { return !!m_structureSet.size(); }
bool operator!() const { return !isSet(); }
const StructureSet& structureSet() const { return m_structureSet; }
StructureSet& structureSet() { return m_structureSet; }
const ConstantStructureCheckVector& constantChecks() const { return m_constantChecks; }
JSObject* alternateBase() const { return m_alternateBase; }
StructureSet baseStructure() const;
PropertyOffset offset() const { return m_offset; }
CallLinkStatus* callLinkStatus() const { return m_callLinkStatus.get(); }
bool attemptToMerge(const GetByIdVariant& other);
void dump(PrintStream&) const;
void dumpInContext(PrintStream&, DumpContext*) const;
private:
friend class GetByIdStatus;
StructureSet m_structureSet;
ConstantStructureCheckVector m_constantChecks;
JSObject* m_alternateBase;
PropertyOffset m_offset;
std::unique_ptr<CallLinkStatus> m_callLinkStatus;
};
}
#endif // GetByIdVariant_h