Changeset 276224 in webkit
- Timestamp:
- Apr 18, 2021, 12:14:07 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 18 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (2 diffs)
-
bytecode/Operands.h (modified) (2 diffs)
-
dfg/DFGJITCode.cpp (modified) (6 diffs)
-
dfg/DFGJITCode.h (modified) (2 diffs)
-
dfg/DFGJITCompiler.cpp (modified) (10 diffs)
-
dfg/DFGJITCompiler.h (modified) (3 diffs)
-
dfg/DFGOSREntry.h (modified) (1 diff)
-
dfg/DFGOSRExit.cpp (modified) (2 diffs)
-
dfg/DFGSpeculativeJIT.cpp (modified) (7 diffs)
-
ftl/FTLJITCode.cpp (modified) (4 diffs)
-
ftl/FTLJITCode.h (modified) (1 diff)
-
ftl/FTLOSRExit.cpp (modified) (1 diff)
-
ftl/FTLOSRExit.h (modified) (1 diff)
-
ftl/FTLOSRExitCompiler.cpp (modified) (1 diff)
-
ftl/FTLOSRExitHandle.cpp (modified) (2 diffs)
-
ftl/FTLOSRExitHandle.h (modified) (1 diff)
-
ftl/FTLPatchpointExceptionHandle.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r276217 r276224 1 2021-04-18 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Make more DFG/FTL data FixedVector/Vector 4 https://bugs.webkit.org/show_bug.cgi?id=224713 5 6 Reviewed by Darin Adler. 7 8 1. DFG::JITCode::m_osrEntry / DFG::JITCode::m_osrExit / DFG::JITCode::m_speculationRecovery are changed to FixedVector. 9 They are added at compiling time, and after that, these vectors are not modified. So when finalizing, we can easily make it FixedVector. 10 We also change OSREntry::{m_reshufflings,m_expectedValues} to FixedVector and FixedOperands. 11 2. FTL::JITCode::m_osrExit is changed from SegmentedVector to Vector. We are still using Vector since it also involves osrExitDescriptor. 12 But later, we should merge m_osrExit to osrExitDescriptor. Vector is still better than SegmentedVector since it wastes several entries 13 per segment. SegmentedVector was used to use a direct pointer of OSRExit (this is not possible in Vector since this pointer can be invalidated 14 after growing), but usage of that is fairly limited so that we can just replace them with m_index + osrExit vector. 15 16 * bytecode/CodeBlock.cpp: 17 (JSC::CodeBlock::tallyFrequentExitSites): 18 * bytecode/Operands.h: 19 (JSC::Operands::Operands): 20 * dfg/DFGJITCode.cpp: 21 (JSC::DFG::JITCode::shrinkToFit): 22 (JSC::DFG::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite): 23 (JSC::DFG::JITCode::validateReferences): 24 (JSC::DFG::JITCode::findPC): 25 (JSC::DFG::JITCode::finalizeOSREntrypoints): 26 * dfg/DFGJITCode.h: 27 * dfg/DFGJITCompiler.cpp: 28 (JSC::DFG::JITCompiler::linkOSRExits): 29 (JSC::DFG::JITCompiler::link): 30 (JSC::DFG::JITCompiler::noticeOSREntry): 31 (JSC::DFG::JITCompiler::appendExceptionHandlingOSRExit): 32 * dfg/DFGJITCompiler.h: 33 (JSC::DFG::JITCompiler::appendOSRExit): 34 (JSC::DFG::JITCompiler::appendSpeculationRecovery): 35 * dfg/DFGOSREntry.h: 36 * dfg/DFGOSRExit.cpp: 37 (JSC::DFG::JSC_DEFINE_JIT_OPERATION): 38 * dfg/DFGSpeculativeJIT.cpp: 39 (JSC::DFG::SpeculativeJIT::speculationCheck): 40 (JSC::DFG::SpeculativeJIT::emitInvalidationPoint): 41 (JSC::DFG::SpeculativeJIT::linkOSREntries): 42 * ftl/FTLJITCode.cpp: 43 (JSC::FTL::JITCode::shrinkToFit): 44 (JSC::FTL::JITCode::validateReferences): 45 (JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite): 46 (JSC::FTL::JITCode::findPC): 47 * ftl/FTLJITCode.h: 48 * ftl/FTLOSRExit.cpp: 49 (JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle): 50 (JSC::FTL::OSRExit::OSRExit): 51 * ftl/FTLOSRExit.h: 52 * ftl/FTLOSRExitCompiler.cpp: 53 (JSC::FTL::JSC_DEFINE_JIT_OPERATION): 54 * ftl/FTLOSRExitHandle.cpp: 55 (JSC::FTL::OSRExitHandle::emitExitThunk): 56 * ftl/FTLOSRExitHandle.h: 57 (JSC::FTL::OSRExitHandle::OSRExitHandle): 58 * ftl/FTLPatchpointExceptionHandle.cpp: 59 (JSC::FTL::PatchpointExceptionHandle::scheduleExitCreationForUnwind): 60 1 61 2021-04-17 Yusuke Suzuki <ysuzuki@apple.com> 2 62 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r276102 r276224 2974 2974 case JITType::DFGJIT: { 2975 2975 DFG::JITCode* jitCode = m_jitCode->dfg(); 2976 for (auto& exit : jitCode-> osrExit)2976 for (auto& exit : jitCode->m_osrExit) 2977 2977 exit.considerAddingAsFrequentExitSite(profiledBlock); 2978 2978 break; … … 2981 2981 #if ENABLE(FTL_JIT) 2982 2982 case JITType::FTLJIT: { 2983 // There is no easy way to avoid duplicating this code since the FTL::JITCode:: osrExit2983 // There is no easy way to avoid duplicating this code since the FTL::JITCode::m_osrExit 2984 2984 // vector contains a totally different type, that just so happens to behave like 2985 // DFG::JITCode:: osrExit.2985 // DFG::JITCode::m_osrExit. 2986 2986 FTL::JITCode* jitCode = m_jitCode->ftl(); 2987 for (unsigned i = 0; i < jitCode->osrExit.size(); ++i) { 2988 FTL::OSRExit& exit = jitCode->osrExit[i]; 2987 for (auto& exit : jitCode->m_osrExit) 2989 2988 exit.considerAddingAsFrequentExitSite(profiledBlock); 2990 }2991 2989 break; 2992 2990 } -
trunk/Source/JavaScriptCore/bytecode/Operands.h
r275542 r276224 139 139 class Operands { 140 140 public: 141 template<typename, typename> friend class Operands; 142 141 143 using Storage = StorageArg; 142 144 using RefType = std::conditional_t<std::is_same_v<T, bool>, FastBitReference, T&>; … … 169 171 { 170 172 m_values.fill(initialValue); 173 } 174 175 template<typename U> 176 explicit Operands(const Operands<T, U>& other) 177 : m_values(other.m_values) 178 , m_numArguments(other.m_numArguments) 179 , m_numLocals(other.m_numLocals) 180 { 171 181 } 172 182 -
trunk/Source/JavaScriptCore/dfg/DFGJITCode.cpp
r261755 r276224 60 60 { 61 61 common.shrinkToFit(); 62 osrEntry.shrinkToFit();63 osrExit.shrinkToFit();64 speculationRecovery.shrinkToFit();65 62 minifiedDFG.prepareAndShrink(); 66 63 variableEventStream.shrinkToFit(); … … 87 84 RegisterSet JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock* codeBlock, CallSiteIndex callSiteIndex) 88 85 { 89 for (OSRExit& exit : osrExit) {86 for (OSRExit& exit : m_osrExit) { 90 87 if (exit.isExceptionHandler() && exit.m_exceptionHandlerCallSiteIndex.bits() == callSiteIndex.bits()) { 91 88 Operands<ValueRecovery> valueRecoveries; … … 220 217 common.validateReferences(trackedReferences); 221 218 222 for (OSREntryData& entry : osrEntry) {219 for (OSREntryData& entry : m_osrEntry) { 223 220 for (unsigned i = entry.m_expectedValues.size(); i--;) 224 221 entry.m_expectedValues[i].validateReferences(trackedReferences); … … 230 227 Optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc) 231 228 { 232 for (OSRExit& exit : osrExit) {229 for (OSRExit& exit : m_osrExit) { 233 230 if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) { 234 231 if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr()) … … 240 237 } 241 238 242 void JITCode::finalizeOSREntrypoints( )239 void JITCode::finalizeOSREntrypoints(Vector<OSREntryData>&& osrEntry) 243 240 { 244 241 auto comparator = [] (const auto& a, const auto& b) { … … 254 251 verifyIsSorted(osrEntry); 255 252 #endif 253 m_osrEntry = WTFMove(osrEntry); 256 254 } 257 255 -
trunk/Source/JavaScriptCore/dfg/DFGJITCode.h
r275542 r276224 55 55 JITCode* dfg() final; 56 56 57 OSREntryData* appendOSREntryData(BytecodeIndex bytecodeIndex, CodeLocationLabel<OSREntryPtrTag> machineCode)58 {59 DFG::OSREntryData entry;60 entry.m_bytecodeIndex = bytecodeIndex;61 entry.m_machineCode = machineCode;62 osrEntry.append(entry);63 return &osrEntry.last();64 }65 66 57 OSREntryData* osrEntryDataForBytecodeIndex(BytecodeIndex bytecodeIndex) 67 58 { 68 59 return tryBinarySearch<OSREntryData, BytecodeIndex>( 69 osrEntry,osrEntry.size(), bytecodeIndex,60 m_osrEntry, m_osrEntry.size(), bytecodeIndex, 70 61 getOSREntryDataBytecodeIndex); 71 62 } 72 63 73 void finalizeOSREntrypoints(); 74 75 unsigned appendOSRExit(const OSRExit& exit) 76 { 77 unsigned result = osrExit.size(); 78 osrExit.append(exit); 79 return result; 80 } 81 82 OSRExit& lastOSRExit() 83 { 84 return osrExit.last(); 85 } 86 87 unsigned appendSpeculationRecovery(const SpeculationRecovery& recovery) 88 { 89 unsigned result = speculationRecovery.size(); 90 speculationRecovery.append(recovery); 91 return result; 92 } 64 void finalizeOSREntrypoints(Vector<DFG::OSREntryData>&&); 93 65 94 66 void reconstruct( … … 136 108 public: 137 109 CommonData common; 138 Vector<DFG::OSREntryData>osrEntry;139 SegmentedVector<DFG::OSRExit, 8>osrExit;140 Vector<DFG::SpeculationRecovery>speculationRecovery;110 FixedVector<DFG::OSREntryData> m_osrEntry; 111 FixedVector<DFG::OSRExit> m_osrExit; 112 FixedVector<DFG::SpeculationRecovery> m_speculationRecovery; 141 113 DFG::VariableEventStream variableEventStream; 142 114 DFG::MinifiedGraph minifiedDFG; -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r276005 r276224 67 67 void JITCompiler::linkOSRExits() 68 68 { 69 ASSERT(m_ jitCode->osrExit.size() == m_exitCompilationInfo.size());69 ASSERT(m_osrExit.size() == m_exitCompilationInfo.size()); 70 70 if (UNLIKELY(m_graph.compilation())) { 71 for (unsigned i = 0; i < m_ jitCode->osrExit.size(); ++i) {71 for (unsigned i = 0; i < m_osrExit.size(); ++i) { 72 72 OSRExitCompilationInfo& info = m_exitCompilationInfo[i]; 73 73 Vector<Label> labels; … … 81 81 } 82 82 83 for (unsigned i = 0; i < m_ jitCode->osrExit.size(); ++i) {83 for (unsigned i = 0; i < m_osrExit.size(); ++i) { 84 84 OSRExitCompilationInfo& info = m_exitCompilationInfo[i]; 85 85 JumpList& failureJumps = info.m_failureJumps; … … 279 279 MacroAssemblerCodeRef<JITThunkPtrTag> osrExitThunk = vm().getCTIStub(osrExitGenerationThunkGenerator); 280 280 auto target = CodeLocationLabel<JITThunkPtrTag>(osrExitThunk.code()); 281 for (unsigned i = 0; i < m_ jitCode->osrExit.size(); ++i) {281 for (unsigned i = 0; i < m_osrExit.size(); ++i) { 282 282 OSRExitCompilationInfo& info = m_exitCompilationInfo[i]; 283 283 if (!Options::useProbeOSRExit()) { 284 284 linkBuffer.link(info.m_patchableJump.m_jump, target); 285 OSRExit& exit = m_ jitCode->osrExit[i];285 OSRExit& exit = m_osrExit[i]; 286 286 exit.m_patchableJumpLocation = linkBuffer.locationOf<JSInternalPtrTag>(info.m_patchableJump); 287 287 } … … 294 294 295 295 if (UNLIKELY(m_graph.compilation())) { 296 ASSERT(m_exitSiteLabels.size() == m_ jitCode->osrExit.size());296 ASSERT(m_exitSiteLabels.size() == m_osrExit.size()); 297 297 for (unsigned i = 0; i < m_exitSiteLabels.size(); ++i) { 298 298 Vector<Label>& labels = m_exitSiteLabels[i]; … … 306 306 307 307 m_jitCode->common.compilation = m_graph.compilation(); 308 m_jitCode->m_osrExit = WTFMove(m_osrExit); 309 m_jitCode->m_speculationRecovery = WTFMove(m_speculationRecovery); 308 310 309 311 // Link new DFG exception handlers and remove baseline JIT handlers. … … 548 550 return; 549 551 550 OSREntryData* entry = m_jitCode->appendOSREntryData(basicBlock.bytecodeBegin, linkBuffer.locationOf<OSREntryPtrTag>(blockHead)); 551 552 entry->m_expectedValues = basicBlock.intersectionOfPastValuesAtHead; 553 552 OSREntryData entry; 553 entry.m_bytecodeIndex = basicBlock.bytecodeBegin; 554 entry.m_machineCode = linkBuffer.locationOf<OSREntryPtrTag>(blockHead); 555 556 FixedOperands<AbstractValue> expectedValues(basicBlock.intersectionOfPastValuesAtHead); 557 Vector<OSREntryReshuffling> reshufflings; 558 554 559 // Fix the expected values: in our protocol, a dead variable will have an expected 555 560 // value of (None, []). But the old JIT may stash some values there. So we really … … 558 563 Node* node = basicBlock.variablesAtHead.argument(argument); 559 564 if (!node || !node->shouldGenerate()) 560 e ntry->m_expectedValues.argument(argument).makeBytecodeTop();565 expectedValues.argument(argument).makeBytecodeTop(); 561 566 } 562 567 for (size_t local = 0; local < basicBlock.variablesAtHead.numberOfLocals(); ++local) { 563 568 Node* node = basicBlock.variablesAtHead.local(local); 564 569 if (!node || !node->shouldGenerate()) 565 e ntry->m_expectedValues.local(local).makeBytecodeTop();570 expectedValues.local(local).makeBytecodeTop(); 566 571 else { 567 572 VariableAccessData* variable = node->variableAccessData(); 568 entry ->m_machineStackUsed.set(variable->machineLocal().toLocal());573 entry.m_machineStackUsed.set(variable->machineLocal().toLocal()); 569 574 570 575 switch (variable->flushFormat()) { 571 576 case FlushedDouble: 572 entry ->m_localsForcedDouble.set(local);577 entry.m_localsForcedDouble.set(local); 573 578 break; 574 579 case FlushedInt52: 575 entry ->m_localsForcedAnyInt.set(local);580 entry.m_localsForcedAnyInt.set(local); 576 581 break; 577 582 default: … … 581 586 ASSERT(!variable->operand().isTmp()); 582 587 if (variable->operand().virtualRegister() != variable->machineLocal()) { 583 entry->m_reshufflings.append(588 reshufflings.append( 584 589 OSREntryReshuffling( 585 590 variable->operand().virtualRegister().offset(), variable->machineLocal().offset())); … … 588 593 } 589 594 590 entry->m_reshufflings.shrinkToFit(); 595 entry.m_expectedValues = WTFMove(expectedValues); 596 entry.m_reshufflings = WTFMove(reshufflings); 597 m_osrEntry.append(WTFMove(entry)); 591 598 } 592 599 … … 597 604 exit.m_exceptionHandlerCallSiteIndex = callSite; 598 605 OSRExitCompilationInfo& exitInfo = appendExitInfo(jumpsToFail); 599 jitCode()->appendOSRExit(exit);606 m_osrExit.append(WTFMove(exit)); 600 607 m_exceptionHandlerOSRExitCallSites.append(ExceptionHandlingOSRExitInfo { exitInfo, *exceptionHandler, callSite }); 601 608 } -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r272580 r276224 87 87 class JITCompiler : public CCallHelpers { 88 88 public: 89 friend class SpeculativeJIT; 90 89 91 JITCompiler(Graph& dfg); 90 92 ~JITCompiler(); … … 266 268 void noticeOSREntry(BasicBlock&, JITCompiler::Label blockHead, LinkBuffer&); 267 269 void noticeCatchEntrypoint(BasicBlock&, JITCompiler::Label blockHead, LinkBuffer&, Vector<FlushFormat>&& argumentFormats); 268 270 271 unsigned appendOSRExit(OSRExit&& exit) 272 { 273 unsigned result = m_osrExit.size(); 274 m_osrExit.append(WTFMove(exit)); 275 return result; 276 } 277 278 unsigned appendSpeculationRecovery(const SpeculationRecovery& recovery) 279 { 280 unsigned result = m_speculationRecovery.size(); 281 m_speculationRecovery.append(recovery); 282 return result; 283 } 284 269 285 RefPtr<JITCode> jitCode() { return m_jitCode; } 270 286 … … 374 390 SegmentedVector<OSRExitCompilationInfo, 4> m_exitCompilationInfo; 375 391 Vector<Vector<Label>> m_exitSiteLabels; 392 Vector<DFG::OSREntryData> m_osrEntry; 393 Vector<DFG::OSRExit> m_osrExit; 394 Vector<DFG::SpeculationRecovery> m_speculationRecovery; 376 395 377 396 struct ExceptionHandlingOSRExitInfo { -
trunk/Source/JavaScriptCore/dfg/DFGOSREntry.h
r276005 r276224 57 57 BytecodeIndex m_bytecodeIndex; 58 58 CodeLocationLabel<OSREntryPtrTag> m_machineCode; 59 Operands<AbstractValue> m_expectedValues;59 FixedOperands<AbstractValue> m_expectedValues; 60 60 // Use bitvectors here because they tend to only require one word. 61 61 BitVector m_localsForcedDouble; 62 62 BitVector m_localsForcedAnyInt; 63 Vector<OSREntryReshuffling> m_reshufflings;63 FixedVector<OSREntryReshuffling> m_reshufflings; 64 64 BitVector m_machineStackUsed; 65 65 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r274045 r276224 164 164 165 165 uint32_t exitIndex = vm.osrExitIndex; 166 OSRExit& exit = codeBlock->jitCode()->dfg()-> osrExit[exitIndex];166 OSRExit& exit = codeBlock->jitCode()->dfg()->m_osrExit[exitIndex]; 167 167 168 168 ASSERT(!vm.callFrameForCatch || exit.m_kind == GenericUnwind); … … 175 175 SpeculationRecovery* recovery = nullptr; 176 176 if (exit.m_recoveryIndex != UINT_MAX) 177 recovery = &codeBlock->jitCode()->dfg()-> speculationRecovery[exit.m_recoveryIndex];177 recovery = &codeBlock->jitCode()->dfg()->m_speculationRecovery[exit.m_recoveryIndex]; 178 178 179 179 { -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r276005 r276224 269 269 } else 270 270 m_jit.appendExitInfo(jumpToFail); 271 m_jit. jitCode()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size()));271 m_jit.appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size())); 272 272 } 273 273 … … 284 284 } else 285 285 m_jit.appendExitInfo(jumpsToFail); 286 m_jit. jitCode()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size()));286 m_jit.appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size())); 287 287 } 288 288 … … 291 291 if (!m_compileOkay) 292 292 return OSRExitJumpPlaceholder(); 293 unsigned index = m_jit. jitCode()->osrExit.size();293 unsigned index = m_jit.m_osrExit.size(); 294 294 m_jit.appendExitInfo(); 295 m_jit. jitCode()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size()));295 m_jit.appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size())); 296 296 return OSRExitJumpPlaceholder(index); 297 297 } … … 316 316 if (!m_compileOkay) 317 317 return; 318 unsigned recoveryIndex = m_jit. jitCode()->appendSpeculationRecovery(recovery);318 unsigned recoveryIndex = m_jit.appendSpeculationRecovery(recovery); 319 319 m_jit.appendExitInfo(jumpToFail); 320 m_jit. jitCode()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size(), recoveryIndex));320 m_jit.appendOSRExit(OSRExit(kind, jsValueSource, m_jit.graph().methodOfGettingAValueProfileFor(m_currentNode, node), this, m_stream->size(), recoveryIndex)); 321 321 } 322 322 … … 331 331 return; 332 332 OSRExitCompilationInfo& info = m_jit.appendExitInfo(JITCompiler::JumpList()); 333 m_jit. jitCode()->appendOSRExit(OSRExit(333 m_jit.appendOSRExit(OSRExit( 334 334 UncountableInvalidation, JSValueSource(), MethodOfGettingAValueProfile(), 335 335 this, m_stream->size())); … … 2202 2202 } 2203 2203 2204 m_jit.jitCode()->finalizeOSREntrypoints( );2204 m_jit.jitCode()->finalizeOSREntrypoints(WTFMove(m_jit.m_osrEntry)); 2205 2205 m_jit.jitCode()->common.finalizeCatchEntrypoints(WTFMove(m_jit.graph().m_catchEntrypoints)); 2206 2206 … … 2210 2210 DumpContext dumpContext; 2211 2211 dataLog("OSR Entries:\n"); 2212 for (OSREntryData& entryData : m_jit.jitCode()-> osrEntry)2212 for (OSREntryData& entryData : m_jit.jitCode()->m_osrEntry) 2213 2213 dataLog(" ", inContext(entryData, &dumpContext), "\n"); 2214 2214 if (!dumpContext.isEmpty()) -
trunk/Source/JavaScriptCore/ftl/FTLJITCode.cpp
r261464 r276224 139 139 { 140 140 common.shrinkToFit(); 141 osrExit.shrinkToFit();141 m_osrExit.shrinkToFit(); 142 142 osrExitDescriptors.shrinkToFit(); 143 143 lazySlowPaths.shrinkToFit(); … … 148 148 common.validateReferences(trackedReferences); 149 149 150 for (OSRExit& exit : osrExit)150 for (OSRExit& exit : m_osrExit) 151 151 exit.m_descriptor->validateReferences(trackedReferences); 152 152 } … … 154 154 RegisterSet JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex callSiteIndex) 155 155 { 156 for (OSRExit& exit : osrExit) {156 for (OSRExit& exit : m_osrExit) { 157 157 if (exit.m_exceptionHandlerCallSiteIndex.bits() == callSiteIndex.bits()) { 158 158 RELEASE_ASSERT(exit.isExceptionHandler()); … … 166 166 Optional<CodeOrigin> JITCode::findPC(CodeBlock* codeBlock, void* pc) 167 167 { 168 for (OSRExit& exit : osrExit) {168 for (OSRExit& exit : m_osrExit) { 169 169 if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) { 170 170 if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr()) -
trunk/Source/JavaScriptCore/ftl/FTLJITCode.h
r271594 r276224 71 71 72 72 DFG::CommonData common; 73 SegmentedVector<OSRExit, 8>osrExit;73 Vector<OSRExit> m_osrExit; 74 74 SegmentedVector<OSRExitDescriptor, 8> osrExitDescriptors; 75 75 Vector<std::unique_ptr<LazySlowPath>> lazySlowPaths; -
trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp
r275588 r276224 83 83 const StackmapGenerationParams& params, uint32_t dfgNodeIndex, unsigned offset) 84 84 { 85 unsigned index = state.jitCode->osrExit.size(); 86 OSRExit& exit = state.jitCode->osrExit.alloc( 87 this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted, dfgNodeIndex); 88 Ref<OSRExitHandle> handle = adoptRef(*new OSRExitHandle(index, exit)); 89 exit.m_valueReps = FixedVector<B3::ValueRep>(params.size() - offset); 85 FixedVector<B3::ValueRep> valueReps(params.size() - offset); 90 86 for (unsigned i = offset, indexInValueReps = 0; i < params.size(); ++i, ++indexInValueReps) 91 exit.m_valueReps[indexInValueReps] = params[i]; 92 return handle; 87 valueReps[indexInValueReps] = params[i]; 88 unsigned index = state.jitCode->m_osrExit.size(); 89 state.jitCode->m_osrExit.append(OSRExit(this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted, dfgNodeIndex, WTFMove(valueReps))); 90 return adoptRef(*new OSRExitHandle(index, state.jitCode.get())); 93 91 } 94 92 95 93 OSRExit::OSRExit( 96 94 OSRExitDescriptor* descriptor, ExitKind exitKind, CodeOrigin codeOrigin, 97 CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex )95 CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex, FixedVector<B3::ValueRep>&& valueReps) 98 96 : OSRExitBase(exitKind, codeOrigin, codeOriginForExitProfile, wasHoisted, dfgNodeIndex) 99 97 , m_descriptor(descriptor) 98 , m_valueReps(WTFMove(valueReps)) 100 99 { 101 100 } -
trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h
r275588 r276224 121 121 122 122 struct OSRExit : public DFG::OSRExitBase { 123 OSRExit(OSRExitDescriptor*, ExitKind, CodeOrigin, CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex );123 OSRExit(OSRExitDescriptor*, ExitKind, CodeOrigin, CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex, FixedVector<B3::ValueRep>&&); 124 124 125 125 OSRExitDescriptor* m_descriptor; -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r275588 r276224 544 544 545 545 JITCode* jitCode = codeBlock->jitCode()->ftl(); 546 OSRExit& exit = jitCode-> osrExit[exitID];546 OSRExit& exit = jitCode->m_osrExit[exitID]; 547 547 548 548 if (shouldDumpDisassembly() || Options::verboseOSR() || Options::verboseFTLOSRExit()) { -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitHandle.cpp
r230748 r276224 42 42 CCallHelpers::Label myLabel = jit.label(); 43 43 label = myLabel; 44 jit.pushToSaveImmediateWithoutTouchingRegisters(CCallHelpers::TrustedImm32( index));44 jit.pushToSaveImmediateWithoutTouchingRegisters(CCallHelpers::TrustedImm32(m_index)); 45 45 CCallHelpers::PatchableJump jump = jit.patchableJump(); 46 46 RefPtr<OSRExitHandle> self = this; … … 48 48 jit.addLinkTask( 49 49 [self, jump, myLabel, compilation, &vm] (LinkBuffer& linkBuffer) { 50 self-> exit.m_patchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(jump));50 self->m_jitCode->m_osrExit[self->m_index].m_patchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(jump)); 51 51 52 52 linkBuffer.link( -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitHandle.h
r206525 r276224 41 41 // scrape this data from this object by the time compilation finishes. 42 42 struct OSRExitHandle : public ThreadSafeRefCounted<OSRExitHandle> { 43 OSRExitHandle(unsigned index, OSRExit& exit)44 : index(index)45 , exit(exit)43 OSRExitHandle(unsigned index, JITCode* jitCode) 44 : m_index(index) 45 , m_jitCode(jitCode) 46 46 { 47 47 } 48 48 49 unsigned index;50 OSRExit& exit;49 unsigned m_index; 50 JITCode* m_jitCode; 51 51 52 52 // This is the label at which the OSR exit jump lives. This will get populated once the OSR exit -
trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp
r260803 r276224 81 81 RefPtr<OSRExitHandle> handle = createHandle(GenericUnwind, params); 82 82 83 handle-> exit.m_exceptionHandlerCallSiteIndex = callSiteIndex;83 handle->m_jitCode->m_osrExit[handle->m_index].m_exceptionHandlerCallSiteIndex = callSiteIndex; 84 84 85 85 HandlerInfo handler = m_handler;
Note:
See TracChangeset
for help on using the changeset viewer.