Changeset 295614 in webkit for trunk/Source/JavaScriptCore/jit
- Timestamp:
- Jun 16, 2022, 4:08:33 PM (3 years ago)
- Location:
- trunk/Source/JavaScriptCore/jit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JIT.cpp
r294873 r295614 947 947 auto finalizeICs = [&] (auto& generators) { 948 948 for (auto& gen : generators) { 949 gen.m_unlinkedStubInfo->start = patchBuffer.locationOf<JITStubRoutinePtrTag>(gen.m_start);950 949 gen.m_unlinkedStubInfo->doneLocation = patchBuffer.locationOf<JSInternalPtrTag>(gen.m_done); 951 950 gen.m_unlinkedStubInfo->slowPathStartLocation = patchBuffer.locationOf<JITStubRoutinePtrTag>(gen.m_slowPathBegin); -
trunk/Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp
r294873 r295614 64 64 { 65 65 ASSERT(m_stubInfo); 66 m_stubInfo->start = start;66 m_stubInfo->startLocation = start; 67 67 m_stubInfo->doneLocation = fastPath.locationOf<JSInternalPtrTag>(m_done); 68 68 … … 535 535 } 536 536 537 void JITGetByValGenerator::generateEmptyPath(CCallHelpers& jit) 538 { 539 m_start = jit.label(); 540 m_done = jit.label(); 541 } 542 537 543 void JITGetByValGenerator::finalize(LinkBuffer& fastPath, LinkBuffer& slowPath) 538 544 { -
trunk/Source/JavaScriptCore/jit/JITInlineCacheGenerator.h
r294873 r295614 559 559 void generateFastPath(CCallHelpers&); 560 560 561 void generateEmptyPath(CCallHelpers&); 562 561 563 template<typename StubInfo> 562 564 static void setUpStubInfo(StubInfo& stubInfo, -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r295008 r295614 63 63 emitGetVirtualRegister(property, propertyJSR); 64 64 65 auto [ stubInfo, stubInfoIndex ] = addUnlinkedStructureStubInfo(); 66 JITGetByValGenerator gen( 67 nullptr, stubInfo, JITType::BaselineJIT, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), AccessType::GetByVal, RegisterSet::stubUnavailableRegisters(), 68 baseJSR, propertyJSR, resultJSR, stubInfoGPR); 69 if (isOperandConstantInt(property)) 70 stubInfo->propertyIsInt32 = true; 71 gen.m_unlinkedStubInfoConstantIndex = stubInfoIndex; 72 65 73 if (bytecode.metadata(m_profiledCodeBlock).m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers()) { 74 stubInfo->tookSlowPath = true; 75 66 76 auto notCell = branchIfNotCell(baseJSR); 67 77 emitArrayProfilingSiteWithCell(bytecode, baseJSR.payloadGPR(), scratchGPR); 68 78 notCell.link(this); 69 79 loadGlobalObject(scratchGPR); 70 callOperationWithProfile(bytecode, operationGetByVal, dst, scratchGPR, baseJSR, propertyJSR); 80 callOperationWithResult(operationGetByVal, resultJSR, scratchGPR, baseJSR, propertyJSR); 81 82 gen.generateEmptyPath(*this); 71 83 } else { 72 84 emitJumpSlowCaseIfNotJSCell(baseJSR, base); 73 85 emitArrayProfilingSiteWithCell(bytecode, baseJSR.payloadGPR(), scratchGPR); 74 86 75 auto [ stubInfo, stubInfoIndex ] = addUnlinkedStructureStubInfo();76 JITGetByValGenerator gen(77 nullptr, stubInfo, JITType::BaselineJIT, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), AccessType::GetByVal, RegisterSet::stubUnavailableRegisters(),78 baseJSR, propertyJSR, resultJSR, stubInfoGPR);79 if (isOperandConstantInt(property))80 stubInfo->propertyIsInt32 = true;81 gen.m_unlinkedStubInfoConstantIndex = stubInfoIndex;82 83 87 gen.generateBaselineDataICFastPath(*this, stubInfoIndex, stubInfoGPR); 84 resetSP(); // We might OSR exit here, so we need to conservatively reset SP85 86 addSlowCase();87 m_getByVals.append(gen);88 89 setFastPathResumePoint();90 emitValueProfilingSite(bytecode, resultJSR);91 emitPutVirtualRegister(dst, resultJSR);92 88 } 89 90 addSlowCase(); 91 m_getByVals.append(gen); 92 93 resetSP(); // We might OSR exit here, so we need to conservatively reset SP 94 setFastPathResumePoint(); 95 emitValueProfilingSite(bytecode, resultJSR); 96 emitPutVirtualRegister(dst, resultJSR); 93 97 } 94 98 … … 96 100 void JIT::generateGetByValSlowCase(const OpcodeType& bytecode, Vector<SlowCaseEntry>::iterator& iter) 97 101 { 98 if (!hasAnySlowCases(iter)) 99 return; 102 ASSERT(hasAnySlowCases(iter)); 100 103 101 104 uint32_t bytecodeOffset = m_bytecodeIndex.offset(); … … 110 113 linkAllSlowCases(iter); 111 114 112 move(TrustedImm32(bytecodeOffset), bytecodeOffsetGPR); 113 loadConstant(gen.m_unlinkedStubInfoConstantIndex, stubInfoGPR); 114 materializePointerIntoMetadata(bytecode, OpcodeType::Metadata::offsetOfArrayProfile(), profileGPR); 115 116 emitNakedNearCall(vm().getCTIStub(slow_op_get_by_val_callSlowOperationThenCheckExceptionGenerator).retaggedCode<NoPtrTag>()); 115 if (!gen.m_unlinkedStubInfo->tookSlowPath) { 116 move(TrustedImm32(bytecodeOffset), bytecodeOffsetGPR); 117 loadConstant(gen.m_unlinkedStubInfoConstantIndex, stubInfoGPR); 118 materializePointerIntoMetadata(bytecode, OpcodeType::Metadata::offsetOfArrayProfile(), profileGPR); 119 120 emitNakedNearCall(vm().getCTIStub(slow_op_get_by_val_callSlowOperationThenCheckExceptionGenerator).retaggedCode<NoPtrTag>()); 121 } 117 122 118 123 gen.reportSlowPathCall(coldPathBegin, Call());
Note:
See TracChangeset
for help on using the changeset viewer.