Ignore:
Timestamp:
Jun 1, 2020, 5:51:53 PM (5 years ago)
Author:
[email protected]
Message:

Correct misunderstandings on how ThreadSpecific work
https://bugs.webkit.org/show_bug.cgi?id=212616

Reviewed by Michael Saboff.

There were two misunderstandings I had when writing code using ThreadSpecific
when doing LLInt bytecode buffer caching in Wasm.

  1. For ThreadSpecific<Vector>, I was calling Vector's constructor twice

unnecessarily, and incorrectly, since we ended up constructing over an
already constructed Vector for the second call. When doing operator* or
operator-> on a ThreadSpecific<T>, T() is called if it has not been
initialized yet. So there is no need to do manually call the constructor
the second time.

  1. There is no need to try to destroy entries for ThreadSpecific manually

since we already run destructors when the thread goes away.

This patch removes code for (1) and (2) both from the Wasm bytecode
buffer and from AssemblerData.

  • assembler/AssemblerBuffer.cpp:

(JSC::clearAssembleDataThreadSpecificCache): Deleted.

  • assembler/AssemblerBuffer.h:

(JSC::AssemblerBuffer::AssemblerBuffer):
(JSC::AssemblerBuffer::~AssemblerBuffer):
(JSC::AssemblerBuffer::getThreadSpecificAssemblerData): Deleted.

  • dfg/DFGWorklist.cpp:
  • jit/JITWorklist.cpp:
  • wasm/WasmLLIntGenerator.cpp:

(JSC::Wasm::LLIntGenerator::LLIntGenerator):
(JSC::Wasm::clearLLIntThreadSpecificCache): Deleted.

  • wasm/WasmLLIntGenerator.h:
  • wasm/WasmWorklist.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r262393 r262402  
     12020-06-01  Saam Barati  <[email protected]>
     2
     3        Correct misunderstandings on how ThreadSpecific work
     4        https://bugs.webkit.org/show_bug.cgi?id=212616
     5
     6        Reviewed by Michael Saboff.
     7
     8        There were two misunderstandings I had when writing code using ThreadSpecific
     9        when doing LLInt bytecode buffer caching in Wasm.
     10       
     11        1. For ThreadSpecific<Vector>, I was calling Vector's constructor twice
     12        unnecessarily, and incorrectly, since we ended up constructing over an
     13        already constructed Vector for the second call. When doing operator* or
     14        operator-> on a ThreadSpecific<T>, T() is called if it has not been
     15        initialized yet. So there is no need to do manually call the constructor
     16        the second time.
     17       
     18        2. There is no need to try to destroy entries for ThreadSpecific manually
     19        since we already run destructors when the thread goes away.
     20       
     21        This patch removes code for (1) and (2) both from the Wasm bytecode
     22        buffer and from AssemblerData.
     23
     24        * assembler/AssemblerBuffer.cpp:
     25        (JSC::clearAssembleDataThreadSpecificCache): Deleted.
     26        * assembler/AssemblerBuffer.h:
     27        (JSC::AssemblerBuffer::AssemblerBuffer):
     28        (JSC::AssemblerBuffer::~AssemblerBuffer):
     29        (JSC::AssemblerBuffer::getThreadSpecificAssemblerData): Deleted.
     30        * dfg/DFGWorklist.cpp:
     31        * jit/JITWorklist.cpp:
     32        * wasm/WasmLLIntGenerator.cpp:
     33        (JSC::Wasm::LLIntGenerator::LLIntGenerator):
     34        (JSC::Wasm::clearLLIntThreadSpecificCache): Deleted.
     35        * wasm/WasmLLIntGenerator.h:
     36        * wasm/WasmWorklist.cpp:
     37
    1382020-06-01  Yusuke Suzuki  <[email protected]>
    239
Note: See TracChangeset for help on using the changeset viewer.