From a4e969f4965059196ca948db781e52f7cfebf19e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 24 May 2016 08:28:08 +0000 Subject: webkitgtk-2.12.3 --- Source/JavaScriptCore/runtime/JSSet.cpp | 54 ++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 7 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSSet.cpp') diff --git a/Source/JavaScriptCore/runtime/JSSet.cpp b/Source/JavaScriptCore/runtime/JSSet.cpp index fdb6df548..46aaf3841 100644 --- a/Source/JavaScriptCore/runtime/JSSet.cpp +++ b/Source/JavaScriptCore/runtime/JSSet.cpp @@ -26,25 +26,65 @@ #include "config.h" #include "JSSet.h" +#include "CopiedBlockInlines.h" #include "JSCJSValueInlines.h" -#include "MapData.h" +#include "JSSetIterator.h" +#include "MapDataInlines.h" #include "SlotVisitorInlines.h" +#include "StructureInlines.h" namespace JSC { -const ClassInfo JSSet::s_info = { "Set", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSSet) }; +const ClassInfo JSSet::s_info = { "Set", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSet) }; + +void JSSet::destroy(JSCell* cell) +{ + JSSet* thisObject = jsCast(cell); + thisObject->JSSet::~JSSet(); +} + +size_t JSSet::estimatedSize(JSCell* cell) +{ + JSSet* thisObject = jsCast(cell); + size_t setDataSize = thisObject->m_setData.capacityInBytes(); + return Base::estimatedSize(cell) + setDataSize; +} void JSSet::visitChildren(JSCell* cell, SlotVisitor& visitor) { Base::visitChildren(cell, visitor); - JSSet* thisObject = jsCast(cell); - visitor.append(&thisObject->m_mapData); + jsCast(cell)->m_setData.visitChildren(cell, visitor); +} + +void JSSet::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token) +{ + Base::copyBackingStore(cell, visitor, token); + jsCast(cell)->m_setData.copyBackingStore(visitor, token); +} + +bool JSSet::has(ExecState* exec, JSValue value) +{ + return m_setData.contains(exec, value); +} + +size_t JSSet::size(ExecState* exec) +{ + return m_setData.size(exec); +} + +void JSSet::add(ExecState* exec, JSValue value) +{ + m_setData.set(exec, this, value, value); +} + +void JSSet::clear(ExecState*) +{ + m_setData.clear(); } -void JSSet::finishCreation(VM& vm) +bool JSSet::remove(ExecState* exec, JSValue value) { - Base::finishCreation(vm); - m_mapData.set(vm, this, MapData::create(vm)); + return m_setData.remove(exec, value); } } -- cgit v1.2.1