Ignore:
Timestamp:
Sep 29, 2021, 9:44:10 AM (4 years ago)
Author:
[email protected]
Message:

[JSC] Use FixedVector in JITConstantPool
https://bugs.webkit.org/show_bug.cgi?id=230937

Reviewed by Keith Miller.

This patch changes JITConstantPool to use FixedVector. This allocates exact size
of memory and Making sizeof(JITConstantPool) smaller. We also use CompactPointerTuple
for JITConstantPool::Value since it is faster for access.

To achieve that, in JIT, we append Value to normal Vector. And when finalizing BaselineJITCode
we construct JITConstantPool from that Vector.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::setupWithUnlinkedBaselineCode):

  • jit/BaselineJITCode.h:

(JSC::JITConstantPool::JITConstantPool):
(JSC::JITConstantPool::add): Deleted.

  • jit/JIT.cpp:

(JSC::JIT::JIT):
(JSC::JIT::addToConstantPool):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::emit_op_iterator_open):
(JSC::JIT::emit_op_iterator_next):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emitNewFuncExprCommon):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_get_private_name):
(JSC::JIT::emit_op_set_private_brand):
(JSC::JIT::emit_op_check_private_brand):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emit_op_put_private_name):
(JSC::JIT::emit_op_del_by_id):
(JSC::JIT::emit_op_del_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emitHasPrivate):
(JSC::JIT::emit_op_enumerator_get_by_val):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r283139 r283229  
    7878    , m_loopOSREntryBytecodeIndex(loopOSREntryBytecodeIndex)
    7979{
    80     m_globalObjectConstant = m_constantPool.add(JITConstantPool::Type::GlobalObject);
     80    m_globalObjectConstant = addToConstantPool(JITConstantPool::Type::GlobalObject);
    8181    m_profiledCodeBlock = codeBlock;
    8282    m_unlinkedCodeBlock = codeBlock->unlinkedCodeBlock();
     
    8585JIT::~JIT()
    8686{
     87}
     88
     89JITConstantPool::Constant JIT::addToConstantPool(JITConstantPool::Type type, void* payload)
     90{
     91    unsigned result = m_constantPool.size();
     92    m_constantPool.append(JITConstantPool::Value { payload, type });
     93    return result;
    8794}
    8895
Note: See TracChangeset for help on using the changeset viewer.