Ignore:
Timestamp:
May 3, 2010, 4:03:37 PM (15 years ago)
Author:
[email protected]
Message:

Rolling out r58114 - this introduced memory leaks of
AtomicStrings then workers terminated.

Reviewed by NOBODY (reverting previous commit).

(JSC::ThunkHelpers::stringImplDataOffset):

  • runtime/Identifier.cpp:

(JSC::IdentifierTable::~IdentifierTable):
(JSC::IdentifierTable::add):
(JSC::IdentifierCStringTranslator::hash):
(JSC::IdentifierCStringTranslator::equal):
(JSC::IdentifierCStringTranslator::translate):
(JSC::Identifier::add):
(JSC::IdentifierUCharBufferTranslator::hash):
(JSC::IdentifierUCharBufferTranslator::equal):
(JSC::IdentifierUCharBufferTranslator::translate):
(JSC::Identifier::addSlowCase):

  • runtime/Identifier.h:
  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):

  • runtime/JSGlobalData.h:
  • wtf/WTFThreadData.cpp:

(WTF::WTFThreadData::WTFThreadData):
(WTF::WTFThreadData::~WTFThreadData):

  • wtf/WTFThreadData.h:

(JSC::IdentifierTable::remove):
(JSC::IdentifierTable::literalTable):
(WTF::WTFThreadData::atomicStringTable):

  • wtf/text/AtomicString.cpp:

(WebCore::AtomicStringTable::create):
(WebCore::AtomicStringTable::table):
(WebCore::AtomicStringTable::destroy):
(WebCore::stringTable):
(WebCore::CStringTranslator::hash):
(WebCore::CStringTranslator::equal):
(WebCore::CStringTranslator::translate):
(WebCore::operator==):
(WebCore::AtomicString::add):
(WebCore::equal):
(WebCore::UCharBufferTranslator::hash):
(WebCore::UCharBufferTranslator::equal):
(WebCore::UCharBufferTranslator::translate):
(WebCore::HashAndCharactersTranslator::hash):
(WebCore::HashAndCharactersTranslator::equal):
(WebCore::HashAndCharactersTranslator::translate):
(WebCore::AtomicString::find):
(WebCore::AtomicString::remove):

  • wtf/text/AtomicStringTable.h: Removed.
  • wtf/text/StringImpl.cpp:

(WebCore::StringImpl::~StringImpl):

  • wtf/text/StringImpl.h:

(WebCore::StringImpl::inTable):
(WebCore::StringImpl::setInTable):
(WebCore::equal):

  • wtf/text/StringImplBase.h:

(WTF::StringImplBase::StringImplBase):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/WTFThreadData.h

    r58114 r58712  
    2828#define WTFThreadData_h
    2929
     30#include <wtf/HashMap.h>
     31#include <wtf/HashSet.h>
    3032#include <wtf/Noncopyable.h>
     33#include <wtf/text/StringHash.h>
    3134
    3235// This was ENABLE(WORKERS) in WebCore, but this is not defined when compiling JSC.
     
    4447
    4548// FIXME: This is a temporary layering violation while we move more string code to WTF.
    46 namespace JSC {
    47 class IdentifierTable;
    48 }
    49 
    50 // FIXME: This is a temporary layering violation while we move more string code to WTF.
    5149namespace WebCore {
    5250class AtomicStringTable;
     51class StringImpl;
    5352}
     53using WebCore::StringImpl;
     54
     55typedef void (*AtomicStringTableDestructor)(WebCore::AtomicStringTable*);
     56
     57#if USE(JSC)
     58// FIXME: This is a temporary layering violation while we move more string code to WTF.
     59namespace JSC {
     60
     61typedef HashMap<const char*, RefPtr<StringImpl>, PtrHash<const char*> > LiteralIdentifierTable;
     62
     63class IdentifierTable : public FastAllocBase {
     64public:
     65    ~IdentifierTable();
     66
     67    std::pair<HashSet<StringImpl*>::iterator, bool> add(StringImpl* value);
     68    template<typename U, typename V>
     69    std::pair<HashSet<StringImpl*>::iterator, bool> add(U value);
     70
     71    void remove(StringImpl* r) { m_table.remove(r); }
     72
     73    LiteralIdentifierTable& literalTable() { return m_literalTable; }
     74
     75private:
     76    HashSet<StringImpl*> m_table;
     77    LiteralIdentifierTable m_literalTable;
     78};
     79
     80}
     81#endif
    5482
    5583namespace WTF {
     
    6088    ~WTFThreadData();
    6189
    62     WebCore::AtomicStringTable& atomicStringTable()
     90    WebCore::AtomicStringTable* atomicStringTable()
    6391    {
    64         return *m_atomicStringTable;
     92        return m_atomicStringTable;
    6593    }
    6694
     
    92120private:
    93121    WebCore::AtomicStringTable* m_atomicStringTable;
     122    AtomicStringTableDestructor m_atomicStringTableDestructor;
    94123
    95124#if USE(JSC)
     
    104133#endif
    105134    friend WTFThreadData& wtfThreadData();
     135    friend class WebCore::AtomicStringTable;
    106136};
    107137
Note: See TracChangeset for help on using the changeset viewer.