Ignore:
Timestamp:
Jun 9, 2014, 8:01:42 PM (11 years ago)
Author:
[email protected]
Message:

Global HashTables contain references to atomic StringImpls
https://bugs.webkit.org/show_bug.cgi?id=133661

Reviewed by Geoffrey Garen.

This was a long-standing bug revealed by bug 133558. The issue is that the global static HashTables
cache their set of keys as StringImpls that are associated with a particular VM. This is obviously
incompatible with using multiple VMs on multiple threads (e.g. when using workers). The fix is to
change the "keys" field of the static HashTables to be char instead of StringImpl.

  • runtime/JSObject.cpp:

(JSC::getClassPropertyNames):

  • runtime/Lookup.cpp:

(JSC::HashTable::createTable):
(JSC::HashTable::deleteTable):

  • runtime/Lookup.h:

(JSC::HashTable::ConstIterator::key):
(JSC::HashTable::entry):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r169703 r169740  
    8787        for (auto iter = table->begin(vm); iter != table->end(vm); ++iter) {
    8888            if ((!(iter->attributes() & DontEnum) || (mode == IncludeDontEnumProperties)) && !((iter->attributes() & BuiltinOrFunction) && didReify))
    89                 propertyNames.add(iter.key());
     89                propertyNames.add(Identifier(&vm, iter.key()));
    9090        }
    9191    }
Note: See TracChangeset for help on using the changeset viewer.