Changeset 278445 in webkit


Ignore:
Timestamp:
Jun 3, 2021 8:10:54 PM (14 months ago)
Author:
Ross Kirsling
Message:

[JSC] Implement JIT ICs for InByVal
https://bugs.webkit.org/show_bug.cgi?id=226563

Reviewed by Saam Barati.

JSTests:

  • microbenchmarks/in-by-val-int32.js: Added.
  • microbenchmarks/in-by-val-string-index.js: Added.
  • microbenchmarks/in-by-val-symbol.js: Added.

Source/JavaScriptCore:

Until now, InByVal has had few optimizations implemented:
DFG would attempt to convert string index lookups to InById and int32 lookups to HasIndexedProperty,
but there has been no inline caching nor any special handling for symbol lookups.

This has become a more urgent problem now, as #x in obj (i.e. HasPrivateName / HasPrivateBrand)
will need to mimic InByVal's inline caching strategy in order to be deemed performant enough to ship.

This patch thus implements inline caching for InByVal at all JIT tiers.
The result is a night-and-day difference for symbols, a nice boost for string indices, and no change for int32s:

in-by-val-symbol 203.5572+-2.7647 19.1035+-0.7498 definitely 10.6555x faster
in-by-val-string-index 87.0368+-44.7766 45.9971+-32.0007 might be 1.8922x faster
in-by-val-int32 110.9904+-1.7109 ? 111.3431+-1.7558 ?

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • bytecode/CheckPrivateBrandStatus.cpp:

(JSC::CheckPrivateBrandStatus::singleIdentifier const):

  • bytecode/DeleteByStatus.cpp:

(JSC::DeleteByStatus::singleIdentifier const):

  • bytecode/GetByStatus.cpp:

(JSC::GetByStatus::singleIdentifier const):

  • bytecode/ICStatusMap.h:
  • bytecode/ICStatusUtils.h:

(JSC::singleIdentifierForICStatus):

  • bytecode/InByIdVariant.cpp:

(JSC::InByIdVariant::InByIdVariant):
(JSC::InByIdVariant::attemptToMerge):
(JSC::InByIdVariant::dumpInContext const):

  • bytecode/InByIdVariant.h:

(JSC::InByIdVariant::identifier const):
(JSC::InByIdVariant::overlaps):

  • bytecode/InByStatus.cpp: Renamed from Source/JavaScriptCore/bytecode/InByIdStatus.cpp.

(JSC::InByStatus::appendVariant):
(JSC::InByStatus::shrinkToFit):
(JSC::InByStatus::computeFor):
(JSC::InByStatus::computeForStubInfo):
(JSC::InByStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::InByStatus::merge):
(JSC::InByStatus::filter):
(JSC::InByStatus::markIfCheap):
(JSC::InByStatus::finalize):
(JSC::InByStatus::singleIdentifier const):
(JSC::InByStatus::dump const):

  • bytecode/InByStatus.h: Renamed from Source/JavaScriptCore/bytecode/InByIdStatus.h.
  • bytecode/RecordedStatuses.cpp:

(JSC::RecordedStatuses::addInByStatus): Renamed from addInByIdStatus.

  • bytecode/RecordedStatuses.h:
  • bytecode/SetPrivateBrandStatus.cpp:

(JSC::SetPrivateBrandStatus::singleIdentifier const):

  • bytecode/StructureStubInfo.cpp:

(JSC::StructureStubInfo::reset):

  • bytecode/StructureStubInfo.h:
  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::filterICStatus):

  • dfg/DFGArgumentsEliminationPhase.cpp:
  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGClobbersExitState.cpp:

(JSC::DFG::clobbersExitState):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::addInByVal):

  • dfg/DFGMayExit.cpp:
  • dfg/DFGNode.h:

(JSC::DFG::Node::hasInByStatus): Renamed from hasInByIdStatus.
(JSC::DFG::Node::inByStatus): Renamed from inByIdStatus.

  • dfg/DFGNodeType.h:
  • dfg/DFGObjectAllocationSinkingPhase.cpp:
  • dfg/DFGPredictionPropagationPhase.cpp:
  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileInByVal):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGVarargsForwardingPhase.cpp:
  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileInBy):
(JSC::FTL::DFG::LowerDFGToB3::compileInById):
(JSC::FTL::DFG::LowerDFGToB3::compileInByVal):

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

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

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

(JSC::JITInByValGenerator::JITInByValGenerator):
(JSC::JITInByValGenerator::generateFastPath):
(JSC::JITInByValGenerator::finalize):
(JSC::JITInByIdGenerator::JITInByIdGenerator):

  • jit/JITInlineCacheGenerator.h:

(JSC::JITDelByIdGenerator::slowPathJump const):
(JSC::JITInByValGenerator::JITInByValGenerator):
(JSC::JITInByValGenerator::slowPathJump const):

  • jit/JITOperations.cpp:

(JSC::JSC_DEFINE_JIT_OPERATION):

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

(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emitSlow_op_in_by_val):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emitSlow_op_in_by_val):

  • jit/Repatch.cpp:

(JSC::tryCacheInBy): Renamed from tryCacheInByID.
(JSC::repatchInBy): Renamed from repatchInByID.
(JSC::resetInBy): Renamed from resetInByID.

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

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LLIntSlowPaths.h:
  • llint/LowLevelInterpreter.asm:
  • runtime/CommonSlowPaths.cpp:
  • runtime/CommonSlowPaths.h:
