Skip to content
  • oliver@apple.com's avatar
    fourthTier: Profiler should be thread-safe · 4bba8c0b
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=115445
    
    Reviewed by Geoffrey Garen.
    
    Change the Profiler::Database API for Compilation creation so that we don't add
    it to the Database until it's completely constructed. This prevents the Database
    from seeing Compilations that are being concurrently constructed.
    
    Change the Profiler::Database itself to do locking for creation of Bytecodes and
    for modifying the map. This map may be consulted by both the main thread and the
    concurrent thread.
    
    * dfg/DFGGraph.cpp:
    (JSC::DFG::Graph::Graph):
    * dfg/DFGJITCompiler.cpp:
    (JSC::DFG::JITCompiler::link):
    (JSC::DFG::JITCompiler::linkFunction):
    * jit/JIT.cpp:
    (JSC::JIT::privateCompile):
    * profiler/ProfilerBytecodes.h:
    * profiler/ProfilerDatabase.cpp:
    (JSC::Profiler::Database::ensureBytecodesFor):
    (JSC::Profiler::Database::notifyDestruction):
    (JSC::Profiler::Database::addCompilation):
    * profiler/ProfilerDatabase.h:
    (Database):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4bba8c0b