]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/StructureChain.h
JavaScriptCore-903.tar.gz
[apple/javascriptcore.git] / runtime / StructureChain.h
index c48749d29be302f6733162ec4c972b2c4e5340b7..4fc1212bc7a28eda127fcc939360b4000290fbb8 100644 (file)
@@ -26,6 +26,9 @@
 #ifndef StructureChain_h
 #define StructureChain_h
 
+#include "JSCell.h"
+#include "Structure.h"
+
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -35,16 +38,22 @@ namespace JSC {
 
     class Structure;
 
-    class StructureChain : public RefCounted<StructureChain> {
+    class StructureChain : public JSCell {
+        friend class JIT;
+
     public:
-        static PassRefPtr<StructureChain> create(Structure* head) { return adoptRef(new StructureChain(head)); }
-        RefPtr<Structure>* head() { return m_vector.get(); }
-        bool isCacheable() const;
+        static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (&globalData) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
+        WriteBarrier<Structure>* head() { return m_vector.get(); }
+        void visitChildren(SlotVisitor&);
 
-    private:
-        StructureChain(Structure* head);
+        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesVisitChildren), 0, &s_info); }
+        
+        static ClassInfo s_info;
 
-        OwnArrayPtr<RefPtr<Structure> > m_vector;
+    private:
+        StructureChain(JSGlobalData&, Structure*, Structure* head);
+        ~StructureChain();
+        OwnArrayPtr<WriteBarrier<Structure> > m_vector;
     };
 
 } // namespace JSC