X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..4be4e30906bcb8ee30b4d189205cb70bad6707ce:/runtime/PropertyNameArray.cpp diff --git a/runtime/PropertyNameArray.cpp b/runtime/PropertyNameArray.cpp index 0878e73..08a5296 100644 --- a/runtime/PropertyNameArray.cpp +++ b/runtime/PropertyNameArray.cpp @@ -21,30 +21,35 @@ #include "config.h" #include "PropertyNameArray.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->isIdentifier()); 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