Location:
trunk
Files:
3 added
54 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r278438 r278445  
     12021-06-03  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] Implement JIT ICs for InByVal
     4        https://bugs.webkit.org/show_bug.cgi?id=226563
     5
     6        Reviewed by Saam Barati.
     7
     8        * microbenchmarks/in-by-val-int32.js: Added.
     9        * microbenchmarks/in-by-val-string-index.js: Added.
     10        * microbenchmarks/in-by-val-symbol.js: Added.
     11
    1122021-06-03  Mark Lam  <mark.lam@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r278438 r278445  
     12021-06-03  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] Implement JIT ICs for InByVal
     4        https://bugs.webkit.org/show_bug.cgi?id=226563
     5
     6        Reviewed by Saam Barati.
     7
     8        Until now, InByVal has had few optimizations implemented:
     9        DFG would attempt to convert string index lookups to InById and int32 lookups to HasIndexedProperty,
     10        but there has been no inline caching nor any special handling for symbol lookups.
     11
     12        This has become a more urgent problem now, as `#x in obj` (i.e. HasPrivateName / HasPrivateBrand)
     13        will need to mimic InByVal's inline caching strategy in order to be deemed performant enough to ship.
     14
     15        This patch thus implements inline caching for InByVal at all JIT tiers.
     16        The result is a night-and-day difference for symbols, a nice boost for string indices, and no change for int32s:
     17
     18        in-by-val-symbol                  203.5572+-2.7647     ^     19.1035+-0.7498        ^ definitely 10.6555x faster
     19        in-by-val-string-index             87.0368+-44.7766          45.9971+-32.0007         might be 1.8922x faster
     20        in-by-val-int32                   110.9904+-1.7109     ?    111.3431+-1.7558        ?
     21
     22        * JavaScriptCore.xcodeproj/project.pbxproj:
     23        * Sources.txt:
     24        * bytecode/CheckPrivateBrandStatus.cpp:
     25        (JSC::CheckPrivateBrandStatus::singleIdentifier const):
     26        * bytecode/DeleteByStatus.cpp:
     27        (JSC::DeleteByStatus::singleIdentifier const):
     28        * bytecode/GetByStatus.cpp:
     29        (JSC::GetByStatus::singleIdentifier const):
     30        * bytecode/ICStatusMap.h:
     31        * bytecode/ICStatusUtils.h:
     32        (JSC::singleIdentifierForICStatus):
     33        * bytecode/InByIdVariant.cpp:
     34        (JSC::InByIdVariant::InByIdVariant):
     35        (JSC::InByIdVariant::attemptToMerge):
     36        (JSC::InByIdVariant::dumpInContext const):
     37        * bytecode/InByIdVariant.h:
     38        (JSC::InByIdVariant::identifier const):
     39        (JSC::InByIdVariant::overlaps):
     40        * bytecode/InByStatus.cpp: Renamed from Source/JavaScriptCore/bytecode/InByIdStatus.cpp.
     41        (JSC::InByStatus::appendVariant):
     42        (JSC::InByStatus::shrinkToFit):
     43        (JSC::InByStatus::computeFor):
     44        (JSC::InByStatus::computeForStubInfo):
     45        (JSC::InByStatus::computeForStubInfoWithoutExitSiteFeedback):
     46        (JSC::InByStatus::merge):
     47        (JSC::InByStatus::filter):
     48        (JSC::InByStatus::markIfCheap):
     49        (JSC::InByStatus::finalize):
     50        (JSC::InByStatus::singleIdentifier const):
     51        (JSC::InByStatus::dump const):
     52        * bytecode/InByStatus.h: Renamed from Source/JavaScriptCore/bytecode/InByIdStatus.h.
     53        * bytecode/RecordedStatuses.cpp:
     54        (JSC::RecordedStatuses::addInByStatus): Renamed from addInByIdStatus.
     55        * bytecode/RecordedStatuses.h:
     56        * bytecode/SetPrivateBrandStatus.cpp:
     57        (JSC::SetPrivateBrandStatus::singleIdentifier const):
     58        * bytecode/StructureStubInfo.cpp:
     59        (JSC::StructureStubInfo::reset):
     60        * bytecode/StructureStubInfo.h:
     61        * dfg/DFGAbstractInterpreterInlines.h:
     62        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     63        (JSC::DFG::AbstractInterpreter<AbstractStateType>::filterICStatus):
     64        * dfg/DFGArgumentsEliminationPhase.cpp:
     65        * dfg/DFGByteCodeParser.cpp:
     66        (JSC::DFG::ByteCodeParser::handleInById):
     67        (JSC::DFG::ByteCodeParser::parseBlock):
     68        * dfg/DFGClobberize.h:
     69        (JSC::DFG::clobberize):
     70        * dfg/DFGClobbersExitState.cpp:
     71        (JSC::DFG::clobbersExitState):
     72        * dfg/DFGDoesGC.cpp:
     73        (JSC::DFG::doesGC):
     74        * dfg/DFGFixupPhase.cpp:
     75        (JSC::DFG::FixupPhase::fixupNode):
     76        * dfg/DFGGraph.cpp:
     77        (JSC::DFG::Graph::dump):
     78        * dfg/DFGJITCompiler.cpp:
     79        (JSC::DFG::JITCompiler::link):
     80        * dfg/DFGJITCompiler.h:
     81        (JSC::DFG::JITCompiler::addInByVal):
     82        * dfg/DFGMayExit.cpp:
     83        * dfg/DFGNode.h:
     84        (JSC::DFG::Node::hasInByStatus): Renamed from hasInByIdStatus.
     85        (JSC::DFG::Node::inByStatus): Renamed from inByIdStatus.
     86        * dfg/DFGNodeType.h:
     87        * dfg/DFGObjectAllocationSinkingPhase.cpp:
     88        * dfg/DFGPredictionPropagationPhase.cpp:
     89        * dfg/DFGSafeToExecute.h:
     90        (JSC::DFG::safeToExecute):
     91        * dfg/DFGSpeculativeJIT.cpp:
     92        (JSC::DFG::SpeculativeJIT::compileInByVal):
     93        * dfg/DFGSpeculativeJIT32_64.cpp:
     94        (JSC::DFG::SpeculativeJIT::compile):
     95        * dfg/DFGSpeculativeJIT64.cpp:
     96        (JSC::DFG::SpeculativeJIT::compile):
     97        * dfg/DFGVarargsForwardingPhase.cpp:
     98        * ftl/FTLCapabilities.cpp:
     99        (JSC::FTL::canCompile):
     100        * ftl/FTLLowerDFGToB3.cpp:
     101        (JSC::FTL::DFG::LowerDFGToB3::compileNode):
     102        (JSC::FTL::DFG::LowerDFGToB3::compileInBy):
     103        (JSC::FTL::DFG::LowerDFGToB3::compileInById):
     104        (JSC::FTL::DFG::LowerDFGToB3::compileInByVal):
     105        * jit/ICStats.h:
     106        * jit/JIT.cpp:
     107        (JSC::JIT::privateCompileMainPass):
     108        (JSC::JIT::privateCompileSlowCases):
     109        (JSC::JIT::link):
     110        * jit/JIT.h:
     111        * jit/JITInlineCacheGenerator.cpp:
     112        (JSC::JITInByValGenerator::JITInByValGenerator):
     113        (JSC::JITInByValGenerator::generateFastPath):
     114        (JSC::JITInByValGenerator::finalize):
     115        (JSC::JITInByIdGenerator::JITInByIdGenerator):
     116        * jit/JITInlineCacheGenerator.h:
     117        (JSC::JITDelByIdGenerator::slowPathJump const):
     118        (JSC::JITInByValGenerator::JITInByValGenerator):
     119        (JSC::JITInByValGenerator::slowPathJump const):
     120        * jit/JITOperations.cpp:
     121        (JSC::JSC_DEFINE_JIT_OPERATION):
     122        * jit/JITOperations.h:
     123        * jit/JITPropertyAccess.cpp:
     124        (JSC::JIT::emit_op_in_by_val):
     125        (JSC::JIT::emitSlow_op_in_by_val):
     126        * jit/JITPropertyAccess32_64.cpp:
     127        (JSC::JIT::emit_op_in_by_val):
     128        (JSC::JIT::emitSlow_op_in_by_val):
     129        * jit/Repatch.cpp:
     130        (JSC::tryCacheInBy): Renamed from tryCacheInByID.
     131        (JSC::repatchInBy): Renamed from repatchInByID.
     132        (JSC::resetInBy): Renamed from resetInByID.
     133        * jit/Repatch.h:
     134        * llint/LLIntSlowPaths.cpp:
     135        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     136        * llint/LLIntSlowPaths.h:
     137        * llint/LowLevelInterpreter.asm:
     138        * runtime/CommonSlowPaths.cpp:
     139        * runtime/CommonSlowPaths.h:
     140
    11412021-06-03  Mark Lam  <mark.lam@apple.com>
    2142
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r278381 r278445  
    14021402                A1D793011B43864B004516F5 /* IntlNumberFormatPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */; };
    14031403                A321AA6D2626359B0023ADA2 /* IntlWorkaround.h in Headers */ = {isa = PBXBuildFile; fileRef = A321AA6C2626359B0023ADA2 /* IntlWorkaround.h */; };
     1404                A382C5312667111D0042CD99 /* InByIdVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = E3305FB120B0F78800CEB82B /* InByIdVariant.h */; settings = {ATTRIBUTES = (Private, ); }; };
    14041405                A38D250E25800D440042BFDD /* JSArrayBufferPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A38D250D25800D430042BFDD /* JSArrayBufferPrototypeInlines.h */; };
     1406                A38D5BFC2666D3DA00A109A6 /* InByStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = A38D5BFA2666D3DA00A109A6 /* InByStatus.h */; settings = {ATTRIBUTES = (Private, ); }; };
    14051407                A3EE8543262514B000FC9B8D /* IntlWorkaround.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A37619402625127C00CBCBA9 /* IntlWorkaround.cpp */; };
    14061408                A3FF9BC72234749100B1A9AB /* YarrFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = A3FF9BC52234746600B1A9AB /* YarrFlags.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    44314433                A37619402625127C00CBCBA9 /* IntlWorkaround.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlWorkaround.cpp; sourceTree = "<group>"; };
    44324434                A38D250D25800D430042BFDD /* JSArrayBufferPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferPrototypeInlines.h; sourceTree = "<group>"; };
     4435                A38D5BF92666D3DA00A109A6 /* InByStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InByStatus.cpp; sourceTree = "<group>"; };
     4436                A38D5BFA2666D3DA00A109A6 /* InByStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InByStatus.h; sourceTree = "<group>"; };
    44334437                A3AFF92B245A3CF900C9BA3B /* IntlLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlLocale.h; sourceTree = "<group>"; };
    44344438                A3AFF92C245A3CFA00C9BA3B /* IntlLocaleConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlLocaleConstructor.h; sourceTree = "<group>"; };
     
    50595063                E3282BBA1FE930A400EDAF71 /* YarrErrorCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrErrorCode.h; path = yarr/YarrErrorCode.h; sourceTree = "<group>"; };
    50605064                E32C3C6823E94C1E00BC97C0 /* UnlinkedCodeBlockGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedCodeBlockGenerator.h; sourceTree = "<group>"; };
    5061                 E3305FAF20B0F78700CEB82B /* InByIdStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InByIdStatus.h; sourceTree = "<group>"; };
    50625065                E3305FB020B0F78700CEB82B /* InByIdVariant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InByIdVariant.cpp; sourceTree = "<group>"; };
    50635066                E3305FB120B0F78800CEB82B /* InByIdVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InByIdVariant.h; sourceTree = "<group>"; };
    5064                 E3305FB220B0F78800CEB82B /* InByIdStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InByIdStatus.cpp; sourceTree = "<group>"; };
    50655067                E33095DC23210A1400EB7856 /* JSInternalFieldObjectImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSInternalFieldObjectImpl.h; sourceTree = "<group>"; };
    50665068                E334CBB221FD96A8000EB178 /* RegExpGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpGlobalData.cpp; sourceTree = "<group>"; };
     
    62836285                                72131BF326587EF2007114CF /* JITSafepoint.cpp */,
    62846286                                72131BF526587EF2007114CF /* JITSafepoint.h */,
     6287                                72131BF426587EF2007114CF /* JITScannable.h */,
    62856288                                52B5100C265EFCD4008970E7 /* JITSizeStatistics.cpp */,
    62866289                                52B5100B265EFCD4008970E7 /* JITSizeStatistics.h */,
    6287                                 72131BF426587EF2007114CF /* JITScannable.h */,
    62886290                                0F766D2615A8CC1B008F363E /* JITStubRoutine.cpp */,
    62896291                                0F766D1C15A5028D008F363E /* JITStubRoutine.h */,
     
    85788580                                0F44A7B520C0BE3F0022B171 /* ICStatusUtils.cpp */,
    85798581                                0FB399BD20AF6B380017E213 /* ICStatusUtils.h */,
    8580                                 E3305FB220B0F78800CEB82B /* InByIdStatus.cpp */,
    8581                                 E3305FAF20B0F78700CEB82B /* InByIdStatus.h */,
    85828582                                E3305FB020B0F78700CEB82B /* InByIdVariant.cpp */,
    85838583                                E3305FB120B0F78800CEB82B /* InByIdVariant.h */,
     8584                                A38D5BF92666D3DA00A109A6 /* InByStatus.cpp */,
     8585                                A38D5BFA2666D3DA00A109A6 /* InByStatus.h */,
    85848586                                7905BB661D12050E0019FE57 /* InlineAccess.cpp */,
    85858587                                7905BB671D12050E0019FE57 /* InlineAccess.h */,
     
    96189620                                0F300B7C18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h in Headers */,
    96199621                                0F898F321B27689F0083A33C /* DFGIntegerRangeOptimizationPhase.h in Headers */,
    9620                                 52B5100D265EFCDB008970E7 /* JITSizeStatistics.h in Headers */,
    96219622                                0FC97F3E18202119002C9B26 /* DFGInvalidationPointInjectionPhase.h in Headers */,
    96229623                                0FEA0A34170D40BF00BB722C /* DFGJITCode.h in Headers */,
     
    99219922                                8606DDEA18DA44AB00A383D0 /* IdentifierInlines.h in Headers */,
    99229923                                A5FD0076189B038C00633231 /* IdentifiersFactory.h in Headers */,
     9924                                A382C5312667111D0042CD99 /* InByIdVariant.h in Headers */,
     9925                                A38D5BFC2666D3DA00A109A6 /* InByStatus.h in Headers */,
    99239926                                C25F8BCE157544A900245B71 /* IncrementalSweeper.h in Headers */,
    99249927                                0FB7F39915ED8E4600F167B2 /* IndexingHeader.h in Headers */,
     
    1007210075                                72131BF926587EF2007114CF /* JITSafepoint.h in Headers */,
    1007310076                                72131BF826587EF2007114CF /* JITScannable.h in Headers */,
     10077                                52B5100D265EFCDB008970E7 /* JITSizeStatistics.h in Headers */,
    1007410078                                0F766D3115AA8112008F363E /* JITStubRoutine.h in Headers */,
    1007510079                                0F766D2C15A8CC3A008F363E /* JITStubRoutineSet.h in Headers */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r278381 r278445  
    240240bytecode/ICStatusMap.cpp
    241241bytecode/ICStatusUtils.cpp
    242 bytecode/InByIdStatus.cpp
     242bytecode/InByStatus.cpp
    243243bytecode/InByIdVariant.cpp
    244244bytecode/InlineAccess.cpp
  • trunk/Source/JavaScriptCore/bytecode/CheckPrivateBrandStatus.cpp

    r275490 r278445  
    220220CacheableIdentifier CheckPrivateBrandStatus::singleIdentifier() const
    221221{
    222     if (m_variants.isEmpty())
    223         return nullptr;
    224 
    225     CacheableIdentifier result = m_variants.first().identifier();
    226     if (!result)
    227         return nullptr;
    228     for (size_t i = 1; i < m_variants.size(); ++i) {
    229         CacheableIdentifier identifier = m_variants[i].identifier();
    230         if (!identifier)
    231             return nullptr;
    232         if (identifier != result)
    233             return nullptr;
    234     }
    235     return result;
     222    return singleIdentifierForICStatus(m_variants);
    236223}
    237224
  • trunk/Source/JavaScriptCore/bytecode/DeleteByStatus.cpp

    r275490 r278445  
    246246CacheableIdentifier DeleteByStatus::singleIdentifier() const
    247247{
    248     if (m_variants.isEmpty())
    249         return nullptr;
    250 
    251     CacheableIdentifier result = m_variants.first().identifier();
    252     if (!result)
    253         return nullptr;
    254     for (size_t i = 1; i < m_variants.size(); ++i) {
    255         CacheableIdentifier identifier = m_variants[i].identifier();
    256         if (!identifier)
    257             return nullptr;
    258         if (identifier != result)
    259             return nullptr;
    260     }
    261     return result;
     248    return singleIdentifierForICStatus(m_variants);
    262249}
    263250
  • trunk/Source/JavaScriptCore/bytecode/GetByStatus.cpp

    r275490 r278445  
    580580        return m_moduleNamespaceData->m_identifier;
    581581
    582     if (m_variants.isEmpty())
    583         return nullptr;
    584 
    585     CacheableIdentifier result = m_variants.first().identifier();
    586     if (!result)
    587         return nullptr;
    588     for (size_t i = 1; i < m_variants.size(); ++i) {
    589         CacheableIdentifier identifier = m_variants[i].identifier();
    590         if (!identifier)
    591             return nullptr;
    592         if (identifier != result)
    593             return nullptr;
    594     }
    595     return result;
     582    return singleIdentifierForICStatus(m_variants);
    596583}
    597584
  • trunk/Source/JavaScriptCore/bytecode/ICStatusMap.h

    r259583 r278445  
    3636class CodeBlock;
    3737class GetByStatus;
    38 class InByIdStatus;
     38class InByStatus;
    3939class PutByIdStatus;
    4040class DeleteByStatus;
     
    4848    CallLinkStatus* callStatus { nullptr };
    4949    GetByStatus* getStatus { nullptr };
    50     InByIdStatus* inStatus { nullptr };
     50    InByStatus* inStatus { nullptr };
    5151    PutByIdStatus* putStatus { nullptr };
    5252    DeleteByStatus* deleteStatus { nullptr };
  • trunk/Source/JavaScriptCore/bytecode/ICStatusUtils.h

    r252763 r278445  
    2727
    2828#include "BytecodeIndex.h"
     29#include "CacheableIdentifier.h"
    2930#include "ExitFlag.h"
    3031
     
    7374}
    7475
     76template<typename VariantVectorType>
     77CacheableIdentifier singleIdentifierForICStatus(VariantVectorType& variants)
     78{
     79    if (variants.isEmpty())
     80        return nullptr;
     81
     82    CacheableIdentifier result = variants.first().identifier();
     83    if (!result)
     84        return nullptr;
     85
     86    for (size_t i = 1; i < variants.size(); ++i) {
     87        CacheableIdentifier identifier = variants[i].identifier();
     88        if (!identifier || identifier != result)
     89            return nullptr;
     90    }
     91
     92    return result;
     93}
     94
    7595ExitFlag hasBadCacheExitSite(CodeBlock* profiledBlock, BytecodeIndex);
    7696
  • trunk/Source/JavaScriptCore/bytecode/InByIdVariant.cpp

    r273138 r278445  
    2828#include "InByIdVariant.h"
    2929
     30#include "CacheableIdentifierInlines.h"
     31
    3032namespace JSC {
    3133
    32 InByIdVariant::InByIdVariant(const StructureSet& structureSet, PropertyOffset offset, const ObjectPropertyConditionSet& conditionSet)
     34InByIdVariant::InByIdVariant(CacheableIdentifier identifier, const StructureSet& structureSet, PropertyOffset offset, const ObjectPropertyConditionSet& conditionSet)
    3335    : m_structureSet(structureSet)
    3436    , m_conditionSet(conditionSet)
    3537    , m_offset(offset)
     38    , m_identifier(WTFMove(identifier))
    3639{
    3740    if (!structureSet.size()) {
     
    4346bool InByIdVariant::attemptToMerge(const InByIdVariant& other)
    4447{
     48    if (!!m_identifier != !!other.m_identifier)
     49        return false;
     50
     51    if (m_identifier && (m_identifier != other.m_identifier))
     52        return false;
     53
    4554    if (m_offset != other.m_offset)
    4655        return false;
     
    9099void InByIdVariant::dumpInContext(PrintStream& out, DumpContext* context) const
    91100{
     101    out.print("<id='", m_identifier, "', ");
    92102    if (!isSet()) {
    93         out.print("<empty>");
     103        out.print("empty>");
    94104        return;
    95105    }
    96106
    97     out.print(
    98         "<", inContext(structureSet(), context), ", ", inContext(m_conditionSet, context));
     107    out.print(inContext(structureSet(), context), ", ", inContext(m_conditionSet, context));
    99108    out.print(", offset = ", offset());
    100109    out.print(">");
  • trunk/Source/JavaScriptCore/bytecode/InByIdVariant.h

    r273138 r278445  
    2727#pragma once
    2828
     29#include "CacheableIdentifier.h"
    2930#include "ObjectPropertyConditionSet.h"
    3031#include "PropertyOffset.h"
     
    3637}
    3738
    38 class InByIdStatus;
     39class InByStatus;
    3940struct DumpContext;
    4041
     
    4243    WTF_MAKE_FAST_ALLOCATED;
    4344public:
    44     InByIdVariant(const StructureSet& = StructureSet(), PropertyOffset = invalidOffset, const ObjectPropertyConditionSet& = ObjectPropertyConditionSet());
     45    InByIdVariant(CacheableIdentifier, const StructureSet& = StructureSet(), PropertyOffset = invalidOffset, const ObjectPropertyConditionSet& = ObjectPropertyConditionSet());
    4546
    4647    bool isSet() const { return !!m_structureSet.size(); }
     
    6465    void dumpInContext(PrintStream&, DumpContext*) const;
    6566
     67    CacheableIdentifier identifier() const { return m_identifier; }
     68
    6669    bool overlaps(const InByIdVariant& other)
    6770    {
     71        if (!!m_identifier != !!other.m_identifier)
     72            return true;
     73        if (m_identifier) {
     74            if (m_identifier != other.m_identifier)
     75                return false;
     76        }
    6877        return structureSet().overlaps(other.structureSet());
    6978    }
    7079
    7180private:
    72     friend class InByIdStatus;
     81    friend class InByStatus;
    7382
    7483    StructureSet m_structureSet;
    7584    ObjectPropertyConditionSet m_conditionSet;
    7685    PropertyOffset m_offset;
     86    CacheableIdentifier m_identifier;
    7787};
    7888
  • trunk/Source/JavaScriptCore/bytecode/InByStatus.cpp

    r278444 r278445  
    2626
    2727#include "config.h"
    28 #include "InByIdStatus.h"
    29 
     28#include "InByStatus.h"
     29
     30#include "CacheableIdentifierInlines.h"
    3031#include "CodeBlock.h"
    3132#include "ComplexGetStatus.h"
     
    3738namespace JSC {
    3839
    39 bool InByIdStatus::appendVariant(const InByIdVariant& variant)
     40bool InByStatus::appendVariant(const InByIdVariant& variant)
    4041{
    4142    return appendICStatusVariant(m_variants, variant);
    4243}
    4344
    44 void InByIdStatus::shrinkToFit()
     45void InByStatus::shrinkToFit()
    4546{
    4647    m_variants.shrinkToFit();
     
    4849
    4950#if ENABLE(JIT)
    50 InByIdStatus InByIdStatus::computeFor(CodeBlock* profiledBlock, ICStatusMap& map, BytecodeIndex bytecodeIndex, UniquedStringImpl* uid, ExitFlag didExit)
     51InByStatus InByStatus::computeFor(CodeBlock* profiledBlock, ICStatusMap& map, BytecodeIndex bytecodeIndex, ExitFlag didExit)
    5152{
    5253    ConcurrentJSLocker locker(profiledBlock->m_lock);
    5354
    54     InByIdStatus result;
     55    InByStatus result;
    5556
    5657#if ENABLE(DFG_JIT)
    57     result = computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), map.get(CodeOrigin(bytecodeIndex)).stubInfo, uid);
     58    result = computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), map.get(CodeOrigin(bytecodeIndex)).stubInfo);
    5859
    5960    if (!result.takesSlowPath() && didExit)
    60         return InByIdStatus(TakesSlowPath);
     61        return InByStatus(TakesSlowPath);
    6162#else
    6263    UNUSED_PARAM(map);
    6364    UNUSED_PARAM(bytecodeIndex);
    64     UNUSED_PARAM(uid);
    6565    UNUSED_PARAM(didExit);
    6666#endif
     
    6969}
    7070
    71 InByIdStatus InByIdStatus::computeFor(CodeBlock* profiledBlock, ICStatusMap& map, BytecodeIndex bytecodeIndex, UniquedStringImpl* uid)
    72 {
    73     return computeFor(profiledBlock, map, bytecodeIndex, uid, hasBadCacheExitSite(profiledBlock, bytecodeIndex));
    74 }
    75 
    76 InByIdStatus InByIdStatus::computeFor(
     71InByStatus InByStatus::computeFor(CodeBlock* profiledBlock, ICStatusMap& map, BytecodeIndex bytecodeIndex)
     72{
     73    return computeFor(profiledBlock, map, bytecodeIndex, hasBadCacheExitSite(profiledBlock, bytecodeIndex));
     74}
     75
     76InByStatus InByStatus::computeFor(
    7777    CodeBlock* profiledBlock, ICStatusMap& baselineMap,
    78     ICStatusContextStack& contextStack, CodeOrigin codeOrigin, UniquedStringImpl* uid)
     78    ICStatusContextStack& contextStack, CodeOrigin codeOrigin)
    7979{
    8080    BytecodeIndex bytecodeIndex = codeOrigin.bytecodeIndex();
     
    8484        ICStatus status = context->get(codeOrigin);
    8585       
    86         auto bless = [&] (const InByIdStatus& result) -> InByIdStatus {
     86        auto bless = [&] (const InByStatus& result) -> InByStatus {
    8787            if (!context->isInlined(codeOrigin)) {
    88                 InByIdStatus baselineResult = computeFor(
    89                     profiledBlock, baselineMap, bytecodeIndex, uid, didExit);
     88                InByStatus baselineResult = computeFor(
     89                    profiledBlock, baselineMap, bytecodeIndex, didExit);
    9090                baselineResult.merge(result);
    9191                return baselineResult;
    9292            }
    9393            if (didExit.isSet(ExitFromInlined))
    94                 return InByIdStatus(TakesSlowPath);
     94                return InByStatus(TakesSlowPath);
    9595            return result;
    9696        };
     
    9898#if ENABLE(DFG_JIT)
    9999        if (status.stubInfo) {
    100             InByIdStatus result;
     100            InByStatus result;
    101101            {
    102102                ConcurrentJSLocker locker(context->optimizedCodeBlock->m_lock);
    103                 result = computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), status.stubInfo, uid);
     103                result = computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), status.stubInfo);
    104104            }
    105105            if (result.isSet())
     
    112112    }
    113113   
    114     return computeFor(profiledBlock, baselineMap, bytecodeIndex, uid, didExit);
     114    return computeFor(profiledBlock, baselineMap, bytecodeIndex, didExit);
    115115}
    116116#endif // ENABLE(JIT)
    117117
    118118#if ENABLE(DFG_JIT)
    119 InByIdStatus InByIdStatus::computeForStubInfo(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin, UniquedStringImpl* uid)
    120 {
    121     InByIdStatus result = InByIdStatus::computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), stubInfo, uid);
     119InByStatus InByStatus::computeForStubInfo(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin)
     120{
     121    InByStatus result = InByStatus::computeForStubInfoWithoutExitSiteFeedback(locker, profiledBlock->vm(), stubInfo);
    122122
    123123    if (!result.takesSlowPath() && hasBadCacheExitSite(profiledBlock, codeOrigin.bytecodeIndex()))
    124         return InByIdStatus(TakesSlowPath);
     124        return InByStatus(TakesSlowPath);
    125125    return result;
    126126}
    127127
    128 InByIdStatus InByIdStatus::computeForStubInfoWithoutExitSiteFeedback(const ConcurrentJSLocker&, VM& vm, StructureStubInfo* stubInfo, UniquedStringImpl* uid)
     128InByStatus InByStatus::computeForStubInfoWithoutExitSiteFeedback(const ConcurrentJSLocker&, VM& vm, StructureStubInfo* stubInfo)
    129129{
    130130    StubInfoSummary summary = StructureStubInfo::summary(vm, stubInfo);
    131131    if (!isInlineable(summary))
    132         return InByIdStatus(summary);
     132        return InByStatus(summary);
    133133   
    134134    // Finally figure out if we can derive an access strategy.
    135     InByIdStatus result;
     135    InByStatus result;
    136136    result.m_state = Simple;
    137137    switch (stubInfo->cacheType()) {
    138138    case CacheType::Unset:
    139         return InByIdStatus(NoInformation);
     139        return InByStatus(NoInformation);
    140140
    141141    case CacheType::InByIdSelf: {
    142142        Structure* structure = stubInfo->u.byIdSelf.baseObjectStructure.get();
    143143        if (structure->takesSlowPathInDFGForImpureProperty())
    144             return InByIdStatus(TakesSlowPath);
     144            return InByStatus(TakesSlowPath);
     145        CacheableIdentifier identifier = stubInfo->identifier();
     146        UniquedStringImpl* uid = identifier.uid();
     147        RELEASE_ASSERT(uid);
     148        InByIdVariant variant(WTFMove(identifier));
    145149        unsigned attributes;
    146         InByIdVariant variant;
    147150        variant.m_offset = structure->getConcurrently(uid, attributes);
    148151        if (!isValidOffset(variant.m_offset))
    149             return InByIdStatus(TakesSlowPath);
     152            return InByStatus(TakesSlowPath);
    150153        if (attributes & PropertyAttribute::CustomAccessorOrValue)
    151             return InByIdStatus(TakesSlowPath);
     154            return InByStatus(TakesSlowPath);
    152155
    153156        variant.m_structureSet.add(structure);
     
    162165            const AccessCase& access = list->at(listIndex);
    163166            if (access.viaProxy())
    164                 return InByIdStatus(TakesSlowPath);
     167                return InByStatus(TakesSlowPath);
    165168
    166169            if (access.usesPolyProto())
    167                 return InByIdStatus(TakesSlowPath);
     170                return InByStatus(TakesSlowPath);
    168171
    169172            Structure* structure = access.structure();
     
    175178                // told us. But, it works well enough. So, our only concern here is to not
    176179                // crash on null structure.
    177                 return InByIdStatus(TakesSlowPath);
    178             }
    179 
    180             ComplexGetStatus complexGetStatus = ComplexGetStatus::computeFor(structure, access.conditionSet(), uid);
     180                return InByStatus(TakesSlowPath);
     181            }
     182
     183            ComplexGetStatus complexGetStatus = ComplexGetStatus::computeFor(structure, access.conditionSet(), access.uid());
    181184            switch (complexGetStatus.kind()) {
    182185            case ComplexGetStatus::ShouldSkip:
     
    184187
    185188            case ComplexGetStatus::TakesSlowPath:
    186                 return InByIdStatus(TakesSlowPath);
     189                return InByStatus(TakesSlowPath);
    187190
    188191            case ComplexGetStatus::Inlineable: {
     
    192195                    break;
    193196                default:
    194                     return InByIdStatus(TakesSlowPath);
     197                    return InByStatus(TakesSlowPath);
    195198                }
    196199
    197200                InByIdVariant variant(
    198                     StructureSet(structure), complexGetStatus.offset(),
     201                    access.identifier(), StructureSet(structure), complexGetStatus.offset(),
    199202                    complexGetStatus.conditionSet());
    200203
    201204                if (!result.appendVariant(variant))
    202                     return InByIdStatus(TakesSlowPath);
     205                    return InByStatus(TakesSlowPath);
    203206                break;
    204207            }
     
    211214
    212215    default:
    213         return InByIdStatus(TakesSlowPath);
     216        return InByStatus(TakesSlowPath);
    214217    }
    215218
    216219    RELEASE_ASSERT_NOT_REACHED();
    217     return InByIdStatus();
     220    return InByStatus();
    218221}
    219222#endif
    220223
    221 void InByIdStatus::merge(const InByIdStatus& other)
     224void InByStatus::merge(const InByStatus& other)
    222225{
    223226    if (other.m_state == NoInformation)
     
    231234    case Simple:
    232235        if (other.m_state != Simple) {
    233             *this = InByIdStatus(TakesSlowPath);
     236            *this = InByStatus(TakesSlowPath);
    234237            return;
    235238        }
    236239        for (const InByIdVariant& otherVariant : other.m_variants) {
    237240            if (!appendVariant(otherVariant)) {
    238                 *this = InByIdStatus(TakesSlowPath);
     241                *this = InByStatus(TakesSlowPath);
    239242                return;
    240243            }
     
    250253}
    251254
    252 void InByIdStatus::filter(const StructureSet& structureSet)
     255void InByStatus::filter(const StructureSet& structureSet)
    253256{
    254257    if (m_state != Simple)
     
    260263
    261264template<typename Visitor>
    262 void InByIdStatus::markIfCheap(Visitor& visitor)
     265void InByStatus::markIfCheap(Visitor& visitor)
    263266{
    264267    for (InByIdVariant& variant : m_variants)
     
    266269}
    267270
    268 template void InByIdStatus::markIfCheap(AbstractSlotVisitor&);
    269 template void InByIdStatus::markIfCheap(SlotVisitor&);
    270 
    271 bool InByIdStatus::finalize(VM& vm)
     271template void InByStatus::markIfCheap(AbstractSlotVisitor&);
     272template void InByStatus::markIfCheap(SlotVisitor&);
     273
     274bool InByStatus::finalize(VM& vm)
    272275{
    273276    for (InByIdVariant& variant : m_variants) {
     
    278281}
    279282
    280 void InByIdStatus::dump(PrintStream& out) const
     283CacheableIdentifier InByStatus::singleIdentifier() const
     284{
     285    return singleIdentifierForICStatus(m_variants);
     286}
     287
     288void InByStatus::dump(PrintStream& out) const
    281289{
    282290    out.print("(");
  • trunk/Source/JavaScriptCore/bytecode/InByStatus.h

    r278444 r278445  
    4040class StructureStubInfo;
    4141
    42 class InByIdStatus final {
     42class InByStatus final {
    4343    WTF_MAKE_FAST_ALLOCATED;
    4444public:
     
    5353    };
    5454
    55     InByIdStatus() = default;
     55    InByStatus() = default;
    5656
    57     InByIdStatus(State state, const InByIdVariant& variant = InByIdVariant())
     57    InByStatus(State state)
    5858        : m_state(state)
    5959    {
    60         ASSERT((state == Simple) == variant.isSet());
    61         if (variant.isSet())
    62             m_variants.append(variant);
     60        ASSERT(state != Simple);
    6361    }
    6462
    65     explicit InByIdStatus(StubInfoSummary summary)
     63    explicit InByStatus(StubInfoSummary summary)
    6664    {
    6765        switch (summary) {
     
    8179    }
    8280   
    83     static InByIdStatus computeFor(CodeBlock*, ICStatusMap&, BytecodeIndex, UniquedStringImpl* uid);
    84     static InByIdStatus computeFor(CodeBlock*, ICStatusMap&, BytecodeIndex, UniquedStringImpl* uid, ExitFlag);
    85     static InByIdStatus computeFor(CodeBlock* baselineBlock, ICStatusMap& baselineMap, ICStatusContextStack& contextStack, CodeOrigin, UniquedStringImpl* uid);
     81    static InByStatus computeFor(CodeBlock*, ICStatusMap&, BytecodeIndex);
     82    static InByStatus computeFor(CodeBlock*, ICStatusMap&, BytecodeIndex, ExitFlag);
     83    static InByStatus computeFor(CodeBlock* baselineBlock, ICStatusMap& baselineMap, ICStatusContextStack&, CodeOrigin);
    8684
    8785#if ENABLE(DFG_JIT)
    88     static InByIdStatus computeForStubInfo(const ConcurrentJSLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin, UniquedStringImpl* uid);
     86    static InByStatus computeForStubInfo(const ConcurrentJSLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin);
    8987#endif
    9088
     
    102100    bool takesSlowPath() const { return m_state == TakesSlowPath; }
    103101   
    104     void merge(const InByIdStatus&);
     102    void merge(const InByStatus&);
    105103
    106104    // Attempts to reduce the set of variants to fit the given structure set. This may be approximate.
     
    112110    void dump(PrintStream&) const;
    113111
     112    CacheableIdentifier singleIdentifier() const;
     113
    114114private:
    115115#if ENABLE(DFG_JIT)
    116     static InByIdStatus computeForStubInfoWithoutExitSiteFeedback(const ConcurrentJSLocker&, VM&, StructureStubInfo*, UniquedStringImpl* uid);
     116    static InByStatus computeForStubInfoWithoutExitSiteFeedback(const ConcurrentJSLocker&, VM&, StructureStubInfo*);
    117117#endif
    118118    bool appendVariant(const InByIdVariant&);
  • trunk/Source/JavaScriptCore/bytecode/RecordedStatuses.cpp

    r273138 r278445  
    7171}
    7272
    73 InByIdStatus* RecordedStatuses::addInByIdStatus(const CodeOrigin& codeOrigin, const InByIdStatus& status)
     73InByStatus* RecordedStatuses::addInByStatus(const CodeOrigin& codeOrigin, const InByStatus& status)
    7474{
    75     auto statusPtr = makeUnique<InByIdStatus>(status);
    76     InByIdStatus* result = statusPtr.get();
     75    auto statusPtr = makeUnique<InByStatus>(status);
     76    InByStatus* result = statusPtr.get();
    7777    ins.append(std::make_pair(codeOrigin, WTFMove(statusPtr)));
    7878    return result;
  • trunk/Source/JavaScriptCore/bytecode/RecordedStatuses.h

    r273138 r278445  
    3030#include "DeleteByStatus.h"
    3131#include "GetByStatus.h"
    32 #include "InByIdStatus.h"
     32#include "InByStatus.h"
    3333#include "PutByIdStatus.h"
    3434#include "SetPrivateBrandStatus.h"
     
    5050    GetByStatus* addGetByStatus(const CodeOrigin&, const GetByStatus&);
    5151    PutByIdStatus* addPutByIdStatus(const CodeOrigin&, const PutByIdStatus&);
    52     InByIdStatus* addInByIdStatus(const CodeOrigin&, const InByIdStatus&);
     52    InByStatus* addInByStatus(const CodeOrigin&, const InByStatus&);
    5353    DeleteByStatus* addDeleteByStatus(const CodeOrigin&, const DeleteByStatus&);
    5454    CheckPrivateBrandStatus* addCheckPrivateBrandStatus(const CodeOrigin&, const CheckPrivateBrandStatus&);
     
    7878    Vector<std::pair<CodeOrigin, std::unique_ptr<GetByStatus>>> gets;
    7979    Vector<std::pair<CodeOrigin, std::unique_ptr<PutByIdStatus>>> puts;
    80     Vector<std::pair<CodeOrigin, std::unique_ptr<InByIdStatus>>> ins;
     80    Vector<std::pair<CodeOrigin, std::unique_ptr<InByStatus>>> ins;
    8181    Vector<std::pair<CodeOrigin, std::unique_ptr<DeleteByStatus>>> deletes;
    8282    Vector<std::pair<CodeOrigin, std::unique_ptr<CheckPrivateBrandStatus>>> checkPrivateBrands;
  • trunk/Source/JavaScriptCore/bytecode/SetPrivateBrandStatus.cpp

    r275490 r278445  
    227227CacheableIdentifier SetPrivateBrandStatus::singleIdentifier() const
    228228{
    229     if (m_variants.isEmpty())
    230         return nullptr;
    231 
    232     CacheableIdentifier result = m_variants.first().identifier();
    233     if (!result)
    234         return nullptr;
    235     for (size_t i = 1; i < m_variants.size(); ++i) {
    236         CacheableIdentifier identifier = m_variants[i].identifier();
    237         if (!identifier)
    238             return nullptr;
    239         if (identifier != result)
    240             return nullptr;
    241     }
    242     return result;
     229    return singleIdentifierForICStatus(m_variants);
    243230}
    244231
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp

    r277909 r278445  
    273273        resetPutByID(codeBlock, *this);
    274274        break;
    275     case AccessType::In:
    276         resetInByID(codeBlock, *this);
     275    case AccessType::InById:
     276        resetInBy(codeBlock, *this, InByKind::Normal);
     277        break;
     278    case AccessType::InByVal:
     279        resetInBy(codeBlock, *this, InByKind::NormalByVal);
    277280        break;
    278281    case AccessType::InstanceOf:
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h

    r277958 r278445  
    5656    GetByVal,
    5757    Put,
    58     In,
     58    InById,
     59    InByVal,
    5960    InstanceOf,
    6061    DeleteByID,
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r278369 r278445  
    44404440    case FilterGetByStatus:
    44414441    case FilterPutByIdStatus:
    4442     case FilterInByIdStatus:
     4442    case FilterInByStatus:
    44434443    case FilterDeleteByStatus:
    44444444    case FilterCheckPrivateBrandStatus:
     
    46114611    }
    46124612       
    4613     case FilterInByIdStatus: {
     4613    case FilterInByStatus: {
    46144614        AbstractValue& value = forNode(node->child1());
    46154615        if (value.m_structure.isFinite())
    4616             node->inByIdStatus()->filter(value.m_structure.toStructureSet());
     4616            node->inByStatus()->filter(value.m_structure.toStructureSet());
    46174617        break;
    46184618    }
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp

    r272580 r278445  
    405405                case FilterPutByIdStatus:
    406406                case FilterCallLinkStatus:
    407                 case FilterInByIdStatus:
     407                case FilterInByStatus:
    408408                case FilterDeleteByStatus:
    409409                case FilterCheckPrivateBrandStatus:
     
    12681268                case FilterPutByIdStatus:
    12691269                case FilterCallLinkStatus:
    1270                 case FilterInByIdStatus:
     1270                case FilterInByStatus:
    12711271                case FilterDeleteByStatus:
    12721272                case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r278253 r278445  
    5656#include "GetterSetter.h"
    5757#include "Heap.h"
    58 #include "InByIdStatus.h"
     58#include "InByStatus.h"
    5959#include "InstanceOfStatus.h"
    6060#include "JSArrayIterator.h"
     
    264264    void handleDeleteById(
    265265        VirtualRegister destination, Node* base, CacheableIdentifier, unsigned identifierNumber, DeleteByStatus, ECMAMode);
    266    
     266
     267    void handleInById(VirtualRegister destination, Node* base, CacheableIdentifier, InByStatus);
     268
    267269    // Either register a watchpoint or emit a check for this condition. Returns false if the
    268270    // condition no longer holds, and therefore no reasonable check can be emitted.
     
    49274929    set(destination, jsConstant(jsBoolean(variant.result())));
    49284930    return;
     4931}
     4932
     4933void ByteCodeParser::handleInById(VirtualRegister destination, Node* base, CacheableIdentifier identifier, InByStatus status)
     4934{
     4935    if (status.isSimple() && Options::useAccessInlining()) {
     4936        bool allOK = true;
     4937        MatchStructureData* data = m_graph.m_matchStructureData.add();
     4938        for (const InByIdVariant& variant : status.variants()) {
     4939            if (!check(variant.conditionSet())) {
     4940                allOK = false;
     4941                break;
     4942            }
     4943            for (Structure* structure : variant.structureSet()) {
     4944                MatchStructureVariant matchVariant;
     4945                matchVariant.structure = m_graph.registerStructure(structure);
     4946                matchVariant.result = variant.isHit();
     4947
     4948                data->variants.append(WTFMove(matchVariant));
     4949            }
     4950        }
     4951
     4952        if (allOK) {
     4953            addToGraph(FilterInByStatus, OpInfo(m_graph.m_plan.recordedStatuses().addInByStatus(currentCodeOrigin(), status)), base);
     4954            set(destination, addToGraph(MatchStructure, OpInfo(data), base));
     4955            return;
     4956        }
     4957    }
     4958
     4959    set(destination, addToGraph(InById, OpInfo(identifier), base));
    49294960}
    49304961
     
    82138244        case op_in_by_val: {
    82148245            auto bytecode = currentInstruction->as<OpInByVal>();
    8215             ArrayMode arrayMode = getArrayMode(bytecode.metadata(codeBlock).m_arrayProfile, Array::Read);
    8216             set(bytecode.m_dst, addToGraph(InByVal, OpInfo(arrayMode.asWord()), get(bytecode.m_base), get(bytecode.m_property)));
     8246            Node* base = get(bytecode.m_base);
     8247            Node* property = get(bytecode.m_property);
     8248            bool compiledAsInById = false;
     8249
     8250            if (!m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadIdent)
     8251                && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadType)
     8252                && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadConstantValue)) {
     8253
     8254                InByStatus status = InByStatus::computeFor(
     8255                    m_inlineStackTop->m_profiledBlock, m_inlineStackTop->m_baselineMap,
     8256                    m_icContextStack, currentCodeOrigin());
     8257
     8258                if (CacheableIdentifier identifier = status.singleIdentifier()) {
     8259                    UniquedStringImpl* uid = identifier.uid();
     8260                    m_graph.identifiers().ensure(uid);
     8261                    if (identifier.isCell()) {
     8262                        FrozenValue* frozen = m_graph.freezeStrong(identifier.cell());
     8263                        if (identifier.isSymbolCell())
     8264                            addToGraph(CheckIsConstant, OpInfo(frozen), property);
     8265                        else
     8266                            addToGraph(CheckIdent, OpInfo(uid), property);
     8267                    } else
     8268                        addToGraph(CheckIdent, OpInfo(uid), property);
     8269
     8270                    handleInById(bytecode.m_dst, base, identifier, status);
     8271                    compiledAsInById = true;
     8272                }
     8273            }
     8274
     8275            if (!compiledAsInById) {
     8276                ArrayMode arrayMode = getArrayMode(bytecode.metadata(codeBlock).m_arrayProfile, Array::Read);
     8277                set(bytecode.m_dst, addToGraph(InByVal, OpInfo(arrayMode.asWord()), base, property));
     8278            }
    82178279            NEXT_OPCODE(op_in_by_val);
    82188280        }
     
    82238285            unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[bytecode.m_property];
    82248286            UniquedStringImpl* uid = m_graph.identifiers()[identifierNumber];
    8225 
    8226             InByIdStatus status = InByIdStatus::computeFor(
    8227                 m_inlineStackTop->m_profiledBlock,
    8228                 m_inlineStackTop->m_baselineMap, m_icContextStack,
    8229                 currentCodeOrigin(), uid);
    8230 
    8231             if (status.isSimple() && Options::useAccessInlining()) {
    8232                 bool allOK = true;
    8233                 MatchStructureData* data = m_graph.m_matchStructureData.add();
    8234                 for (const InByIdVariant& variant : status.variants()) {
    8235                     if (!check(variant.conditionSet())) {
    8236                         allOK = false;
    8237                         break;
    8238                     }
    8239                     for (Structure* structure : variant.structureSet()) {
    8240                         MatchStructureVariant matchVariant;
    8241                         matchVariant.structure = m_graph.registerStructure(structure);
    8242                         matchVariant.result = variant.isHit();
    8243 
    8244                         data->variants.append(WTFMove(matchVariant));
    8245                     }
    8246                 }
    8247 
    8248                 if (allOK) {
    8249                     addToGraph(FilterInByIdStatus, OpInfo(m_graph.m_plan.recordedStatuses().addInByIdStatus(currentCodeOrigin(), status)), base);
    8250 
    8251                     Node* match = addToGraph(MatchStructure, OpInfo(data), base);
    8252                     set(bytecode.m_dst, match);
    8253                     NEXT_OPCODE(op_in_by_id);
    8254                 }
    8255             }
    8256 
    8257             set(bytecode.m_dst, addToGraph(InById, OpInfo(CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_inlineStackTop->m_profiledBlock, uid)), base));
     8287            InByStatus status = InByStatus::computeFor(
     8288                m_inlineStackTop->m_profiledBlock, m_inlineStackTop->m_baselineMap,
     8289                m_icContextStack, currentCodeOrigin());
     8290            handleInById(bytecode.m_dst, base, CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_inlineStackTop->m_profiledBlock, uid), status);
    82588291            NEXT_OPCODE(op_in_by_id);
    82598292        }
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r277926 r278445  
    505505    case FilterGetByStatus:
    506506    case FilterPutByIdStatus:
    507     case FilterInByIdStatus:
     507    case FilterInByStatus:
    508508    case FilterDeleteByStatus:
    509509    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp

    r272580 r278445  
    8383    case FilterGetByStatus:
    8484    case FilterPutByIdStatus:
    85     case FilterInByIdStatus:
     85    case FilterInByStatus:
    8686    case FilterDeleteByStatus:
    8787    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp

    r278424 r278445  
    250250    case FilterGetByStatus:
    251251    case FilterPutByIdStatus:
    252     case FilterInByIdStatus:
     252    case FilterInByStatus:
    253253    case FilterDeleteByStatus:
    254254    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r278253 r278445  
    28832883        case FilterGetByStatus:
    28842884        case FilterPutByIdStatus:
    2885         case FilterInByIdStatus:
     2885        case FilterInByStatus:
    28862886        case FilterDeleteByStatus:
    28872887        case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r276226 r278445  
    384384    if (node->hasGetByStatus())
    385385        out.print(comma, *node->getByStatus());
    386     if (node->hasInByIdStatus())
    387         out.print(comma, *node->inByIdStatus());
     386    if (node->hasInByStatus())
     387        out.print(comma, *node->inByStatus());
    388388    if (node->hasPutByIdStatus())
    389389        out.print(comma, *node->putByIdStatus());
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r278030 r278445  
    256256    finalizeInlineCaches(m_delByVals, linkBuffer);
    257257    finalizeInlineCaches(m_inByIds, linkBuffer);
     258    finalizeInlineCaches(m_inByVals, linkBuffer);
    258259    finalizeInlineCaches(m_instanceOfs, linkBuffer);
    259260    finalizeInlineCaches(m_privateBrandAccesses, linkBuffer);
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r277680 r278445  
    215215    }
    216216
     217    void addInByVal(const JITInByValGenerator& gen, SlowPathGenerator* slowPath)
     218    {
     219        m_inByVals.append(InlineCacheWrapper<JITInByValGenerator>(gen, slowPath));
     220    }
     221
    217222    void addPrivateBrandAccess(const JITPrivateBrandAccessGenerator& gen, SlowPathGenerator* slowPath)
    218223    {
     
    354359    Vector<InlineCacheWrapper<JITDelByValGenerator>, 4> m_delByVals;
    355360    Vector<InlineCacheWrapper<JITInByIdGenerator>, 4> m_inByIds;
     361    Vector<InlineCacheWrapper<JITInByValGenerator>, 4> m_inByVals;
    356362    Vector<InlineCacheWrapper<JITInstanceOfGenerator>, 4> m_instanceOfs;
    357363    Vector<InlineCacheWrapper<JITPrivateBrandAccessGenerator>, 4> m_privateBrandAccesses;
  • trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp

    r274037 r278445  
    108108    case FilterGetByStatus:
    109109    case FilterPutByIdStatus:
    110     case FilterInByIdStatus:
     110    case FilterInByStatus:
    111111    case FilterDeleteByStatus:
    112112    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r278253 r278445  
    31103110    }
    31113111   
    3112     bool hasInByIdStatus()
    3113     {
    3114         return op() == FilterInByIdStatus;
    3115     }
    3116    
    3117     InByIdStatus* inByIdStatus()
    3118     {
    3119         ASSERT(hasInByIdStatus());
    3120         return m_opInfo.as<InByIdStatus*>();
     3112    bool hasInByStatus()
     3113    {
     3114        return op() == FilterInByStatus;
     3115    }
     3116   
     3117    InByStatus* inByStatus()
     3118    {
     3119        ASSERT(hasInByStatus());
     3120        return m_opInfo.as<InByStatus*>();
    31213121    }
    31223122   
  • trunk/Source/JavaScriptCore/dfg/DFGNodeType.h

    r277926 r278445  
    547547    macro(FilterCallLinkStatus, NodeMustGenerate) \
    548548    macro(FilterGetByStatus, NodeMustGenerate) \
    549     macro(FilterInByIdStatus, NodeMustGenerate) \
     549    macro(FilterInByStatus, NodeMustGenerate) \
    550550    macro(FilterPutByIdStatus, NodeMustGenerate) \
    551551    macro(FilterDeleteByStatus, NodeMustGenerate) \
  • trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp

    r274539 r278445  
    12601260        case FilterGetByStatus:
    12611261        case FilterPutByIdStatus:
    1262         case FilterInByIdStatus:
     1262        case FilterInByStatus:
    12631263        case FilterDeleteByStatus:
    12641264        case FilterCheckPrivateBrandStatus:
     
    26172617                case FilterGetByStatus:
    26182618                case FilterPutByIdStatus:
    2619                 case FilterInByIdStatus:
     2619                case FilterInByStatus:
    26202620                case FilterDeleteByStatus:
    26212621                case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp

    r277926 r278445  
    14521452        case FilterGetByStatus:
    14531453        case FilterPutByIdStatus:
    1454         case FilterInByIdStatus:
     1454        case FilterInByStatus:
    14551455        case FilterDeleteByStatus:
    14561456        case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h

    r277926 r278445  
    362362    case FilterGetByStatus:
    363363    case FilterPutByIdStatus:
    364     case FilterInByIdStatus:
     364    case FilterInByStatus:
    365365    case FilterDeleteByStatus:
    366366    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r278253 r278445  
    12871287    SpeculateCellOperand base(this, node->child1());
    12881288    JSValueOperand key(this, node->child2());
     1289    JSValueRegsTemporary result(this, Reuse, key);
    12891290
    12901291    GPRReg baseGPR = base.gpr();
    1291     JSValueRegs regs = key.jsValueRegs();
     1292    JSValueRegs keyRegs = key.jsValueRegs();
     1293    JSValueRegs resultRegs = result.regs();
    12921294
    12931295    base.use();
    12941296    key.use();
    12951297
    1296     flushRegisters();
    1297     JSValueRegsFlushedCallResult result(this);
    1298     JSValueRegs resultRegs = result.regs();
    1299     callOperation(operationInByVal, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, regs);
    1300     m_jit.exceptionCheck();
     1298    CodeOrigin codeOrigin = node->origin.semantic;
     1299    CallSiteIndex callSite = m_jit.recordCallSiteAndGenerateExceptionHandlingOSRExitIfNeeded(codeOrigin, m_stream->size());
     1300    RegisterSet usedRegisters = this->usedRegisters();
     1301    JITInByValGenerator gen(
     1302        m_jit.codeBlock(), codeOrigin, callSite, usedRegisters,
     1303        JSValueRegs::payloadOnly(baseGPR), keyRegs, resultRegs);
     1304    gen.generateFastPath(m_jit);
     1305
     1306    auto slowPath = slowPathCall(
     1307        gen.slowPathJump(), this, operationInByValOptimize,
     1308        NeedToSpill, ExceptionCheckRequirement::CheckNeeded,
     1309        resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), gen.stubInfo(), nullptr, CCallHelpers::CellValue(baseGPR), keyRegs);
     1310
     1311    m_jit.addInByVal(gen, slowPath.get());
     1312    addSlowPathGenerator(WTFMove(slowPath));
     1313
    13011314    blessedBooleanResult(resultRegs.payloadGPR(), node, UseChildrenCalledExplicitly);
    13021315}
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r278253 r278445  
    42724272    case FilterGetByStatus:
    42734273    case FilterPutByIdStatus:
    4274     case FilterInByIdStatus:
     4274    case FilterInByStatus:
    42754275    case FilterDeleteByStatus:
    42764276    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r278253 r278445  
    57065706    case FilterGetByStatus:
    57075707    case FilterPutByIdStatus:
    5708     case FilterInByIdStatus:
     5708    case FilterInByStatus:
    57095709    case FilterDeleteByStatus:
    57105710    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp

    r278211 r278445  
    199199            case FilterPutByIdStatus:
    200200            case FilterCallLinkStatus:
    201             case FilterInByIdStatus:
     201            case FilterInByStatus:
    202202            case FilterDeleteByStatus:
    203203            case FilterCheckPrivateBrandStatus:
     
    424424            case FilterPutByIdStatus:
    425425            case FilterCallLinkStatus:
    426             case FilterInByIdStatus:
     426            case FilterInByStatus:
    427427            case FilterDeleteByStatus:
    428428            case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp

    r277926 r278445  
    410410    case FilterGetByStatus:
    411411    case FilterPutByIdStatus:
    412     case FilterInByIdStatus:
     412    case FilterInByStatus:
    413413    case FilterDeleteByStatus:
    414414    case FilterCheckPrivateBrandStatus:
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r278338 r278445  
    16531653        case FilterGetByStatus:
    16541654        case FilterPutByIdStatus:
    1655         case FilterInByIdStatus:
     1655        case FilterInByStatus:
    16561656        case FilterDeleteByStatus:
    16571657        case FilterCheckPrivateBrandStatus:
     
    1221412214        setJSValue(m_out.phi(Int64, results));
    1221512215    }
    12216    
    12217     void compileInByVal()
    12218     {
    12219         JSGlobalObject* globalObject = m_graph.globalObjectFor(m_origin.semantic);
    12220         setJSValue(vmCall(Int64, operationInByVal, weakPointer(globalObject), lowCell(m_node->child1()), lowJSValue(m_node->child2())));
    12221     }
    12222    
     12216
    1222312217    void compileHasPrivateName()
    1222412218    {
     
    1223312227    }
    1223412228
    12235     void compileInById()
    12236     {
    12237         Node* node = m_node;
    12238         CacheableIdentifier identifier = node->cacheableIdentifier();
    12239         LValue base = lowCell(m_node->child1());
    12240 
     12229    template<InByKind kind, typename SubscriptKind>
     12230    void compileInBy(LValue base, SubscriptKind subscriptValue)
     12231    {
    1224112232        PatchpointValue* patchpoint = m_out.patchpoint(Int64);
    1224212233        patchpoint->appendSomeRegister(base);
     12234        if constexpr (kind != InByKind::Normal)
     12235            patchpoint->appendSomeRegister(subscriptValue);
    1224312236        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
    1224412237        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
    12245 
    1224612238        patchpoint->clobber(RegisterSet::macroScratchRegisters());
    1224712239
    12248         RefPtr<PatchpointExceptionHandle> exceptionHandle =
    12249             preparePatchpointForExceptions(patchpoint);
     12240        RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint);
    1225012241
    1225112242        State* state = &m_ftlState;
     12243        Node* node = m_node;
    1225212244        patchpoint->setGenerator(
    1225312245            [=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
    1225412246                AllowMacroScratchRegisterUsage allowScratch(jit);
    1225512247
    12256                 CallSiteIndex callSiteIndex =
    12257                     state->jitCode->common.codeOrigins->addUniqueCallSiteIndex(node->origin.semantic);
     12248                CallSiteIndex callSiteIndex = state->jitCode->common.codeOrigins->addUniqueCallSiteIndex(node->origin.semantic);
    1225812249
    1225912250                // This is the direct exit target for operation calls.
    12260                 Box<CCallHelpers::JumpList> exceptions =
    12261                     exceptionHandle->scheduleExitCreation(params)->jumps(jit);
    12262 
    12263                 auto generator = Box<JITInByIdGenerator>::create(
    12264                     jit.codeBlock(), node->origin.semantic, callSiteIndex,
    12265                     params.unavailableRegisters(), identifier, JSValueRegs(params[1].gpr()),
    12266                     JSValueRegs(params[0].gpr()));
     12251                Box<CCallHelpers::JumpList> exceptions = exceptionHandle->scheduleExitCreation(params)->jumps(jit);
     12252
     12253                auto returnGPR = params[0].gpr();
     12254                auto base = JSValueRegs(params[1].gpr());
     12255
     12256                const auto subscript = [&] {
     12257                    if constexpr (kind == InByKind::Normal)
     12258                        return CCallHelpers::TrustedImmPtr(subscriptValue.rawBits());
     12259                    else
     12260                        return JSValueRegs(params[2].gpr());
     12261                }();
     12262
     12263                const auto generator = [&] {
     12264                    if constexpr (kind == InByKind::Normal) {
     12265                        return Box<JITInByIdGenerator>::create(
     12266                            jit.codeBlock(), node->origin.semantic, callSiteIndex,
     12267                            params.unavailableRegisters(), subscriptValue, base,
     12268                            JSValueRegs(returnGPR));
     12269                    } else {
     12270                        return Box<JITInByValGenerator>::create(
     12271                            jit.codeBlock(), node->origin.semantic, callSiteIndex,
     12272                            params.unavailableRegisters(), base, subscript,
     12273                            JSValueRegs(returnGPR));
     12274                    }
     12275                }();
    1226712276
    1226812277                generator->generateFastPath(jit);
     
    1227512284                        generator->slowPathJump().link(&jit);
    1227612285                        CCallHelpers::Label slowPathBegin = jit.label();
    12277                         CCallHelpers::Call slowPathCall = callOperation(
    12278                             *state, params.unavailableRegisters(), jit, node->origin.semantic,
    12279                             exceptions.get(), operationInByIdOptimize, params[0].gpr(),
    12280                             jit.codeBlock()->globalObjectFor(node->origin.semantic),
    12281                             CCallHelpers::TrustedImmPtr(generator->stubInfo()), params[1].gpr(),
    12282                             identifier.rawBits()).call();
     12286                        CCallHelpers::Call slowPathCall;
     12287                        if constexpr (kind == InByKind::Normal) {
     12288                            slowPathCall = callOperation(
     12289                                *state, params.unavailableRegisters(), jit, node->origin.semantic,
     12290                                exceptions.get(), operationInByIdOptimize, returnGPR,
     12291                                jit.codeBlock()->globalObjectFor(node->origin.semantic),
     12292                                CCallHelpers::TrustedImmPtr(generator->stubInfo()),
     12293                                base, subscript).call();
     12294                        } else {
     12295                            slowPathCall = callOperation(
     12296                                *state, params.unavailableRegisters(), jit, node->origin.semantic,
     12297                                exceptions.get(), operationInByValOptimize, returnGPR,
     12298                                jit.codeBlock()->globalObjectFor(node->origin.semantic),
     12299                                CCallHelpers::TrustedImmPtr(generator->stubInfo()),
     12300                                CCallHelpers::TrustedImmPtr(nullptr), base, subscript).call();
     12301                        }
    1228312302                        jit.jump().linkTo(done, &jit);
    1228412303
     
    1229312312
    1229412313        setJSValue(patchpoint);
     12314    }
     12315
     12316    void compileInById()
     12317    {
     12318        compileInBy<InByKind::Normal>(lowCell(m_node->child1()), m_node->cacheableIdentifier());
     12319    }
     12320
     12321    void compileInByVal()
     12322    {
     12323        compileInBy<InByKind::NormalByVal>(lowCell(m_node->child1()), lowJSValue(m_node->child2()));
    1229512324    }
    1229612325
  • trunk/Source/JavaScriptCore/jit/ICStats.h

    r272580 r278445  
    4444    macro(InAddAccessCase) \
    4545    macro(InReplaceWithJump) \
     46    macro(InReplaceWithGeneric) \
    4647    macro(InstanceOfAddAccessCase) \
    4748    macro(InstanceOfReplaceWithJump) \
     
    5354    macro(OperationGetByIdWithThisOptimize) \
    5455    macro(OperationGenericIn) \
    55     macro(OperationInById) \
     56    macro(OperationInByIdGeneric) \
    5657    macro(OperationInByIdOptimize) \
    5758    macro(OperationPutByIdStrict) \
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r278253 r278445  
    286286
    287287        switch (opcodeID) {
    288         DEFINE_SLOW_OP(in_by_val)
    289288        DEFINE_SLOW_OP(has_private_name)
    290289        DEFINE_SLOW_OP(has_private_brand)
     
    362361        DEFINE_OP(op_try_get_by_id)
    363362        DEFINE_OP(op_in_by_id)
     363        DEFINE_OP(op_in_by_val)
    364364        DEFINE_OP(op_get_by_id)
    365365        DEFINE_OP(op_get_by_id_with_this)
     
    519519    m_putByIdIndex = 0;
    520520    m_inByIdIndex = 0;
     521    m_inByValIndex = 0;
     522    m_delByIdIndex = 0;
    521523    m_delByValIndex = 0;
    522     m_delByIdIndex = 0;
    523524    m_instanceOfIndex = 0;
    524525    m_privateBrandAccessIndex = 0;
     
    571572        DEFINE_SLOWCASE_OP(op_try_get_by_id)
    572573        DEFINE_SLOWCASE_OP(op_in_by_id)
     574        DEFINE_SLOWCASE_OP(op_in_by_val)
    573575        DEFINE_SLOWCASE_OP(op_get_by_id)
    574576        DEFINE_SLOWCASE_OP(op_get_by_id_with_this)
     
    920922    finalizeInlineCaches(m_delByVals, patchBuffer);
    921923    finalizeInlineCaches(m_inByIds, patchBuffer);
     924    finalizeInlineCaches(m_inByVals, patchBuffer);
    922925    finalizeInlineCaches(m_instanceOfs, patchBuffer);
    923926    finalizeInlineCaches(m_privateBrandAccesses, patchBuffer);
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r278082 r278445  
    566566        void emit_op_get_prototype_of(const Instruction*);
    567567        void emit_op_in_by_id(const Instruction*);
     568        void emit_op_in_by_val(const Instruction*);
    568569        void emit_op_init_lazy_reg(const Instruction*);
    569570        void emit_op_overrides_has_instance(const Instruction*);
     
    699700        void emitSlow_op_get_argument_by_val(const Instruction*, Vector<SlowCaseEntry>::iterator&);
    700701        void emitSlow_op_in_by_id(const Instruction*, Vector<SlowCaseEntry>::iterator&);
     702        void emitSlow_op_in_by_val(const Instruction*, Vector<SlowCaseEntry>::iterator&);
    701703        void emitSlow_op_instanceof(const Instruction*, Vector<SlowCaseEntry>::iterator&);
    702704        void emitSlow_op_instanceof_custom(const Instruction*, Vector<SlowCaseEntry>::iterator&);
     
    10381040        Vector<JITPutByIdGenerator> m_putByIds;
    10391041        Vector<JITInByIdGenerator> m_inByIds;
     1042        Vector<JITInByValGenerator> m_inByVals;
    10401043        Vector<JITDelByIdGenerator> m_delByIds;
    10411044        Vector<JITDelByValGenerator> m_delByVals;
     
    10641067        unsigned m_putByIdIndex { UINT_MAX };
    10651068        unsigned m_inByIdIndex { UINT_MAX };
     1069        unsigned m_inByValIndex { UINT_MAX };
    10661070        unsigned m_delByValIndex { UINT_MAX };
    10671071        unsigned m_delByIdIndex { UINT_MAX };
  • trunk/Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp

    r272580 r278445  
    236236}
    237237
    238 JITInByIdGenerator::JITInByIdGenerator(
    239     CodeBlock* codeBlock, CodeOrigin codeOrigin, CallSiteIndex callSite, const RegisterSet& usedRegisters,
    240     CacheableIdentifier propertyName, JSValueRegs base, JSValueRegs value)
    241     : JITByIdGenerator(codeBlock, codeOrigin, callSite, AccessType::In, usedRegisters, base, value)
     238JITInByValGenerator::JITInByValGenerator(CodeBlock* codeBlock, CodeOrigin codeOrigin, CallSiteIndex callSiteIndex, const RegisterSet& usedRegisters, JSValueRegs base, JSValueRegs property, JSValueRegs result)
     239    : Base(codeBlock, codeOrigin, callSiteIndex, AccessType::InByVal, usedRegisters)
     240{
     241    m_stubInfo->hasConstantIdentifier = false;
     242
     243    m_stubInfo->baseGPR = base.payloadGPR();
     244    m_stubInfo->regs.propertyGPR = property.payloadGPR();
     245    m_stubInfo->valueGPR = result.payloadGPR();
     246#if USE(JSVALUE32_64)
     247    m_stubInfo->baseTagGPR = base.tagGPR();
     248    m_stubInfo->valueTagGPR = result.tagGPR();
     249    m_stubInfo->v.propertyTagGPR = property.tagGPR();
     250#endif
     251}
     252
     253void JITInByValGenerator::generateFastPath(MacroAssembler& jit)
     254{
     255    m_start = jit.label();
     256    m_slowPathJump = jit.patchableJump();
     257    m_done = jit.label();
     258}
     259
     260void JITInByValGenerator::finalize(
     261    LinkBuffer& fastPath, LinkBuffer& slowPath)
     262{
     263    ASSERT(m_start.isSet());
     264    Base::finalize(
     265        fastPath, slowPath, fastPath.locationOf<JITStubRoutinePtrTag>(m_start));
     266}
     267
     268JITInByIdGenerator::JITInByIdGenerator(CodeBlock* codeBlock, CodeOrigin codeOrigin, CallSiteIndex callSite, const RegisterSet& usedRegisters, CacheableIdentifier propertyName, JSValueRegs base, JSValueRegs value)
     269    : JITByIdGenerator(codeBlock, codeOrigin, callSite, AccessType::InById, usedRegisters, base, value)
    242270{
    243271    // FIXME: We are not supporting fast path for "length" property.
  • trunk/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h

    r272580 r278445  
    196196};
    197197
     198class JITInByValGenerator : public JITInlineCacheGenerator {
     199    using Base = JITInlineCacheGenerator;
     200public:
     201    JITInByValGenerator() { }
     202
     203    JITInByValGenerator(
     204        CodeBlock*, CodeOrigin, CallSiteIndex, const RegisterSet& usedRegisters,
     205        JSValueRegs base, JSValueRegs property, JSValueRegs result);
     206
     207    MacroAssembler::Jump slowPathJump() const
     208    {
     209        ASSERT(m_slowPathJump.m_jump.isSet());
     210        return m_slowPathJump.m_jump;
     211    }
     212
     213    void finalize(
     214        LinkBuffer& fastPathLinkBuffer, LinkBuffer& slowPathLinkBuffer);
     215
     216    void generateFastPath(MacroAssembler&);
     217
     218private:
     219    MacroAssembler::Label m_start;
     220    MacroAssembler::PatchableJump m_slowPathJump;
     221};
     222
    198223class JITInByIdGenerator : public JITByIdGenerator {
    199224public:
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r278253 r278445  
    395395}
    396396
    397 JSC_DEFINE_JIT_OPERATION(operationInById, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, EncodedJSValue base, uintptr_t rawCacheableIdentifier))
     397JSC_DEFINE_JIT_OPERATION(operationInByIdGeneric, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, EncodedJSValue base, uintptr_t rawCacheableIdentifier))
    398398{
    399399    SuperSamplerScope superSamplerScope(false);
     
    416416    JSObject* baseObject = asObject(baseValue);
    417417
    418     LOG_IC((ICEvent::OperationInById, baseObject->classInfo(vm), ident));
     418    LOG_IC((ICEvent::OperationInByIdGeneric, baseObject->classInfo(vm), ident));
    419419
    420420    scope.release();
     
    449449    CodeBlock* codeBlock = callFrame->codeBlock();
    450450    if (stubInfo->considerCachingBy(vm, codeBlock, baseObject->structure(vm), identifier))
    451         repatchInByID(globalObject, codeBlock, baseObject, identifier, found, slot, *stubInfo);
     451        repatchInBy(globalObject, codeBlock, baseObject, identifier, found, slot, *stubInfo, InByKind::Normal);
    452452    return JSValue::encode(jsBoolean(found));
    453453}
    454454
    455 JSC_DEFINE_JIT_OPERATION(operationInByVal, EncodedJSValue, (JSGlobalObject* globalObject, JSCell* base, EncodedJSValue key))
     455JSC_DEFINE_JIT_OPERATION(operationInByValOptimize, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, ArrayProfile* arrayProfile, EncodedJSValue encodedBase, EncodedJSValue encodedKey))
    456456{
    457457    SuperSamplerScope superSamplerScope(false);
    458    
    459     VM& vm = globalObject->vm();
    460     CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
    461     JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
    462 
    463     return JSValue::encode(jsBoolean(CommonSlowPaths::opInByVal(globalObject, base, JSValue::decode(key))));
     458
     459    VM& vm = globalObject->vm();
     460    CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
     461    JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
     462    auto scope = DECLARE_THROW_SCOPE(vm);
     463
     464    JSValue baseValue = JSValue::decode(encodedBase);
     465    if (!baseValue.isObject()) {
     466        throwException(globalObject, scope, createInvalidInParameterError(globalObject, baseValue));
     467        return encodedJSValue();
     468    }
     469    JSObject* baseObject = asObject(baseValue);
     470    if (arrayProfile)
     471        arrayProfile->observeStructure(baseObject->structure(vm));
     472
     473    JSValue key = JSValue::decode(encodedKey);
     474    uint32_t i;
     475    if (key.getUInt32(i)) {
     476        // FIXME: InByVal should have inline caching for integer indices too, as GetByVal does.
     477        // https://bugs.webkit.org/show_bug.cgi?id=226619
     478        if (arrayProfile)
     479            arrayProfile->observeIndexedRead(vm, baseObject, i);
     480        RELEASE_AND_RETURN(scope, JSValue::encode(jsBoolean(baseObject->hasProperty(globalObject, i))));
     481    }
     482
     483    const Identifier propertyName = key.toPropertyKey(globalObject);
     484    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     485    PropertySlot slot(baseObject, PropertySlot::InternalMethodType::HasProperty);
     486    bool found = baseObject->getPropertySlot(globalObject, propertyName, slot);
     487    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     488
     489    if (CacheableIdentifier::isCacheableIdentifierCell(key) && (key.isSymbol() || !parseIndex(propertyName))) {
     490        CodeBlock* codeBlock = callFrame->codeBlock();
     491        CacheableIdentifier identifier = CacheableIdentifier::createFromCell(key.asCell());
     492        if (stubInfo->considerCachingBy(vm, codeBlock, baseObject->structure(vm), identifier))
     493            repatchInBy(globalObject, codeBlock, baseObject, identifier, found, slot, *stubInfo, InByKind::NormalByVal);
     494    }
     495
     496    return JSValue::encode(jsBoolean(found));
     497}
     498
     499JSC_DEFINE_JIT_OPERATION(operationInByValGeneric, EncodedJSValue, (JSGlobalObject* globalObject, StructureStubInfo* stubInfo, ArrayProfile* arrayProfile, EncodedJSValue base, EncodedJSValue key))
     500{
     501    SuperSamplerScope superSamplerScope(false);
     502
     503    VM& vm = globalObject->vm();
     504    CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
     505    JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
     506
     507    stubInfo->tookSlowPath = true;
     508    return JSValue::encode(jsBoolean(CommonSlowPaths::opInByVal(globalObject, JSValue::decode(base), JSValue::decode(key), arrayProfile)));
    464509}
    465510
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r278029 r278445  
    175175JSC_DECLARE_JIT_OPERATION(operationGetByIdDirectOptimize, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, EncodedJSValue, uintptr_t));
    176176
    177 JSC_DECLARE_JIT_OPERATION(operationInById, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, EncodedJSValue, uintptr_t));
     177JSC_DECLARE_JIT_OPERATION(operationInByIdGeneric, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, EncodedJSValue, uintptr_t));
    178178JSC_DECLARE_JIT_OPERATION(operationInByIdOptimize, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, EncodedJSValue, uintptr_t));
    179 
    180 JSC_DECLARE_JIT_OPERATION(operationInByVal, EncodedJSValue, (JSGlobalObject*, JSCell*, EncodedJSValue));
     179JSC_DECLARE_JIT_OPERATION(operationInByValGeneric, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, ArrayProfile*, EncodedJSValue, EncodedJSValue));
     180JSC_DECLARE_JIT_OPERATION(operationInByValOptimize, EncodedJSValue, (JSGlobalObject*, StructureStubInfo*, ArrayProfile*, EncodedJSValue, EncodedJSValue));
    181181JSC_DECLARE_JIT_OPERATION(operationHasPrivateName, EncodedJSValue, (JSGlobalObject*, JSCell*, EncodedJSValue));
    182182JSC_DECLARE_JIT_OPERATION(operationHasPrivateBrand, EncodedJSValue, (JSGlobalObject*, JSCell*, EncodedJSValue));
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r278029 r278445  
    15691569
    15701570    emitPutVirtualRegister(resultVReg, returnValueGPR);
     1571#endif // ENABLE(EXTRA_CTI_THUNKS)
     1572
     1573    gen.reportSlowPathCall(coldPathBegin, call);
     1574}
     1575
     1576void JIT::emit_op_in_by_val(const Instruction* currentInstruction)
     1577{
     1578    auto bytecode = currentInstruction->as<OpInByVal>();
     1579    VirtualRegister dst = bytecode.m_dst;
     1580    VirtualRegister base = bytecode.m_base;
     1581    VirtualRegister property = bytecode.m_property;
     1582    auto& metadata = bytecode.metadata(m_codeBlock);
     1583    ArrayProfile* profile = &metadata.m_arrayProfile;
     1584
     1585    emitGetVirtualRegister(base, regT0);
     1586    emitJumpSlowCaseIfNotJSCell(regT0, base);
     1587    emitGetVirtualRegister(property, regT1);
     1588    emitArrayProfilingSiteWithCell(regT0, regT2, profile);
     1589
     1590    JITInByValGenerator gen(
     1591        m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
     1592        JSValueRegs(regT0), JSValueRegs(regT1), JSValueRegs(regT0));
     1593    gen.generateFastPath(*this);
     1594    addSlowCase(gen.slowPathJump());
     1595    m_inByVals.append(gen);
     1596
     1597    emitPutVirtualRegister(dst);
     1598}
     1599
     1600void JIT::emitSlow_op_in_by_val(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
     1601{
     1602    linkAllSlowCases(iter);
     1603
     1604    auto bytecode = currentInstruction->as<OpInByVal>();
     1605    VirtualRegister dst = bytecode.m_dst;
     1606    auto& metadata = bytecode.metadata(m_codeBlock);
     1607    ArrayProfile* profile = &metadata.m_arrayProfile;
     1608
     1609    JITInByValGenerator& gen = m_inByVals[m_inByValIndex++];
     1610
     1611    Label coldPathBegin = label();
     1612
     1613#if !ENABLE(EXTRA_CTI_THUNKS)
     1614    Call call = callOperation(operationInByValOptimize, dst, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), profile, regT0, regT1);
     1615#else
     1616    VM& vm = this->vm();
     1617    uint32_t bytecodeOffset = m_bytecodeIndex.offset();
     1618    ASSERT(BytecodeIndex(bytecodeOffset) == m_bytecodeIndex);
     1619
     1620    constexpr GPRReg bytecodeOffsetGPR = argumentGPR4;
     1621    move(TrustedImm32(bytecodeOffset), bytecodeOffsetGPR);
     1622
     1623    constexpr GPRReg stubInfoGPR = argumentGPR3;
     1624    constexpr GPRReg profileGPR = argumentGPR2;
     1625    constexpr GPRReg baseGPR = regT0;
     1626    constexpr GPRReg propertyGPR = regT1;
     1627    static_assert(baseGPR == argumentGPR0 || !isARM64());
     1628    static_assert(propertyGPR == argumentGPR1);
     1629
     1630    move(TrustedImmPtr(gen.stubInfo()), stubInfoGPR);
     1631    move(TrustedImmPtr(profile), profileGPR);
     1632    // slow_op_get_by_val_prepareCallGenerator will do exactly what we need.
     1633    // So, there's no point in creating a duplicate thunk just to give it a different name.
     1634    static_assert(std::is_same<decltype(operationInByValOptimize), decltype(operationGetByValOptimize)>::value);
     1635    emitNakedNearCall(vm.getCTIStub(slow_op_get_by_val_prepareCallGenerator).retaggedCode<NoPtrTag>());
     1636
     1637    Call call = appendCall(operationInByValOptimize);
     1638    emitNakedNearCall(vm.getCTIStub(checkExceptionGenerator).retaggedCode<NoPtrTag>());
     1639
     1640    emitPutVirtualRegister(dst, returnValueGPR);
    15711641#endif // ENABLE(EXTRA_CTI_THUNKS)
    15721642
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r274308 r278445  
    905905
    906906    Call call = callOperation(operationInByIdOptimize, resultVReg, m_codeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_codeBlock, *ident).rawBits());
     907
     908    gen.reportSlowPathCall(coldPathBegin, call);
     909}
     910
     911void JIT::emit_op_in_by_val(const Instruction* currentInstruction)
     912{
     913    auto bytecode = currentInstruction->as<OpInByVal>();
     914    VirtualRegister dst = bytecode.m_dst;
     915    VirtualRegister base = bytecode.m_base;
     916    VirtualRegister property = bytecode.m_property;
     917    auto& metadata = bytecode.metadata(m_codeBlock);
     918    ArrayProfile* profile = &metadata.m_arrayProfile;
     919
     920    emitLoad2(base, regT1, regT0, property, regT3, regT2);
     921    emitJumpSlowCaseIfNotJSCell(base, regT1);
     922    emitArrayProfilingSiteWithCell(regT0, regT4, profile);
     923
     924    JITInByValGenerator gen(
     925        m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
     926        JSValueRegs::payloadOnly(regT0), JSValueRegs(regT3, regT2), JSValueRegs(regT1, regT0));
     927    gen.generateFastPath(*this);
     928    addSlowCase(gen.slowPathJump());
     929    m_inByVals.append(gen);
     930
     931    emitStore(dst, regT1, regT0);
     932}
     933
     934void JIT::emitSlow_op_in_by_val(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
     935{
     936    linkAllSlowCases(iter);
     937
     938    auto bytecode = currentInstruction->as<OpInByVal>();
     939    VirtualRegister dst = bytecode.m_dst;
     940    auto& metadata = bytecode.metadata(m_codeBlock);
     941    ArrayProfile* profile = &metadata.m_arrayProfile;
     942
     943    JITInByValGenerator& gen = m_inByVals[m_inByValIndex++];
     944
     945    Label coldPathBegin = label();
     946
     947    Call call = callOperation(operationInByValOptimize, dst, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), profile, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
    907948
    908949    gen.reportSlowPathCall(coldPathBegin, call);
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r278253 r278445  
    898898}
    899899
    900 static InlineCacheAction tryCacheInByID(
     900static InlineCacheAction tryCacheInBy(
    901901    JSGlobalObject* globalObject, CodeBlock* codeBlock, JSObject* base, CacheableIdentifier propertyName,
    902902    bool wasFound, const PropertySlot& slot, StructureStubInfo& stubInfo)
     
    10031003}
    10041004
    1005 void repatchInByID(JSGlobalObject* globalObject, CodeBlock* codeBlock, JSObject* baseObject, CacheableIdentifier propertyName, bool wasFound, const PropertySlot& slot, StructureStubInfo& stubInfo)
     1005void repatchInBy(JSGlobalObject* globalObject, CodeBlock* codeBlock, JSObject* baseObject, CacheableIdentifier propertyName, bool wasFound, const PropertySlot& slot, StructureStubInfo& stubInfo, InByKind kind)
    10061006{
    10071007    SuperSamplerScope superSamplerScope(false);
    1008 
    1009     if (tryCacheInByID(globalObject, codeBlock, baseObject, propertyName, wasFound, slot, stubInfo) == GiveUpOnCache)
    1010         ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInById);
     1008    VM& vm = globalObject->vm();
     1009
     1010    if (tryCacheInBy(globalObject, codeBlock, baseObject, propertyName, wasFound, slot, stubInfo) == GiveUpOnCache) {
     1011        LOG_IC((ICEvent::InReplaceWithGeneric, baseObject->classInfo(globalObject->vm()), Identifier::fromUid(vm, propertyName.uid())));
     1012        if (kind == InByKind::Normal)
     1013            ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByIdGeneric);
     1014        else
     1015            ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByValGeneric);
     1016    }
    10111017}
    10121018
     
    16841690}
    16851691
    1686 void resetInByID(CodeBlock* codeBlock, StructureStubInfo& stubInfo)
    1687 {
    1688     ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByIdOptimize);
     1692void resetInBy(CodeBlock* codeBlock, StructureStubInfo& stubInfo, InByKind kind)
     1693{
     1694    if (kind == InByKind::Normal)
     1695        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByIdOptimize);
     1696    else
     1697        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByValOptimize);
    16891698    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation);
    16901699}
  • trunk/Source/JavaScriptCore/jit/Repatch.h

    r277680 r278445  
    4949};
    5050
     51enum class InByKind {
     52    Normal,
     53    NormalByVal
     54};
     55
    5156void repatchArrayGetByVal(JSGlobalObject*, CodeBlock*, JSValue base, JSValue index, StructureStubInfo&);
    5257void repatchGetBy(JSGlobalObject*, CodeBlock*, JSValue, CacheableIdentifier, const PropertySlot&, StructureStubInfo&, GetByKind);
    5358void repatchPutByID(JSGlobalObject*, CodeBlock*, JSValue, Structure*, CacheableIdentifier, const PutPropertySlot&, StructureStubInfo&, PutKind);
    5459void repatchDeleteBy(JSGlobalObject*, CodeBlock*, DeletePropertySlot&, JSValue, Structure*, CacheableIdentifier, StructureStubInfo&, DelByKind, ECMAMode);
    55 void repatchInByID(JSGlobalObject*, CodeBlock*, JSObject*, CacheableIdentifier, bool wasFound, const PropertySlot&, StructureStubInfo&);
     60void repatchInBy(JSGlobalObject*, CodeBlock*, JSObject*, CacheableIdentifier, bool wasFound, const PropertySlot&, StructureStubInfo&, InByKind);
    5661void repatchCheckPrivateBrand(JSGlobalObject*, CodeBlock*, JSObject*, CacheableIdentifier, StructureStubInfo&);
    5762void repatchSetPrivateBrand(JSGlobalObject*, CodeBlock*, JSObject*, Structure*, CacheableIdentifier, StructureStubInfo&);
     
    6570void resetPutByID(CodeBlock*, StructureStubInfo&);
    6671void resetDelBy(CodeBlock*, StructureStubInfo&, DelByKind);
    67 void resetInByID(CodeBlock*, StructureStubInfo&);
     72void resetInBy(CodeBlock*, StructureStubInfo&, InByKind);
    6873void resetInstanceOf(StructureStubInfo&);
    6974void resetCheckPrivateBrand(CodeBlock*, StructureStubInfo&);
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r278253 r278445  
    14251425}
    14261426
     1427LLINT_SLOW_PATH_DECL(slow_path_in_by_val)
     1428{
     1429    LLINT_BEGIN();
     1430    auto bytecode = pc->as<OpInByVal>();
     1431    auto& metadata = bytecode.metadata(codeBlock);
     1432    LLINT_RETURN(jsBoolean(CommonSlowPaths::opInByVal(globalObject, getOperand(callFrame, bytecode.m_base), getOperand(callFrame, bytecode.m_property), &metadata.m_arrayProfile)));
     1433}
     1434
    14271435LLINT_SLOW_PATH_DECL(slow_path_put_getter_by_id)
    14281436{
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h

    r277716 r278445  
    7373LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id);
    7474LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_in_by_id);
     75LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_in_by_val);
    7576LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_id);
    7677LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_val);
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r277926 r278445  
    20112011end
    20122012
    2013 slowPathOp(in_by_val)
    20142013slowPathOp(has_private_name)
    20152014slowPathOp(has_private_brand)
     
    20452044
    20462045llintSlowPathOp(in_by_id)
     2046llintSlowPathOp(in_by_val)
    20472047llintSlowPathOp(del_by_id)
    20482048llintSlowPathOp(del_by_val)
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

    r278338 r278445  
    831831}
    832832
    833 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_in_by_val)
    834 {
    835     BEGIN();
    836     auto bytecode = pc->as<OpInByVal>();
    837     auto& metadata = bytecode.metadata(codeBlock);
    838     RETURN(jsBoolean(CommonSlowPaths::opInByVal(globalObject, GET_C(bytecode.m_base).jsValue(), GET_C(bytecode.m_property).jsValue(), &metadata.m_arrayProfile)));
    839 }
    840 
    841833JSC_DEFINE_COMMON_SLOW_PATH(slow_path_has_private_name)
    842834{
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r277926 r278445  
    252252JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_callable);
    253253JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_constructor);
    254 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_in_by_val);
    255254JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_private_name);
    256255JSC_DECLARE_COMMON_SLOW_PATH(slow_path_has_private_brand);
Note: See TracChangeset for help on using the changeset viewer.