Try ripping out inferred types because it might be a performance improvement
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGGraph.cpp
index 146d727..4d72d77 100644 (file)
@@ -281,7 +281,6 @@ void Graph::dump(PrintStream& out, const char* prefix, Node* node, DumpContext*
         StorageAccessData& storageAccessData = node->storageAccessData();
         out.print(comma, "id", storageAccessData.identifierNumber, "{", identifiers()[storageAccessData.identifierNumber], "}");
         out.print(", ", static_cast<ptrdiff_t>(storageAccessData.offset));
-        out.print(", inferredType = ", inContext(storageAccessData.inferredType, context));
     }
     if (node->hasMultiGetByOffsetData()) {
         MultiGetByOffsetData& data = node->multiGetByOffsetData();
@@ -1059,38 +1058,6 @@ bool Graph::isSafeToLoad(JSObject* base, PropertyOffset offset)
     return m_safeToLoad.contains(std::make_pair(base, offset));
 }
 
-InferredType::Descriptor Graph::inferredTypeFor(const PropertyTypeKey& key)
-{
-    assertIsRegistered(key.structure());
-    
-    auto iter = m_inferredTypes.find(key);
-    if (iter != m_inferredTypes.end())
-        return iter->value;
-
-    InferredType* typeObject = key.structure()->inferredTypeFor(key.uid());
-    if (!typeObject) {
-        m_inferredTypes.add(key, InferredType::Top);
-        return InferredType::Top;
-    }
-
-    InferredType::Descriptor typeDescriptor = typeObject->descriptor();
-    if (typeDescriptor.kind() == InferredType::Top) {
-        m_inferredTypes.add(key, InferredType::Top);
-        return InferredType::Top;
-    }
-    
-    m_inferredTypes.add(key, typeDescriptor);
-
-    m_plan.weakReferences().addLazily(typeObject);
-    registerInferredType(typeDescriptor);
-
-    // Note that we may already be watching this desired inferred type, because multiple structures may
-    // point to the same InferredType instance.
-    m_plan.watchpoints().addLazily(DesiredInferredType(typeObject, typeDescriptor));
-
-    return typeDescriptor;
-}
-
 FullBytecodeLiveness& Graph::livenessFor(CodeBlock* codeBlock)
 {
     HashMap<CodeBlock*, std::unique_ptr<FullBytecodeLiveness>>::iterator iter = m_bytecodeLiveness.find(codeBlock);
@@ -1320,22 +1287,7 @@ JSValue Graph::tryGetConstantProperty(const AbstractValue& base, PropertyOffset
 }
 
 AbstractValue Graph::inferredValueForProperty(
-    const RegisteredStructureSet& base, UniquedStringImpl* uid, StructureClobberState clobberState)
-{
-    AbstractValue result;
-    base.forEach(
-        [&] (RegisteredStructure structure) {
-            AbstractValue value;
-            value.set(*this, inferredTypeForProperty(structure.get(), uid));
-            result.merge(value);
-        });
-    if (clobberState == StructuresAreClobbered)
-        result.clobberStructures();
-    return result;
-}
-
-AbstractValue Graph::inferredValueForProperty(
-    const AbstractValue& base, UniquedStringImpl* uid, PropertyOffset offset,
+    const AbstractValue& base, PropertyOffset offset,
     StructureClobberState clobberState)
 {
     if (JSValue value = tryGetConstantProperty(base, offset)) {
@@ -1344,9 +1296,6 @@ AbstractValue Graph::inferredValueForProperty(
         return result;
     }
 
-    if (base.m_structure.isFinite())
-        return inferredValueForProperty(base.m_structure.set(), uid, clobberState);
-
     return AbstractValue::heapTop();
 }