LLInt fails to mark structures stored in the bytecode
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 23:12:14 +0000 (23:12 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 23:12:14 +0000 (23:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91296

Reviewed by Geoffrey Garen.

LLInt stores structures in the bytecode, so we need to visit the appropriate
instructions as we would if we were running in the classic interpreter.
This requires adding additional checks for the LLInt specific opcodes, and
the lint specific variants of operand ordering.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitStructures):
(JSC::CodeBlock::stronglyVisitStrongReferences):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp

index 7465099..cc135ac 100644 (file)
@@ -1,3 +1,19 @@
+2012-07-13  Oliver Hunt  <oliver@apple.com>
+
+        LLInt fails to mark structures stored in the bytecode
+        https://bugs.webkit.org/show_bug.cgi?id=91296
+
+        Reviewed by Geoffrey Garen.
+
+        LLInt stores structures in the bytecode, so we need to visit the appropriate
+        instructions as we would if we were running in the classic interpreter.
+        This requires adding additional checks for the LLInt specific opcodes, and
+        the lint specific variants of operand ordering. 
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::visitStructures):
+        (JSC::CodeBlock::stronglyVisitStrongReferences):
+
 2012-07-13  Yong Li  <yoli@rim.com>
 
         [BlackBerry] Implement GCActivityCallback with platform timer
index d417a5f..4ca8f3e 100644 (file)
@@ -1840,11 +1840,11 @@ void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC)
 {
     Interpreter* interpreter = m_globalData->interpreter;
 
-    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) && vPC[4].u.structure) {
+    if ((vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_out_of_line)) && vPC[4].u.structure) {
         visitor.append(&vPC[4].u.structure);
         return;
     }
-
+    
     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
         visitor.append(&vPC[4].u.structure);
         return;
@@ -1860,6 +1860,16 @@ void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC)
             visitor.append(&vPC[5].u.structureChain);
         return;
     }
+#if ENABLE(LLINT)
+    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition_direct) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition_direct_out_of_line) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition_normal) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition_normal_out_of_line)) {
+        visitor.append(&vPC[4].u.structure);
+        visitor.append(&vPC[6].u.structure);
+        if (vPC[7].u.structureChain)
+            visitor.append(&vPC[7].u.structureChain);
+        return;
+    }
+#endif
+        
     if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
         visitor.append(&vPC[4].u.structure);
         visitor.append(&vPC[5].u.structure);
@@ -1867,7 +1877,7 @@ void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC)
             visitor.append(&vPC[6].u.structureChain);
         return;
     }
-    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) && vPC[4].u.structure) {
+    if ((vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_out_of_line)) && vPC[4].u.structure) {
         visitor.append(&vPC[4].u.structure);
         return;
     }
@@ -2238,6 +2248,14 @@ void CodeBlock::stronglyVisitStrongReferences(SlotVisitor& visitor)
             visitStructures(visitor, &instructions()[m_globalResolveInstructions[i]]);
     }
 #endif
+#if ENABLE(LLINT)
+    if (!m_globalData->interpreter->classicEnabled() && !!numberOfInstructions() && getJITType() < JITCode::bottomTierJIT()) {
+        for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i)
+            visitStructures(visitor, &instructions()[m_propertyAccessInstructions[i]]);
+        for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i)
+            visitStructures(visitor, &instructions()[m_globalResolveInstructions[i]]);
+    }
+#endif
 
     updateAllPredictions(Collection);
 }