X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..40a37d088818fc2fbeba2ef850dbcaaf294befbf:/heap/Strong.h diff --git a/heap/Strong.h b/heap/Strong.h index 7fafaea..27ab5d3 100644 --- a/heap/Strong.h +++ b/heap/Strong.h @@ -32,12 +32,13 @@ namespace JSC { -class JSGlobalData; +class VM; // A strongly referenced handle that prevents the object it points to from being garbage collected. template class Strong : public Handle { using Handle::slot; using Handle::setSlot; + template friend class Strong; public: typedef typename Handle::ExternalType ExternalType; @@ -47,9 +48,9 @@ public: { } - Strong(JSGlobalData&, ExternalType = ExternalType()); + Strong(VM&, ExternalType = ExternalType()); - Strong(JSGlobalData&, Handle); + Strong(VM&, Handle); Strong(const Strong& other) : Handle() @@ -94,7 +95,7 @@ public: ExternalType get() const { return HandleTypes::getFromSlot(this->slot()); } - void set(JSGlobalData&, ExternalType); + void set(VM&, ExternalType); template Strong& operator=(const Strong& other) { @@ -103,7 +104,7 @@ public: return *this; } - set(*HandleSet::heapFor(other.slot())->globalData(), other.get()); + set(*HandleSet::heapFor(other.slot())->vm(), other.get()); return *this; } @@ -114,7 +115,7 @@ public: return *this; } - set(*HandleSet::heapFor(other.slot())->globalData(), other.get()); + set(*HandleSet::heapFor(other.slot())->vm(), other.get()); return *this; } @@ -147,11 +148,11 @@ template inline void swap(Strong& a, Strong& b) namespace WTF { -template struct VectorTraits > : SimpleClassVectorTraits { +template struct VectorTraits> : SimpleClassVectorTraits { static const bool canCompareWithMemcmp = false; }; -template struct HashTraits > : SimpleClassHashTraits > { }; +template struct HashTraits> : SimpleClassHashTraits> { }; }