]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - bytecode/PolymorphicPutByIdList.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / bytecode / PolymorphicPutByIdList.h
index 15d7bde31c9d1eb2a3a5ec1a3db1394f49e4c34a..2d35501d35ef4920fcc3973c46a3d9512b870c3a 100644 (file)
@@ -53,6 +53,7 @@ public:
     
     PutByIdAccess()
         : m_type(Invalid)
+        , m_chainCount(UINT_MAX)
     {
     }
     
@@ -95,6 +96,7 @@ public:
         AccessType accessType,
         Structure* structure,
         StructureChain* chain,
+        unsigned chainCount,
         PutPropertySlot::PutValueFunc customSetter,
         PassRefPtr<JITStubRoutine> stubRoutine)
     {
@@ -102,8 +104,10 @@ public:
         PutByIdAccess result;
         result.m_oldStructure.set(vm, owner, structure);
         result.m_type = accessType;
-        if (chain)
+        if (chain) {
             result.m_chain.set(vm, owner, chain);
+            result.m_chainCount = chainCount;
+        }
         result.m_customSetter = customSetter;
         result.m_stubRoutine = stubRoutine;
         return result;
@@ -132,7 +136,7 @@ public:
     
     Structure* structure() const
     {
-        ASSERT(isReplace());
+        ASSERT(isReplace() || isSetter() || isCustom());
         return m_oldStructure.get();
     }
     
@@ -148,6 +152,12 @@ public:
         return m_chain.get();
     }
     
+    unsigned chainCount() const
+    {
+        ASSERT(isSetter() || isCustom());
+        return m_chainCount;
+    }
+    
     JITStubRoutine* stubRoutine() const
     {
         ASSERT(isTransition() || isReplace() || isSetter() || isCustom());
@@ -169,6 +179,7 @@ private:
     WriteBarrier<Structure> m_oldStructure;
     WriteBarrier<Structure> m_newStructure;
     WriteBarrier<StructureChain> m_chain;
+    unsigned m_chainCount;
     PutPropertySlot::PutValueFunc m_customSetter;
     RefPtr<JITStubRoutine> m_stubRoutine;
 };