void Structure::despecifyAllFunctions(JSGlobalData& globalData) { materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return; PropertyTable::iterator end = m_propertyTable->end(); for (PropertyTable::iterator iter = m_propertyTable->begin(); iter != end; ++iter) iter->specificValue.clear(); }
void Structure::despecifyDictionaryFunction(JSGlobalData& globalData, PropertyName propertyName) { StringImpl* rep = propertyName.uid(); materializePropertyMapIfNecessary(globalData); ASSERT(isDictionary()); ASSERT(m_propertyTable); PropertyMapEntry* entry = m_propertyTable->find(rep).first; ASSERT(entry); entry->specificValue.clear(); }
bool Structure::despecifyFunction(JSGlobalData& globalData, PropertyName propertyName) { materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return false; PropertyMapEntry* entry = m_propertyTable->find(propertyName.uid()).first; if (!entry) return false; ASSERT(entry->specificValue); entry->specificValue.clear(); return true; }
size_t Structure::get(JSGlobalData& globalData, StringImpl* propertyName, unsigned& attributes, JSCell*& specificValue) { materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return WTF::notFound; PropertyMapEntry* entry = m_propertyTable->find(propertyName).first; if (!entry) return WTF::notFound; attributes = entry->attributes; specificValue = entry->specificValue.get(); return entry->offset; }
PropertyOffset Structure::get(JSGlobalData& globalData, PropertyName propertyName, unsigned& attributes, JSCell*& specificValue) { ASSERT(structure()->classInfo() == &s_info); materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return invalidOffset; PropertyMapEntry* entry = m_propertyTable->find(propertyName.uid()).first; if (!entry) return invalidOffset; attributes = entry->attributes; specificValue = entry->specificValue.get(); return entry->offset; }
// In future we may want to cache this property. bool Structure::isSealed(JSGlobalData& globalData) { if (isExtensible()) return false; materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return true; PropertyTable::iterator end = m_propertyTable->end(); for (PropertyTable::iterator iter = m_propertyTable->begin(); iter != end; ++iter) { if ((iter->attributes & DontDelete) != DontDelete) return false; } return true; }
// In future we may want to cache this property. bool Structure::isFrozen(JSGlobalData& globalData) { if (isExtensible()) return false; materializePropertyMapIfNecessary(globalData); if (!propertyTable()) return true; PropertyTable::iterator end = propertyTable()->end(); for (PropertyTable::iterator iter = propertyTable()->begin(); iter != end; ++iter) { if (!(iter->attributes & DontDelete)) return false; if (!(iter->attributes & (ReadOnly | Accessor))) return false; } return true; }
void Structure::getPropertyNamesFromStructure(JSGlobalData& globalData, PropertyNameArray& propertyNames, EnumerationMode mode) { materializePropertyMapIfNecessary(globalData); if (!m_propertyTable) return; bool knownUnique = !propertyNames.size(); PropertyTable::iterator end = m_propertyTable->end(); for (PropertyTable::iterator iter = m_propertyTable->begin(); iter != end; ++iter) { ASSERT(m_hasNonEnumerableProperties || !(iter->attributes & DontEnum)); if (iter->key->isIdentifier() && (!(iter->attributes & DontEnum) || mode == IncludeDontEnumProperties)) { if (knownUnique) propertyNames.addKnownUnique(iter->key); else propertyNames.add(iter->key); } } }