StructureRareData.h [plain text]
#ifndef StructureRareData_h
#define StructureRareData_h
#include "ClassInfo.h"
#include "JSCell.h"
#include "JSTypeInfo.h"
#include "PropertyOffset.h"
#include "PropertySlot.h"
namespace JSC {
class JSPropertyNameEnumerator;
class Structure;
class ObjectToStringAdaptiveStructureWatchpoint;
class ObjectToStringAdaptiveInferredPropertyValueWatchpoint;
class StructureRareData final : public JSCell {
public:
typedef JSCell Base;
static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
static StructureRareData* create(VM&, Structure*);
static const bool needsDestruction = true;
static void destroy(JSCell*);
static void visitChildren(JSCell*, SlotVisitor&);
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
Structure* previousID() const;
void setPreviousID(VM&, Structure*);
void clearPreviousID();
JSString* objectToStringValue() const;
void setObjectToStringValue(ExecState*, VM&, Structure* baseStructure, JSString* value, PropertySlot toStringTagSymbolSlot);
JSPropertyNameEnumerator* cachedPropertyNameEnumerator() const;
void setCachedPropertyNameEnumerator(VM&, JSPropertyNameEnumerator*);
DECLARE_EXPORT_INFO;
private:
friend class Structure;
friend class ObjectToStringAdaptiveStructureWatchpoint;
friend class ObjectToStringAdaptiveInferredPropertyValueWatchpoint;
void clearObjectToStringValue();
StructureRareData(VM&, Structure*);
WriteBarrier<Structure> m_previous;
WriteBarrier<JSString> m_objectToStringValue;
WriteBarrier<JSPropertyNameEnumerator> m_cachedPropertyNameEnumerator;
typedef HashMap<PropertyOffset, RefPtr<WatchpointSet>, WTF::IntHash<PropertyOffset>, WTF::UnsignedWithZeroKeyHashTraits<PropertyOffset>> PropertyWatchpointMap;
std::unique_ptr<PropertyWatchpointMap> m_replacementWatchpointSets;
Bag<ObjectToStringAdaptiveStructureWatchpoint> m_objectToStringAdaptiveWatchpointSet;
std::unique_ptr<ObjectToStringAdaptiveInferredPropertyValueWatchpoint> m_objectToStringAdaptiveInferredValueWatchpoint;
bool m_giveUpOnObjectToStringValueCache;
};
}
#endif // StructureRareData_h