#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<JSSetIterator*>(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<JSSetIterator*>(cell);
+ thisObject->JSSetIterator::~JSSetIterator();
}
JSValue JSSetIterator::createPair(CallFrame* callFrame, JSValue key, JSValue value)
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;
+}
+
}