Ignore:
Timestamp:
Jul 24, 2013, 8:59:04 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: SymbolTable should be thread-safe
https://bugs.webkit.org/show_bug.cgi?id=115301

Reviewed by Geoffrey Garen.

Makes SymbolTable thread-safe. Relies on SymbolTableEntry already being immutable,
other than the WatchpointSet; but the WatchpointSet already has a righteous
concurrency protocol. So, this patch just protects the SymbolTable's HashMap.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::nameForRegister):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::addVar):

  • runtime/Executable.cpp:

(JSC::ProgramExecutable::addGlobalVar):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::getOwnNonIndexPropertyNames):
(JSC::JSActivation::symbolTablePutWithAttributes):

  • runtime/JSSymbolTableObject.cpp:

(JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):

  • runtime/JSSymbolTableObject.h:

(JSC::symbolTableGet):
(JSC::symbolTablePut):
(JSC::symbolTablePutWithAttributes):

  • runtime/SymbolTable.cpp:

(JSC::SymbolTable::SymbolTable):
(JSC::SymbolTable::~SymbolTable):

  • runtime/SymbolTable.h:

(JSC::SymbolTable::find):
(JSC::SymbolTable::get):
(JSC::SymbolTable::inlineGet):
(JSC::SymbolTable::begin):
(JSC::SymbolTable::end):
(JSC::SymbolTable::size):
(JSC::SymbolTable::add):
(JSC::SymbolTable::set):
(JSC::SymbolTable::contains):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r152494 r153132  
    138138bool BytecodeGenerator::addVar(const Identifier& ident, bool isConstant, RegisterID*& r0)
    139139{
     140    SymbolTable::Locker locker(symbolTable().m_lock);
    140141    int index = m_calleeRegisters.size();
    141142    SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
    142     SymbolTable::AddResult result = symbolTable().add(ident.impl(), newEntry);
     143    SymbolTable::Map::AddResult result = symbolTable().add(locker, ident.impl(), newEntry);
    143144
    144145    if (!result.isNewEntry) {
Note: See TracChangeset for help on using the changeset viewer.