diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/WeakMapData.h')
| -rw-r--r-- | Source/JavaScriptCore/runtime/WeakMapData.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/runtime/WeakMapData.h b/Source/JavaScriptCore/runtime/WeakMapData.h index cfcd85355..0cb7b735a 100644 --- a/Source/JavaScriptCore/runtime/WeakMapData.h +++ b/Source/JavaScriptCore/runtime/WeakMapData.h @@ -34,10 +34,9 @@ namespace JSC { -class WeakMapData final : public JSCell { +class WeakMapData : public JSCell { public: typedef JSCell Base; - static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal; static WeakMapData* create(VM& vm) { @@ -48,10 +47,11 @@ public: static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) { - return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info()); + return Structure::create(vm, globalObject, prototype, TypeInfo(CompoundType, StructureFlags), info()); } static const bool needsDestruction = true; + static const bool hasImmortalStructure = true; void set(VM&, JSObject*, JSValue); JSValue get(JSObject*); @@ -61,11 +61,7 @@ public: DECLARE_INFO; - typedef HashMap<JSObject*, WriteBarrier<Unknown>> MapType; - MapType::const_iterator begin() const { return m_map.begin(); } - MapType::const_iterator end() const { return m_map.end(); } - - int size() const { return m_map.size(); } + static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags; private: WeakMapData(VM&); @@ -82,10 +78,11 @@ private: private: virtual void visitWeakReferences(SlotVisitor&) override; virtual void finalizeUnconditionally() override; - unsigned m_liveKeyCount; + int m_liveKeyCount; WeakMapData* m_target; }; DeadKeyCleaner m_deadKeyCleaner; + typedef HashMap<JSObject*, WriteBarrier<Unknown>> MapType; MapType m_map; }; |
