]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - ftl/FTLAbstractHeap.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / ftl / FTLAbstractHeap.h
index c3e29077c890f1be2e2271051f5faaac35be83dd..a19ce38a5328e07518476aaaf96c3404ed2855a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,7 +34,6 @@
 #include <wtf/FastMalloc.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/CString.h>
 
@@ -72,6 +71,11 @@ public:
         m_parent = parent;
         m_heapName = heapName;
     }
+    
+    void changeParent(AbstractHeap* parent)
+    {
+        m_parent = parent;
+    }
 
     AbstractHeap* parent() const
     {
@@ -95,6 +99,8 @@ public:
     
     void decorateInstruction(LValue instruction, const AbstractHeapRepository&) const;
 
+    void dump(PrintStream&) const;
+
 private:
     friend class AbstractHeapRepository;
     
@@ -131,6 +137,8 @@ public:
         return m_offset;
     }
     
+    void dump(PrintStream&) const;
+
 private:
     ptrdiff_t m_offset;
 };
@@ -153,6 +161,8 @@ public:
     
     TypedPointer baseIndex(Output& out, LValue base, LValue index, JSValue indexAsConstant = JSValue(), ptrdiff_t offset = 0);
     
+    void dump(PrintStream&) const;
+
 private:
     const AbstractField& returnInitialized(AbstractField& field, ptrdiff_t index)
     {
@@ -178,7 +188,7 @@ private:
     };
     typedef HashMap<ptrdiff_t, std::unique_ptr<AbstractField>, WTF::IntHash<ptrdiff_t>, WithoutZeroOrOneHashTraits> MapType;
     
-    OwnPtr<MapType> m_largeIndices;
+    std::unique_ptr<MapType> m_largeIndices;
     Vector<CString, 16> m_largeIndexNames;
 };
 
@@ -197,6 +207,8 @@ public:
     const AbstractHeap& at(unsigned number) { return m_indexedHeap.at(number); }
     const AbstractHeap& operator[](unsigned number) { return at(number); }
 
+    void dump(PrintStream&) const;
+
 private:
     
     // We use the fact that the indexed heap already has a superset of the
@@ -218,6 +230,8 @@ public:
     
     const AbstractHeap& operator[](void* address) { return at(address); }
 
+    void dump(PrintStream&) const;
+
 private:
     // The trick here is that the indexed heap is "indexed" by a pointer-width
     // integer. Pointers are themselves pointer-width integers. So we can reuse