#include "config.h"
#include "HashMapImpl.h"
#include "JSCInlines.h"
namespace JSC {
template<>
const ClassInfo HashMapBucket<HashMapBucketDataKey>::s_info =
{ "HashMapBucket", nullptr, 0, CREATE_METHOD_TABLE(HashMapBucket<HashMapBucketDataKey>) };
template<>
const ClassInfo HashMapBucket<HashMapBucketDataKeyValue>::s_info =
{ "HashMapBucket", nullptr, 0, CREATE_METHOD_TABLE(HashMapBucket<HashMapBucketDataKeyValue>) };
template <typename Data>
void HashMapBucket<Data>::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
HashMapBucket* thisObject = jsCast<HashMapBucket*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
Base::visitChildren(thisObject, visitor);
visitor.append(thisObject->m_next);
visitor.append(thisObject->m_prev);
static_assert(sizeof(Data) % sizeof(WriteBarrier<Unknown>) == 0, "We assume that these are filled with WriteBarrier<Unknown> members only.");
visitor.appendValues(bitwise_cast<WriteBarrier<Unknown>*>(&thisObject->m_data), sizeof(Data) / sizeof(WriteBarrier<Unknown>));
}
template<>
const ClassInfo HashMapImpl<HashMapBucket<HashMapBucketDataKey>>::s_info =
{ "HashMapImpl", nullptr, 0, CREATE_METHOD_TABLE(HashMapImpl<HashMapBucket<HashMapBucketDataKey>>) };
template<>
const ClassInfo HashMapImpl<HashMapBucket<HashMapBucketDataKeyValue>>::s_info =
{ "HashMapImpl", nullptr, 0, CREATE_METHOD_TABLE(HashMapImpl<HashMapBucket<HashMapBucketDataKeyValue>>) };
template <typename HashMapBucket>
void HashMapImpl<HashMapBucket>::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
HashMapImpl* thisObject = jsCast<HashMapImpl*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
Base::visitChildren(thisObject, visitor);
visitor.append(thisObject->m_head);
visitor.append(thisObject->m_tail);
if (HashMapBufferType* buffer = thisObject->m_buffer.get())
visitor.markAuxiliary(buffer);
}
const ClassInfo* getHashMapBucketKeyClassInfo()
{
return &HashMapBucket<HashMapBucketDataKey>::s_info;
}
const ClassInfo* getHashMapBucketKeyValueClassInfo()
{
return &HashMapBucket<HashMapBucketDataKeyValue>::s_info;
}
const ClassInfo* getHashMapImplKeyClassInfo()
{
return &HashMapImpl<HashMapBucket<HashMapBucketDataKey>>::s_info;
}
const ClassInfo* getHashMapImplKeyValueClassInfo()
{
return &HashMapImpl<HashMapBucket<HashMapBucketDataKeyValue>>::s_info;
}
}