References from code to Structures should be stronger than weak
[WebKit-https.git] / Source / JavaScriptCore / bytecode / PolymorphicAccess.cpp
index 91e2240..dacefb2 100644 (file)
@@ -554,6 +554,27 @@ bool AccessCase::visitWeak(VM& vm) const
     return true;
 }
 
+bool AccessCase::propagateTransitions(SlotVisitor& visitor) const
+{
+    bool result = true;
+    
+    if (m_structure)
+        result &= m_structure->markIfCheap(visitor);
+    
+    switch (m_type) {
+    case Transition:
+        if (Heap::isMarked(m_structure->previousID()))
+            visitor.appendUnbarrieredReadOnlyPointer(m_structure.get());
+        else
+            result = false;
+        break;
+    default:
+        break;
+    }
+    
+    return result;
+}
+
 void AccessCase::generateWithGuard(
     AccessGenerationState& state, CCallHelpers::JumpList& fallThrough)
 {
@@ -1487,6 +1508,14 @@ bool PolymorphicAccess::visitWeak(VM& vm) const
     return true;
 }
 
+bool PolymorphicAccess::propagateTransitions(SlotVisitor& visitor) const
+{
+    bool result = true;
+    for (unsigned i = 0; i < size(); ++i)
+        result &= at(i).propagateTransitions(visitor);
+    return result;
+}
+
 void PolymorphicAccess::dump(PrintStream& out) const
 {
     out.print(RawPointer(this), ":[");