Ignore:
Timestamp:
Jun 21, 2021, 11:41:14 PM (4 years ago)
Author:
Ross Kirsling
Message:

[JSC] Add JIT ICs for #x in obj feature
https://bugs.webkit.org/show_bug.cgi?id=226146

Reviewed by Saam Barati.

JSTests:

  • microbenchmarks/has-private-brand.js: Added.
  • microbenchmarks/has-private-name.js: Added.

Source/JavaScriptCore:

This patch implements JIT ICs for the new #x in obj feature and turns the feature on by default.
Implementation closely follows InByVal, though HasPrivateBrand has a few subtleties
(namely, it cannot be viewed in terms of a PropertySlot and should not be converted to InById).

Microbenchmarks:

has-private-name 46.5777+-0.1374 6.0589+-0.0296 definitely 7.6875x faster
has-private-brand 25.8823+-0.0561 19.1509+-0.0447 definitely 1.3515x faster

  • bytecode/StructureStubInfo.cpp:

(JSC::StructureStubInfo::reset):

  • bytecode/StructureStubInfo.h:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleInByAsMatchStructure):
(JSC::DFG::ByteCodeParser::handleInById):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileInByVal):
(JSC::DFG::SpeculativeJIT::compileHasPrivate):
(JSC::DFG::SpeculativeJIT::compileHasPrivateName):
(JSC::DFG::SpeculativeJIT::compileHasPrivateBrand):

  • dfg/DFGSpeculativeJIT.h:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

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

(JSC::JITInByValGenerator::JITInByValGenerator):

  • jit/JITInlineCacheGenerator.h:
  • jit/JITOperations.cpp:

(JSC::JSC_DEFINE_JIT_OPERATION):

  • jit/JITOperations.h:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emitHasPrivate):
(JSC::JIT::emitHasPrivateSlow):
(JSC::JIT::emit_op_has_private_name):
(JSC::JIT::emitSlow_op_has_private_name):
(JSC::JIT::emit_op_has_private_brand):
(JSC::JIT::emitSlow_op_has_private_brand):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emitHasPrivate):
(JSC::JIT::emitHasPrivateSlow):
(JSC::JIT::emit_op_has_private_name):
(JSC::JIT::emitSlow_op_has_private_name):
(JSC::JIT::emit_op_has_private_brand):
(JSC::JIT::emitSlow_op_has_private_brand):

  • jit/Repatch.cpp:

(JSC::appropriateOptimizingInByFunction):
(JSC::appropriateGenericInByFunction):
(JSC::tryCacheInBy):
(JSC::repatchInBy):
(JSC::tryCacheHasPrivateBrand):
(JSC::repatchHasPrivateBrand):
(JSC::resetInBy):
(JSC::resetHasPrivateBrand):

  • jit/Repatch.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LLIntSlowPaths.h:
  • llint/LowLevelInterpreter.asm:
  • runtime/CommonSlowPaths.cpp:
  • runtime/CommonSlowPaths.h:
  • runtime/OptionsList.h:
File:
1 edited

Legend:

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

    r279049 r279105  
    286286
    287287        switch (opcodeID) {
    288         DEFINE_SLOW_OP(has_private_name)
    289         DEFINE_SLOW_OP(has_private_brand)
    290288        DEFINE_SLOW_OP(less)
    291289        DEFINE_SLOW_OP(lesseq)
     
    362360        DEFINE_OP(op_in_by_id)
    363361        DEFINE_OP(op_in_by_val)
     362        DEFINE_OP(op_has_private_name)
     363        DEFINE_OP(op_has_private_brand)
    364364        DEFINE_OP(op_get_by_id)
    365365        DEFINE_OP(op_get_by_id_with_this)
     
    573573        DEFINE_SLOWCASE_OP(op_in_by_id)
    574574        DEFINE_SLOWCASE_OP(op_in_by_val)
     575        DEFINE_SLOWCASE_OP(op_has_private_name)
     576        DEFINE_SLOWCASE_OP(op_has_private_brand)
    575577        DEFINE_SLOWCASE_OP(op_get_by_id)
    576578        DEFINE_SLOWCASE_OP(op_get_by_id_with_this)
Note: See TracChangeset for help on using the changeset viewer.