]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - dfg/DFGStructureAbstractValue.h
JavaScriptCore-7600.1.4.15.12.tar.gz
[apple/javascriptcore.git] / dfg / DFGStructureAbstractValue.h
index fb5dfdaa6363999caa0c91db0bb372e39aa9d6c1..10e476c6e0afc45adee9417403cbf6ed128c746a 100644 (file)
 #ifndef DFGStructureAbstractValue_h
 #define DFGStructureAbstractValue_h
 
-#include <wtf/Platform.h>
-
 #if ENABLE(DFG_JIT)
 
 #include "JSCell.h"
 #include "SpeculatedType.h"
+#include "DumpContext.h"
 #include "StructureSet.h"
 
 namespace JSC { namespace DFG {
@@ -282,6 +281,15 @@ public:
         return speculationFromStructure(m_structure);
     }
     
+    bool isValidOffset(PropertyOffset offset)
+    {
+        if (isTop())
+            return false;
+        if (isClear())
+            return true;
+        return m_structure->isValidOffset(offset);
+    }
+    
     bool hasSingleton() const
     {
         return isNeitherClearNorTop();
@@ -298,7 +306,7 @@ public:
         return m_structure == other.m_structure;
     }
     
-    void dump(PrintStream& out) const
+    void dumpInContext(PrintStream& out, DumpContext* context) const
     {
         if (isTop()) {
             out.print("TOP");
@@ -307,10 +315,15 @@ public:
         
         out.print("[");
         if (m_structure)
-            out.print(RawPointer(m_structure), "(", m_structure->classInfo()->className, ")");
+            out.print(inContext(*m_structure, context));
         out.print("]");
     }
 
+    void dump(PrintStream& out) const
+    {
+        dumpInContext(out, 0);
+    }
+
 private:
     static Structure* topValue() { return reinterpret_cast<Structure*>(1); }