Bug 20874: op_resolve does not do any form of caching
[WebKit-https.git] / JavaScriptCore / VM / CodeBlock.cpp
index 7bff4b2..6b40c85 100644 (file)
@@ -214,6 +214,10 @@ void CodeBlock::printStructureIDs(const Instruction* vPC) const
         printStructureID("put_by_id_replace", vPC, 4);
         return;
     }
+    if (vPC[0].u.opcode == machine->getOpcode(op_resolve_global)) {
+        printStructureID("resolve_global", vPC, 4);
+        return;
+    }
 
     // These instructions doesn't ref StructureIDs.
     ASSERT(vPC[0].u.opcode == machine->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id_generic));
@@ -540,6 +544,14 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
             printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), skipLevels);
             break;
         }
+        case op_resolve_global: {
+            int r0 = (++it)->u.operand;
+            JSValue* scope = static_cast<JSValue*>((++it)->u.jsCell);
+            int id0 = (++it)->u.operand;
+            printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), idName(id0, identifiers[id0]).c_str());
+            it += 2;
+            break;
+        }
         case op_get_scoped_var: {
             int r0 = (++it)->u.operand;
             int index = (++it)->u.operand;
@@ -921,6 +933,11 @@ void CodeBlock::derefStructureIDs(Instruction* vPC) const
         vPC[4].u.structureID->deref();
         return;
     }
+    if (vPC[0].u.opcode == machine->getOpcode(op_resolve_global)) {
+        if(vPC[4].u.structureID)
+            vPC[4].u.structureID->deref();
+        return;
+    }
     
     // These instructions don't ref their StructureIDs.
     ASSERT(vPC[0].u.opcode == machine->getOpcode(op_get_by_id) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id) || vPC[0].u.opcode == machine->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_get_array_length) || vPC[0].u.opcode == machine->getOpcode(op_get_string_length));