summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
index 5dfd919..1e4c429 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp
@@ -285,7 +285,7 @@ void Structure::materializePropertyMap()
}
}
-void Structure::getEnumerablePropertyNames(ExecState* exec, PropertyNameArray& propertyNames, JSObject* baseObject)
+void Structure::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, JSObject* baseObject, bool includeNonEnumerable)
{
bool shouldCache = propertyNames.shouldCache() && !(propertyNames.size() || m_isDictionary);
@@ -297,8 +297,8 @@ void Structure::getEnumerablePropertyNames(ExecState* exec, PropertyNameArray& p
clearEnumerationCache();
}
- getEnumerableNamesFromPropertyTable(propertyNames);
- getEnumerableNamesFromClassInfoTable(exec, baseObject->classInfo(), propertyNames);
+ getNamesFromPropertyTable(propertyNames, includeNonEnumerable);
+ getNamesFromClassInfoTable(exec, baseObject->classInfo(), propertyNames, includeNonEnumerable);
if (m_prototype.isObject()) {
propertyNames.setShouldCache(false); // No need for our prototypes to waste memory on caching, since they're not being enumerated directly.
@@ -1008,7 +1008,7 @@ static int comparePropertyMapEntryIndices(const void* a, const void* b)
return 0;
}
-void Structure::getEnumerableNamesFromPropertyTable(PropertyNameArray& propertyNames)
+void Structure::getNamesFromPropertyTable(PropertyNameArray& propertyNames, bool includeNonEnumerable)
{
materializePropertyMapIfNecessary();
if (!m_propertyTable)
@@ -1019,7 +1019,8 @@ void Structure::getEnumerableNamesFromPropertyTable(PropertyNameArray& propertyN
int i = 0;
unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
for (unsigned k = 1; k <= entryCount; k++) {
- if (m_propertyTable->entries()[k].key && !(m_propertyTable->entries()[k].attributes & DontEnum)) {
+ if (m_propertyTable->entries()[k].key
+ && (includeNonEnumerable || !(m_propertyTable->entries()[k].attributes & DontEnum))) {
PropertyMapEntry* value = &m_propertyTable->entries()[k];
int j;
for (j = i - 1; j >= 0 && a[j]->index > value->index; --j)
@@ -1046,7 +1047,8 @@ void Structure::getEnumerableNamesFromPropertyTable(PropertyNameArray& propertyN
PropertyMapEntry** p = sortedEnumerables.data();
unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
for (unsigned i = 1; i <= entryCount; i++) {
- if (m_propertyTable->entries()[i].key && !(m_propertyTable->entries()[i].attributes & DontEnum))
+ if (m_propertyTable->entries()[i].key
+ && (includeNonEnumerable || !(m_propertyTable->entries()[i].attributes & DontEnum)))
*p++ = &m_propertyTable->entries()[i];
}
@@ -1065,7 +1067,7 @@ void Structure::getEnumerableNamesFromPropertyTable(PropertyNameArray& propertyN
}
}
-void Structure::getEnumerableNamesFromClassInfoTable(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames)
+void Structure::getNamesFromClassInfoTable(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, bool includeNonEnumerable)
{
// Add properties from the static hashtables of properties
for (; classInfo; classInfo = classInfo->parentClass) {
@@ -1078,7 +1080,7 @@ void Structure::getEnumerableNamesFromClassInfoTable(ExecState* exec, const Clas
int hashSizeMask = table->compactSize - 1;
const HashEntry* entry = table->table;
for (int i = 0; i <= hashSizeMask; ++i, ++entry) {
- if (entry->key() && !(entry->attributes() & DontEnum))
+ if (entry->key() && (includeNonEnumerable || !(entry->attributes() & DontEnum)))
propertyNames.add(entry->key());
}
}