X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..refs/heads/master:/runtime/JSSetIterator.cpp diff --git a/runtime/JSSetIterator.cpp b/runtime/JSSetIterator.cpp index 1fdfe29..3a0ddbe 100644 --- a/runtime/JSSetIterator.cpp +++ b/runtime/JSSetIterator.cpp @@ -29,28 +29,32 @@ #include "JSCJSValueInlines.h" #include "JSCellInlines.h" #include "JSSet.h" +#include "MapDataInlines.h" #include "SlotVisitorInlines.h" #include "StructureInlines.h" namespace JSC { -const ClassInfo JSSetIterator::s_info = { "Set Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSSetIterator) }; +const ClassInfo JSSetIterator::s_info = { "Set Iterator", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSetIterator) }; void JSSetIterator::finishCreation(VM& vm, JSSet* iteratedObject) { Base::finishCreation(vm); - m_iteratedObjectData.set(vm, this, iteratedObject->mapData()); + m_set.set(vm, this, iteratedObject); } void JSSetIterator::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSSetIterator* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - Base::visitChildren(thisObject, visitor); - visitor.append(&thisObject->m_iteratedObjectData); + visitor.append(&thisObject->m_set); +} + +void JSSetIterator::destroy(JSCell* cell) +{ + JSSetIterator* thisObject = jsCast(cell); + thisObject->JSSetIterator::~JSSetIterator(); } JSValue JSSetIterator::createPair(CallFrame* callFrame, JSValue key, JSValue value) @@ -62,4 +66,11 @@ JSValue JSSetIterator::createPair(CallFrame* callFrame, JSValue key, JSValue val return constructArray(callFrame, 0, globalObject, args); } +JSSetIterator* JSSetIterator::clone(ExecState* exec) +{ + auto clone = JSSetIterator::create(exec->vm(), exec->callee()->globalObject()->setIteratorStructure(), m_set.get(), m_kind); + clone->m_iterator = m_iterator; + return clone; +} + }