Changeset 275995 in webkit for trunk/Source/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Apr 14, 2021, 8:29:18 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JIT.cpp
r275840 r275995 715 715 } 716 716 717 if (m_codeBlock->numberOfUnlinkedSwitchJumpTables() || m_codeBlock->numberOfUnlinkedStringSwitchJumpTables()) { 718 ConcurrentJSLocker locker(m_codeBlock->m_lock); 719 if (m_codeBlock->numberOfUnlinkedSwitchJumpTables()) 720 m_codeBlock->ensureJITData(locker).m_switchJumpTables = FixedVector<SimpleJumpTable>(m_codeBlock->numberOfUnlinkedSwitchJumpTables()); 721 if (m_codeBlock->numberOfUnlinkedStringSwitchJumpTables()) 722 m_codeBlock->ensureJITData(locker).m_stringSwitchJumpTables = FixedVector<StringJumpTable>(m_codeBlock->numberOfUnlinkedStringSwitchJumpTables()); 723 } 724 717 725 if (UNLIKELY(Options::dumpDisassembly() || (m_vm->m_perBytecodeProfiler && Options::disassembleBaselineForProfiler()))) 718 726 m_disassembler = makeUnique<JITDisassembler>(m_codeBlock); … … 858 866 return CompilationFailed; 859 867 860 if (m_codeBlock->numberOfUnlinkedStringSwitchJumpTables()) {861 ConcurrentJSLocker locker(m_codeBlock->m_lock);862 m_codeBlock->ensureJITData(locker).m_stringSwitchJumpTables = FixedVector<StringJumpTable>(m_codeBlock->numberOfUnlinkedStringSwitchJumpTables());863 }864 865 868 // Translate vPC offsets into addresses in JIT generated code, for switch tables. 866 869 for (auto& record : m_switches) { … … 869 872 if (record.type != SwitchRecord::String) { 870 873 ASSERT(record.type == SwitchRecord::Immediate || record.type == SwitchRecord::Character); 871 ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size()); 872 873 auto* simpleJumpTable = record.jumpTable.simpleJumpTable; 874 simpleJumpTable->ctiDefault = patchBuffer.locationOf<JSSwitchPtrTag>(m_labels[bytecodeOffset + record.defaultOffset]); 875 876 for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) { 877 unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j]; 878 simpleJumpTable->ctiOffsets[j] = offset 874 875 unsigned tableIndex = record.tableIndex; 876 const UnlinkedSimpleJumpTable& unlinkedTable = m_codeBlock->unlinkedSwitchJumpTable(tableIndex); 877 SimpleJumpTable& linkedTable = m_codeBlock->switchJumpTable(tableIndex); 878 linkedTable.m_ctiDefault = patchBuffer.locationOf<JSSwitchPtrTag>(m_labels[bytecodeOffset + record.defaultOffset]); 879 880 for (unsigned j = 0; j < unlinkedTable.m_branchOffsets.size(); ++j) { 881 unsigned offset = unlinkedTable.m_branchOffsets[j]; 882 linkedTable.m_ctiOffsets[j] = offset 879 883 ? patchBuffer.locationOf<JSSwitchPtrTag>(m_labels[bytecodeOffset + offset]) 880 : simpleJumpTable->ctiDefault;884 : linkedTable.m_ctiDefault; 881 885 } 882 886 } else { 883 887 ASSERT(record.type == SwitchRecord::String); 884 888 885 unsigned tableIndex = record. jumpTable.tableIndex;889 unsigned tableIndex = record.tableIndex; 886 890 const UnlinkedStringJumpTable& unlinkedTable = m_codeBlock->unlinkedStringSwitchJumpTable(tableIndex); 887 891 StringJumpTable& linkedTable = m_codeBlock->stringSwitchJumpTable(tableIndex);
Note:
See TracChangeset
for help on using the changeset viewer.