#include "config.h"
#include "PropertyNameArray.h"
+#include "JSCInlines.h"
+#include "JSObject.h"
+#include "Structure.h"
+#include "StructureChain.h"
+
namespace JSC {
static const size_t setThreshold = 20;
-void PropertyNameArray::add(UString::Rep* identifier)
+void PropertyNameArray::add(StringImpl* identifier)
{
- ASSERT(identifier == &UString::Rep::null() || identifier == &UString::Rep::empty() || identifier->identifierTable());
+ ASSERT(!identifier || identifier == StringImpl::empty() || identifier->isAtomic());
size_t size = m_data->propertyNameVector().size();
if (size < setThreshold) {
for (size_t i = 0; i < size; ++i) {
- if (identifier == m_data->propertyNameVector()[i].ustring().rep())
+ if (identifier == m_data->propertyNameVector()[i].impl())
return;
}
} else {
if (m_set.isEmpty()) {
for (size_t i = 0; i < size; ++i)
- m_set.add(m_data->propertyNameVector()[i].ustring().rep());
+ m_set.add(m_data->propertyNameVector()[i].impl());
}
- if (!m_set.add(identifier).second)
+ if (!m_set.add(identifier).isNewEntry)
return;
}
- m_data->propertyNameVector().append(Identifier(m_globalData, identifier));
+ addKnownUnique(identifier);
}
} // namespace JSC