diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp index 927ad25cf..72caa33db 100644 --- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp +++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp @@ -31,20 +31,26 @@ #include "JSActivation.h" #include "JSGlobalObject.h" -#include "JSStaticScopeObject.h" +#include "JSNameScope.h" #include "PropertyNameArray.h" namespace JSC { -void JSSymbolTableObject::destroy(JSCell* cell) +void JSSymbolTableObject::visitChildren(JSCell* cell, SlotVisitor& visitor) { - static_cast<JSSymbolTableObject*>(cell)->JSSymbolTableObject::~JSSymbolTableObject(); + JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + + Base::visitChildren(thisObject, visitor); + visitor.append(&thisObject->m_symbolTable); } bool JSSymbolTableObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) { JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(cell); - if (thisObject->symbolTable().contains(propertyName.publicName())) + if (thisObject->symbolTable()->contains(propertyName.publicName())) return false; return JSObject::deleteProperty(thisObject, exec, propertyName); @@ -53,8 +59,8 @@ bool JSSymbolTableObject::deleteProperty(JSCell* cell, ExecState* exec, Property void JSSymbolTableObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(object); - SymbolTable::const_iterator end = thisObject->symbolTable().end(); - for (SymbolTable::const_iterator it = thisObject->symbolTable().begin(); it != end; ++it) { + SymbolTable::const_iterator end = thisObject->symbolTable()->end(); + for (SymbolTable::const_iterator it = thisObject->symbolTable()->begin(); it != end; ++it) { if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties)) propertyNames.add(Identifier(exec, it->first.get())); } @@ -67,22 +73,4 @@ void JSSymbolTableObject::putDirectVirtual(JSObject*, ExecState*, PropertyName, ASSERT_NOT_REACHED(); } -bool JSSymbolTableObject::isDynamicScope(bool& requiresDynamicChecks) const -{ - switch (structure()->typeInfo().type()) { - case GlobalObjectType: - return static_cast<const JSGlobalObject*>(this)->isDynamicScope(requiresDynamicChecks); - case ActivationObjectType: - return static_cast<const JSActivation*>(this)->isDynamicScope(requiresDynamicChecks); - case StaticScopeObjectType: - return static_cast<const JSStaticScopeObject*>(this)->isDynamicScope(requiresDynamicChecks); - default: - ASSERT_NOT_REACHED(); - break; - } - - return false; -} - } // namespace JSC - |