#ifndef IntendedStructureChain_h
#define IntendedStructureChain_h
+#include "ConstantStructureCheck.h"
#include "Structure.h"
#include <wtf/RefCounted.h>
class IntendedStructureChain : public RefCounted<IntendedStructureChain> {
public:
- IntendedStructureChain(JSGlobalObject* globalObject, Structure* head);
+ IntendedStructureChain(JSGlobalObject* globalObject, JSValue prototype);
+ IntendedStructureChain(JSGlobalObject* globalObject, Structure*);
IntendedStructureChain(CodeBlock* codeBlock, Structure* head, Structure* prototypeStructure);
IntendedStructureChain(CodeBlock* codeBlock, Structure* head, StructureChain* chain);
IntendedStructureChain(CodeBlock* codeBlock, Structure* head, StructureChain* chain, unsigned count);
bool isStillValid() const;
bool matches(StructureChain*) const;
- StructureChain* chain(VM&) const;
- bool mayInterceptStoreTo(VM&, StringImpl* uid);
+ bool mayInterceptStoreTo(UniquedStringImpl* uid);
bool isNormalized();
- Structure* head() const { return m_head; }
+ bool takesSlowPathInDFGForImpureProperty();
+
+ JSValue prototype() const { return m_prototype; }
size_t size() const { return m_vector.size(); }
- Structure* at(size_t index) { return m_vector[index]; }
- Structure* operator[](size_t index) { return at(index); }
+ Structure* at(size_t index) const { return m_vector[index]; }
+ Structure* operator[](size_t index) const { return at(index); }
JSObject* terminalPrototype() const;
Structure* last() const { return m_vector.last(); }
+ bool operator==(const IntendedStructureChain&) const;
+ bool operator!=(const IntendedStructureChain& other) const
+ {
+ return !(*this == other);
+ }
+
+ void gatherChecks(ConstantStructureCheckVector&) const;
+
void visitChildren(SlotVisitor&);
void dump(PrintStream&) const;
void dumpInContext(PrintStream&, DumpContext*) const;
private:
JSGlobalObject* m_globalObject;
- Structure* m_head;
+ JSValue m_prototype;
Vector<Structure*> m_vector;
};