X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/fb8617cde5834786bd4e4afd579883e4acf5666e..4e4e5a6f2694187498445a6ac6f1634ce8141119:/runtime/JSPropertyNameIterator.h?ds=sidebyside diff --git a/runtime/JSPropertyNameIterator.h b/runtime/JSPropertyNameIterator.h index 3f533a0..01700ac 100644 --- a/runtime/JSPropertyNameIterator.h +++ b/runtime/JSPropertyNameIterator.h @@ -67,8 +67,13 @@ namespace JSC { JSValue get(ExecState*, JSObject*, size_t i); size_t size() { return m_jsStringsSize; } - void setCachedStructure(Structure* structure) { m_cachedStructure = structure; } - Structure* cachedStructure() { return m_cachedStructure; } + void setCachedStructure(Structure* structure) + { + ASSERT(!m_cachedStructure); + ASSERT(structure); + m_cachedStructure = structure; + } + Structure* cachedStructure() { return m_cachedStructure.get(); } void setCachedPrototypeChain(NonNullPassRefPtr cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; } StructureChain* cachedPrototypeChain() { return m_cachedPrototypeChain.get(); } @@ -76,7 +81,7 @@ namespace JSC { private: JSPropertyNameIterator(ExecState*, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot); - Structure* m_cachedStructure; + RefPtr m_cachedStructure; RefPtr m_cachedPrototypeChain; uint32_t m_numCacheableSlots; uint32_t m_jsStringsSize;