X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..14957cd040308e3eeec43d26bae5d76da13fcd85:/runtime/PropertyNameArray.cpp?ds=inline diff --git a/runtime/PropertyNameArray.cpp b/runtime/PropertyNameArray.cpp index 0878e73..8efb406 100644 --- a/runtime/PropertyNameArray.cpp +++ b/runtime/PropertyNameArray.cpp @@ -21,30 +21,35 @@ #include "config.h" #include "PropertyNameArray.h" +#include "JSObject.h" +#include "ScopeChain.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) return; } - m_data->propertyNameVector().append(Identifier(m_globalData, identifier)); + addKnownUnique(identifier); } } // namespace JSC