Changeset 293009 in webkit
- Timestamp:
- Apr 19, 2022, 1:06:44 AM (3 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r292978 r293009 1 2022-04-18 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Use constants buffer in DFG 4 https://bugs.webkit.org/show_bug.cgi?id=237863 5 6 Reviewed by Saam Barati. 7 8 This patch newly introduces LinkableConstant concept. We replace TrustedImmPtr::weakPointer with 9 that, and it can be switched between two modes: (1) just embedding a constant pointer in machine code 10 or (2) emitting a load from specific callee-save register. We use (2) for unlinked DFG code so that 11 we can start decoupling constants from machine code, which will be separately allocated as DFG constant buffer. 12 To introduce this mechanism, we introduce CCallHelpers::ConstantMaterializer concept, which can be used 13 to materialize constant in a specified way in CCallHelpers. And we use this to implement DFG LinkableConstant. 14 15 We also avoid embedding global object pointer in the tail call by modifying CallFrameShuffler to save it. 16 17 * assembler/MacroAssemblerARM64.h: 18 (JSC::MacroAssemblerARM64::transfer64): 19 (JSC::MacroAssemblerARM64::transferPtr): 20 (JSC::MacroAssemblerARM64::branch64): 21 (JSC::MacroAssemblerARM64::branchPtr): 22 * assembler/MacroAssemblerRISCV64.h: 23 (JSC::MacroAssemblerRISCV64::transfer64): 24 (JSC::MacroAssemblerRISCV64::transferPtr): 25 (JSC::MacroAssemblerRISCV64::branch64): 26 (JSC::MacroAssemblerRISCV64::branchPtr): 27 * assembler/MacroAssemblerX86_64.h: 28 (JSC::MacroAssemblerX86_64::transfer64): 29 (JSC::MacroAssemblerX86_64::transferPtr): 30 (JSC::MacroAssemblerX86_64::branch64): 31 (JSC::MacroAssemblerX86_64::branchPtr): 32 * bytecode/CodeBlock.cpp: 33 (JSC::CodeBlock::setupWithUnlinkedBaselineCode): 34 (JSC::CodeBlock::~CodeBlock): 35 (JSC::CodeBlock::propagateTransitions): 36 (JSC::CodeBlock::finalizeJITInlineCaches): 37 (JSC::CodeBlock::getICStatusMap): 38 (JSC::CodeBlock::findStubInfo): 39 (JSC::CodeBlock::resetBaselineJITData): 40 (JSC::CodeBlock::stronglyVisitStrongReferences): 41 (JSC::CodeBlock::findPC): 42 * bytecode/CodeBlock.h: 43 (JSC::CodeBlock::offsetOfJITData): 44 (JSC::CodeBlock::baselineJITData): 45 (JSC::CodeBlock::setDFGJITData): 46 (JSC::CodeBlock::dfgJITData): 47 (JSC::CodeBlock::offsetOfBaselineJITData): Deleted. 48 * dfg/DFGCallArrayAllocatorSlowPathGenerator.h: 49 * dfg/DFGJITCode.h: 50 * dfg/DFGJITCompiler.cpp: 51 (JSC::DFG::JITCompiler::compileSetupRegistersForEntry): 52 (JSC::DFG::JITCompiler::compileFunction): 53 (JSC::DFG::JITCompiler::loadLinkableConstant): 54 (JSC::DFG::JITCompiler::storeLinkableConstant): 55 (JSC::DFG::JITCompiler::LinkableConstant::LinkableConstant): 56 (JSC::DFG::JITCompiler::LinkableConstant::materialize): 57 (JSC::DFG::JITCompiler::LinkableConstant::store): 58 * dfg/DFGJITCompiler.h: 59 (JSC::DFG::JITCompiler::branchLinkableConstant): 60 (JSC::DFG::JITCompiler::branchWeakPtr): Deleted. 61 * dfg/DFGJITFinalizer.cpp: 62 (JSC::DFG::JITFinalizer::finalize): 63 * dfg/DFGPlan.cpp: 64 (JSC::DFG::Plan::addLinkableConstant): 65 (JSC::DFG::Plan::finalizeJITData): 66 * dfg/DFGPlan.h: 67 * dfg/DFGSaneStringGetByValSlowPathGenerator.h: 68 * dfg/DFGSpeculativeJIT.cpp: 69 (JSC::DFG::SpeculativeJIT::emitGetCallee): 70 (JSC::DFG::SpeculativeJIT::silentFill): 71 (JSC::DFG::SpeculativeJIT::compileDeleteById): 72 (JSC::DFG::SpeculativeJIT::compileDeleteByVal): 73 (JSC::DFG::SpeculativeJIT::compileInById): 74 (JSC::DFG::SpeculativeJIT::compileInByVal): 75 (JSC::DFG::SpeculativeJIT::compileHasPrivate): 76 (JSC::DFG::SpeculativeJIT::compilePushWithScope): 77 (JSC::DFG::SpeculativeJIT::compileStringSlice): 78 (JSC::DFG::SpeculativeJIT::compileToLowerCase): 79 (JSC::DFG::SpeculativeJIT::compileCurrentBlock): 80 (JSC::DFG::SpeculativeJIT::compileCheckTraps): 81 (JSC::DFG::SpeculativeJIT::compileContiguousPutByVal): 82 (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): 83 (JSC::DFG::SpeculativeJIT::compilePutByVal): 84 (JSC::DFG::SpeculativeJIT::compileGetByValOnString): 85 (JSC::DFG::SpeculativeJIT::compileFromCharCode): 86 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): 87 * dfg/DFGSpeculativeJIT.h: 88 (JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr): 89 (JSC::DFG::SpeculativeJIT::callOperationWithCallFrameRollbackOnException): 90 (JSC::DFG::SpeculativeJIT::branchLinkableConstant): 91 (JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPointer): Deleted. 92 * dfg/DFGSpeculativeJIT32_64.cpp: 93 (JSC::DFG::SpeculativeJIT::cachedGetById): 94 (JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis): 95 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined): 96 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined): 97 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): 98 (JSC::DFG::SpeculativeJIT::genericJSValueNonPeepholeStrictEq): 99 (JSC::DFG::SpeculativeJIT::emitCall): 100 (JSC::DFG::SpeculativeJIT::compileToBooleanObjectOrOther): 101 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): 102 (JSC::DFG::SpeculativeJIT::compileGetByVal): 103 (JSC::DFG::SpeculativeJIT::compile): 104 (JSC::DFG::SpeculativeJIT::compileArithRandom): 105 * dfg/DFGSpeculativeJIT64.cpp: 106 (JSC::DFG::SpeculativeJIT::cachedGetById): 107 (JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis): 108 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined): 109 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined): 110 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): 111 (JSC::DFG::SpeculativeJIT::genericJSValueNonPeepholeStrictEq): 112 (JSC::DFG::SpeculativeJIT::emitCall): 113 (JSC::DFG::SpeculativeJIT::compileCompareEqPtr): 114 (JSC::DFG::SpeculativeJIT::compileToBooleanObjectOrOther): 115 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): 116 (JSC::DFG::SpeculativeJIT::emitUntypedBranch): 117 (JSC::DFG::SpeculativeJIT::compileGetByVal): 118 (JSC::DFG::SpeculativeJIT::compileRegExpTestInline): 119 (JSC::DFG::SpeculativeJIT::compile): 120 * dfg/DFGThunks.cpp: 121 (JSC::DFG::osrEntryThunkGenerator): 122 * jit/AssemblyHelpers.cpp: 123 (JSC::AssemblyHelpers::executableFor): Deleted. 124 * jit/AssemblyHelpers.h: 125 (JSC::AssemblyHelpers::globalObjectFor): Deleted. 126 * jit/CCallHelpers.h: 127 (JSC::CCallHelpers::pokeForArgument): 128 (JSC::CCallHelpers::setupArgumentsImpl): 129 * jit/GPRInfo.h: 130 (JSC::GPRInfo::toRegister): 131 * jit/JIT.cpp: 132 (JSC::JIT::privateCompileMainPass): 133 (JSC::JIT::emitMaterializeMetadataAndConstantPoolRegisters): 134 (JSC::JIT::consistencyCheckGenerator): 135 * jit/JITOpcodes.cpp: 136 (JSC::JIT::emit_op_catch): 137 * jit/JITOperations.cpp: 138 (JSC::JSC_DEFINE_JIT_OPERATION): 139 * jit/JITOperations.h: 140 * jit/RegisterSet.cpp: 141 (JSC::RegisterSet::llintBaselineCalleeSaveRegisters): 142 (JSC::RegisterSet::dfgCalleeSaveRegisters): 143 (JSC::RegisterSet::ftlCalleeSaveRegisters): 144 * llint/LLIntData.h: 145 * llint/LowLevelInterpreter.asm: 146 * runtime/JSGlobalObject.h: 147 (JSC::JSGlobalObject::offsetOfGlobalThis): 148 1 149 2022-04-18 Mark Lam <mark.lam@apple.com> 2 150 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
r292540 r293009 1963 1963 } 1964 1964 1965 void transfer64(Address src, Address dest) 1966 { 1967 load64(src, getCachedDataTempRegisterIDAndInvalidate()); 1968 store64(getCachedDataTempRegisterIDAndInvalidate(), dest); 1969 } 1970 1971 void transferPtr(Address src, Address dest) 1972 { 1973 transfer64(src, dest); 1974 } 1975 1965 1976 DataLabel32 store64WithAddressOffsetPatch(RegisterID src, Address address) 1966 1977 { … … 3345 3356 load64(left, getCachedMemoryTempRegisterIDAndInvalidate()); 3346 3357 return branch64(cond, memoryTempRegister, right); 3358 } 3359 3360 Jump branch64(RelationalCondition cond, Address left, Address right) 3361 { 3362 // load64 clobbers memoryTempRegister, thus we should first use dataTempRegister here. 3363 load64(left, getCachedDataTempRegisterIDAndInvalidate()); 3364 // And branch64 will use memoryTempRegister to load right to a register. 3365 return branch64(cond, dataTempRegister, right); 3366 } 3367 3368 Jump branchPtr(RelationalCondition cond, Address left, Address right) 3369 { 3370 return branch64(cond, left, right); 3347 3371 } 3348 3372 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h
r292540 r293009 1174 1174 } 1175 1175 1176 void transfer64(Address src, Address dest) 1177 { 1178 auto temp = temps<Data>(); 1179 load64(src, temp.data()); 1180 store64(temp.data(), dest); 1181 } 1182 1183 void transferPtr(Address src, Address dest) 1184 { 1185 transfer64(src, dest); 1186 } 1187 1176 1188 void storePair32(RegisterID src1, RegisterID src2, RegisterID dest) 1177 1189 { … … 2157 2169 } 2158 2170 2171 Jump branch64(RelationalCondition cond, Address left, Address right) 2172 { 2173 auto temp = temps<Data, Memory>(); 2174 auto leftResolution = resolveAddress(left, temp.memory()); 2175 m_assembler.ldInsn(temp.data(), leftResolution.base, Imm::I(leftResolution.offset)); 2176 auto rightResolution = resolveAddress(right, temp.memory()); 2177 m_assembler.ldInsn(temp.memory(), rightResolution.base, Imm::I(rightResolution.offset)); 2178 return makeBranch(cond, temp.data(), temp.memory()); 2179 } 2180 2159 2181 Jump branch32WithUnalignedHalfWords(RelationalCondition cond, BaseIndex address, TrustedImm32 imm) 2160 2182 { … … 2646 2668 { 2647 2669 return branch64(cond, address, rhs); 2670 } 2671 2672 Jump branchPtr(RelationalCondition cond, Address left, Address right) 2673 { 2674 return branch64(cond, left, right); 2648 2675 } 2649 2676 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
r290647 r293009 1027 1027 m_assembler.movq_rm(scratchRegister(), address.offset, address.base, address.index, address.scale); 1028 1028 } 1029 1030 void transfer64(Address src, Address dest) 1031 { 1032 load64(src, scratchRegister()); 1033 store64(scratchRegister(), dest); 1034 } 1035 1036 void transferPtr(Address src, Address dest) 1037 { 1038 transfer64(src, dest); 1039 } 1029 1040 1030 1041 DataLabel32 store64WithAddressOffsetPatch(RegisterID src, Address address) … … 1135 1146 return Jump(m_assembler.jCC(x86Condition(cond))); 1136 1147 } 1148 1149 Jump branch64(RelationalCondition cond, Address left, Address right) 1150 { 1151 load64(right, scratchRegister()); 1152 return branch64(cond, left, scratchRegister()); 1153 } 1137 1154 1138 1155 Jump branch32(RelationalCondition cond, AbsoluteAddress left, RegisterID right) … … 1151 1168 move(right, scratchRegister()); 1152 1169 return branchPtr(cond, left, scratchRegister()); 1170 } 1171 1172 Jump branchPtr(RelationalCondition cond, Address left, Address right) 1173 { 1174 return branch64(cond, left, right); 1153 1175 } 1154 1176 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r292929 r293009 774 774 { 775 775 ConcurrentJSLocker locker(m_lock); 776 ASSERT(!m_ baselineJITData);777 m_baselineJITData = BaselineJITData::create(jitCode->m_constantPool.size());778 m_baselineJITData->m_stubInfos = FixedVector<StructureStubInfo>(jitCode->m_unlinkedStubInfos.size());776 ASSERT(!m_jitData); 777 auto baselineJITData = BaselineJITData::create(jitCode->m_constantPool.size()); 778 baselineJITData->m_stubInfos = FixedVector<StructureStubInfo>(jitCode->m_unlinkedStubInfos.size()); 779 779 for (auto& unlinkedCallLinkInfo : jitCode->m_unlinkedCalls) { 780 780 CallLinkInfo* callLinkInfo = getCallLinkInfoForBytecodeIndex(locker, unlinkedCallLinkInfo.bytecodeIndex); … … 787 787 switch (entry.type()) { 788 788 case JITConstantPool::Type::GlobalObject: 789 m_baselineJITData->at(i) = m_globalObject.get();789 baselineJITData->at(i) = m_globalObject.get(); 790 790 break; 791 791 case JITConstantPool::Type::StructureStubInfo: { 792 792 unsigned index = bitwise_cast<uintptr_t>(entry.pointer()); 793 793 UnlinkedStructureStubInfo& unlinkedStubInfo = jitCode->m_unlinkedStubInfos[index]; 794 StructureStubInfo& stubInfo = m_baselineJITData->m_stubInfos[index];794 StructureStubInfo& stubInfo = baselineJITData->m_stubInfos[index]; 795 795 stubInfo.initializeFromUnlinkedStructureStubInfo(this, unlinkedStubInfo); 796 m_baselineJITData->at(i) = &stubInfo;796 baselineJITData->at(i) = &stubInfo; 797 797 break; 798 798 } 799 799 case JITConstantPool::Type::FunctionDecl: { 800 800 unsigned index = bitwise_cast<uintptr_t>(entry.pointer()); 801 m_baselineJITData->at(i) = functionDecl(index);801 baselineJITData->at(i) = functionDecl(index); 802 802 break; 803 803 } 804 804 case JITConstantPool::Type::FunctionExpr: { 805 805 unsigned index = bitwise_cast<uintptr_t>(entry.pointer()); 806 m_baselineJITData->at(i) = functionExpr(index);806 baselineJITData->at(i) = functionExpr(index); 807 807 break; 808 808 } 809 809 } 810 810 } 811 m_jitData = baselineJITData.release(); 811 812 } 812 813 … … 893 894 894 895 #if ENABLE(JIT) 895 if (auto* jitData = m_baselineJITData.get()) {896 for (auto& stubInfo : jitData->m_stubInfos) {897 stubInfo.aboutToDie();898 stubInfo.deref();899 } 900 }896 auto handleStubInfo = [&](StructureStubInfo& stubInfo) { 897 stubInfo.aboutToDie(); 898 stubInfo.deref(); 899 }; 900 901 if (JITCode::isOptimizingJIT(jitType())) { 901 902 #if ENABLE(DFG_JIT) 902 if (JITCode::isOptimizingJIT(jitType())) { 903 for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) { 904 stubInfo->aboutToDie(); 905 stubInfo->deref(); 906 } 907 } 908 #endif 903 for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) 904 handleStubInfo(*stubInfo); 905 if (m_jitData) 906 delete bitwise_cast<DFG::JITData*>(m_jitData); 907 #endif 908 } else { 909 if (auto* jitData = baselineJITData()) { 910 for (auto& stubInfo : jitData->m_stubInfos) 911 handleStubInfo(stubInfo); 912 delete jitData; 913 } 914 } 909 915 #endif // ENABLE(JIT) 910 916 } … … 1234 1240 1235 1241 #if ENABLE(JIT) 1236 if (JITCode::isJIT(jitType())) { 1237 if (auto* jitData = m_baselineJITData.get()) { 1242 auto handleStubInfo = [&](StructureStubInfo& stubInfo) { 1243 stubInfo.propagateTransitions(visitor); 1244 }; 1245 1246 if (JITCode::isOptimizingJIT(jitType())) { 1247 #if ENABLE(DFG_JIT) 1248 for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) 1249 handleStubInfo(*stubInfo); 1250 #endif 1251 } else { 1252 if (auto* jitData = baselineJITData()) { 1238 1253 for (auto& stubInfo : jitData->m_stubInfos) 1239 stubInfo.propagateTransitions(visitor); 1240 } 1241 } 1242 #if ENABLE(DFG_JIT) 1243 if (JITCode::isOptimizingJIT(jitType())) { 1244 for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) 1245 stubInfo->propagateTransitions(visitor); 1246 } 1247 #endif 1254 handleStubInfo(stubInfo); 1255 } 1256 } 1248 1257 #endif // ENABLE(JIT) 1249 1258 … … 1571 1580 void CodeBlock::finalizeJITInlineCaches() 1572 1581 { 1573 if (auto* jitData = m_baselineJITData.get()) { 1574 for (auto& stubInfo : jitData->m_stubInfos) { 1575 ConcurrentJSLockerBase locker(NoLockingNecessary); 1576 stubInfo.visitWeakReferences(locker, this); 1577 } 1578 } 1579 1582 auto handleStubInfo = [&](StructureStubInfo& stubInfo) { 1583 ConcurrentJSLockerBase locker(NoLockingNecessary); 1584 stubInfo.visitWeakReferences(locker, this); 1585 }; 1586 1587 if (JITCode::isOptimizingJIT(jitType())) { 1580 1588 #if ENABLE(DFG_JIT) 1581 if (JITCode::isOptimizingJIT(jitType())) {1582 1589 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 1583 1590 for (auto* callLinkInfo : dfgCommon->m_callLinkInfos) 1584 1591 callLinkInfo->visitWeak(vm()); 1585 for (auto* stubInfo : dfgCommon->m_stubInfos) { 1586 ConcurrentJSLockerBase locker(NoLockingNecessary); 1587 stubInfo->visitWeakReferences(locker, this); 1588 } 1589 } 1590 #endif 1592 for (auto* stubInfo : dfgCommon->m_stubInfos) 1593 handleStubInfo(*stubInfo); 1594 #endif 1595 } else { 1596 if (auto* jitData = baselineJITData()) { 1597 for (auto& stubInfo : jitData->m_stubInfos) 1598 handleStubInfo(stubInfo); 1599 } 1600 } 1591 1601 } 1592 1602 #endif … … 1675 1685 #if ENABLE(JIT) 1676 1686 if (JITCode::isJIT(jitType())) { 1677 if (auto* jitData = m_baselineJITData.get()) { 1678 for (auto& stubInfo : jitData->m_stubInfos) 1679 result.add(stubInfo.codeOrigin, ICStatus()).iterator->value.stubInfo = &stubInfo; 1680 } 1687 if (JITCode::isOptimizingJIT(jitType())) { 1681 1688 #if ENABLE(DFG_JIT) 1682 if (JITCode::isOptimizingJIT(jitType())) {1683 1689 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 1684 1690 for (auto* stubInfo : dfgCommon->m_stubInfos) … … 1696 1702 for (auto& pair : dfgCommon->recordedStatuses.deletes) 1697 1703 result.add(pair.first, ICStatus()).iterator->value.deleteStatus = pair.second.get(); 1698 } 1699 #endif 1704 #endif 1705 } else { 1706 if (auto* jitData = baselineJITData()) { 1707 for (auto& stubInfo : jitData->m_stubInfos) 1708 result.add(stubInfo.codeOrigin, ICStatus()).iterator->value.stubInfo = &stubInfo; 1709 } 1710 } 1700 1711 } 1701 1712 #else … … 1714 1725 { 1715 1726 ConcurrentJSLocker locker(m_lock); 1716 if (auto* jitData = m_baselineJITData.get()) { 1717 for (auto& stubInfo : jitData->m_stubInfos) { 1718 if (stubInfo.codeOrigin == codeOrigin) 1719 return &stubInfo; 1720 } 1721 } 1722 1727 if (JITCode::isOptimizingJIT(jitType())) { 1723 1728 #if ENABLE(DFG_JIT) 1724 if (JITCode::isOptimizingJIT(jitType())) {1725 1729 for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) { 1726 1730 if (stubInfo->codeOrigin == codeOrigin) 1727 1731 return stubInfo; 1728 1732 } 1729 } 1730 #endif 1733 #endif 1734 } else { 1735 if (auto* jitData = baselineJITData()) { 1736 for (auto& stubInfo : jitData->m_stubInfos) { 1737 if (stubInfo.codeOrigin == codeOrigin) 1738 return &stubInfo; 1739 } 1740 } 1741 } 1731 1742 return nullptr; 1732 1743 } … … 1767 1778 ConcurrentJSLocker locker(m_lock); 1768 1779 1769 if (auto* jitData = m_baselineJITData.get()) {1780 if (auto* jitData = baselineJITData()) { 1770 1781 // We can clear these because no other thread will have references to any stub infos, call 1771 1782 // link infos, or by val infos if we don't have JIT code. Attempts to query these data … … 1788 1799 // there is JIT code. 1789 1800 1790 m_ baselineJITData = nullptr;1801 m_jitData = nullptr; 1791 1802 } 1792 1803 } … … 1834 1845 1835 1846 #if ENABLE(JIT) 1836 if (auto* jitData = m_baselineJITData.get()) { 1837 for (auto& stubInfo : jitData->m_stubInfos) 1838 stubInfo.visitAggregate(visitor); 1839 } 1840 #endif 1841 1847 auto handleStubInfo = [&](StructureStubInfo& stubInfo) { 1848 stubInfo.visitAggregate(visitor); 1849 }; 1850 1851 if (JITCode::isOptimizingJIT(jitType())) { 1842 1852 #if ENABLE(DFG_JIT) 1843 if (JITCode::isOptimizingJIT(jitType())) {1844 1853 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 1845 1854 for (auto* stubInfo : dfgCommon->m_stubInfos) 1846 stubInfo->visitAggregate(visitor);1855 handleStubInfo(*stubInfo); 1847 1856 dfgCommon->recordedStatuses.visitAggregate(visitor); 1848 1857 visitOSRExitTargets(locker, visitor); 1858 #endif 1859 } else { 1860 if (auto* jitData = baselineJITData()) { 1861 for (auto& stubInfo : jitData->m_stubInfos) 1862 handleStubInfo(stubInfo); 1863 } 1849 1864 } 1850 1865 #endif … … 3463 3478 { 3464 3479 ConcurrentJSLocker locker(m_lock); 3465 if (auto* jitData = m_baselineJITData.get()) { 3466 for (auto& stubInfo : jitData->m_stubInfos) { 3467 if (stubInfo.containsPC(pc)) 3468 return stubInfo.codeOrigin; 3469 } 3470 } 3480 if (JITCode::isOptimizingJIT(jitType())) { 3471 3481 #if ENABLE(DFG_JIT) 3472 if (JITCode::isOptimizingJIT(jitType())) {3473 3482 DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); 3474 3483 for (auto* stubInfo : dfgCommon->m_stubInfos) { … … 3476 3485 return stubInfo->codeOrigin; 3477 3486 } 3478 } 3479 #endif 3487 #endif 3488 } else { 3489 if (auto* jitData = baselineJITData()) { 3490 for (auto& stubInfo : jitData->m_stubInfos) { 3491 if (stubInfo.containsPC(pc)) 3492 return stubInfo.codeOrigin; 3493 } 3494 } 3495 } 3480 3496 } 3481 3497 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r292191 r293009 80 80 #if ENABLE(DFG_JIT) 81 81 namespace DFG { 82 class JITData; 82 83 struct OSRExitState; 83 84 } // namespace DFG … … 246 247 std::optional<BytecodeIndex> bytecodeIndexFromCallSiteIndex(CallSiteIndex); 247 248 248 // Because we might throw out baseline JIT code and all its baseline JIT data (m_ baselineJITData),249 // Because we might throw out baseline JIT code and all its baseline JIT data (m_jitData), 249 250 // you need to be careful about the lifetime of when you use the return value of this function. 250 251 // The return value may have raw pointers into this data structure that gets thrown away. … … 257 258 void setupWithUnlinkedBaselineCode(Ref<BaselineJITCode>); 258 259 259 static ptrdiff_t offsetOf BaselineJITData() { return OBJECT_OFFSETOF(CodeBlock, m_baselineJITData); }260 static ptrdiff_t offsetOfJITData() { return OBJECT_OFFSETOF(CodeBlock, m_jitData); } 260 261 261 262 StructureStubInfo* addOptimizingStubInfo(AccessType, CodeOrigin); … … 531 532 BaselineJITData* baselineJITData() 532 533 { 533 RELEASE_ASSERT(jitType() == JITType::BaselineJIT); 534 return m_baselineJITData.get(); 535 } 534 if (!JITCode::isOptimizingJIT(jitType())) 535 return bitwise_cast<BaselineJITData*>(m_jitData); 536 return nullptr; 537 } 538 539 #if ENABLE(DFG_JIT) 540 void setDFGJITData(std::unique_ptr<DFG::JITData>&& jitData) 541 { 542 ASSERT(!m_jitData); 543 m_jitData = jitData.release(); 544 } 545 546 DFG::JITData* dfgJITData() 547 { 548 if (JITCode::isOptimizingJIT(jitType())) 549 return bitwise_cast<DFG::JITData*>(m_jitData); 550 return nullptr; 551 } 552 #endif 536 553 #endif 537 554 size_t numberOfUnlinkedSwitchJumpTables() const { return m_unlinkedCode->numberOfUnlinkedSwitchJumpTables(); } … … 934 951 #if ENABLE(JIT) 935 952 public: 936 std::unique_ptr<BaselineJITData> m_baselineJITData;953 void* m_jitData { nullptr }; 937 954 private: 938 955 #endif -
trunk/Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h
r292445 r293009 76 76 CallArrayAllocatorWithVariableSizeSlowPathGenerator( 77 77 MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_GStZB function, 78 GPRReg resultGPR, CCallHelpers::TrustedImmPtrglobalObject, RegisteredStructure contiguousStructure, RegisteredStructure arrayStorageStructure, GPRReg sizeGPR, GPRReg storageGPR)78 GPRReg resultGPR, JITCompiler::LinkableConstant globalObject, RegisteredStructure contiguousStructure, RegisteredStructure arrayStorageStructure, GPRReg sizeGPR, GPRReg storageGPR) 79 79 : JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit) 80 80 , m_function(function) … … 116 116 RegisteredStructure m_arrayStorageOrContiguousStructure; 117 117 GPRReg m_resultGPR; 118 CCallHelpers::TrustedImmPtrm_globalObject;118 JITCompiler::LinkableConstant m_globalObject; 119 119 GPRReg m_sizeGPR; 120 120 GPRReg m_storageGPR; … … 126 126 CallArrayAllocatorWithVariableStructureVariableSizeSlowPathGenerator( 127 127 MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_GStZB function, 128 GPRReg resultGPR, CCallHelpers::TrustedImmPtrglobalObject, GPRReg structureGPR, GPRReg sizeGPR, GPRReg storageGPR)128 GPRReg resultGPR, JITCompiler::LinkableConstant globalObject, GPRReg structureGPR, GPRReg sizeGPR, GPRReg storageGPR) 129 129 : JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit) 130 130 , m_function(function) … … 153 153 P_JITOperation_GStZB m_function; 154 154 GPRReg m_resultGPR; 155 CCallHelpers::TrustedImmPtrm_globalObject;155 JITCompiler::LinkableConstant m_globalObject; 156 156 GPRReg m_structureGPR; 157 157 GPRReg m_sizeGPR; -
trunk/Source/JavaScriptCore/dfg/DFGJITCode.h
r283139 r293009 49 49 50 50 class JITCompiler; 51 52 class JITData final : public TrailingArray<JITData, void*> { 53 WTF_MAKE_FAST_ALLOCATED; 54 friend class LLIntOffsetsExtractor; 55 public: 56 using Base = TrailingArray<JITData, void*>; 57 58 static std::unique_ptr<JITData> create(unsigned poolSize) 59 { 60 return std::unique_ptr<JITData> { new (NotNull, fastMalloc(Base::allocationSize(poolSize))) JITData(poolSize) }; 61 } 62 63 explicit JITData(unsigned size) 64 : Base(size) 65 { 66 } 67 }; 51 68 52 69 class JITCode final : public DirectJITCode { -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r292447 r293009 119 119 emitSaveCalleeSaves(); 120 120 emitMaterializeTagCheckRegisters(); 121 #if USE(JSVALUE64) 122 if (m_graph.m_plan.isUnlinked()) { 123 emitGetFromCallFrameHeaderPtr(CallFrameSlot::codeBlock, GPRInfo::constantsRegister); 124 loadPtr(Address(GPRInfo::constantsRegister, CodeBlock::offsetOfJITData()), GPRInfo::constantsRegister); 125 } 126 #endif 121 127 } 122 128 … … 436 442 if (maxFrameExtentForSlowPathCall) 437 443 addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister); 438 m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->isConstructor() ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::regT0, m_codeBlock->globalObject()); 444 emitGetFromCallFrameHeaderPtr(CallFrameSlot::codeBlock, GPRInfo::argumentGPR0); 445 loadPtr(Address(GPRInfo::argumentGPR0, CodeBlock::offsetOfGlobalObject()), GPRInfo::argumentGPR0); 446 m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->isConstructor() ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::returnValueGPR, GPRInfo::argumentGPR0); 439 447 if (maxFrameExtentForSlowPathCall) 440 448 addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister); … … 647 655 } 648 656 657 void JITCompiler::loadLinkableConstant(LinkableConstant constant, GPRReg dest) 658 { 659 constant.materialize(*this, dest); 660 } 661 662 void JITCompiler::storeLinkableConstant(LinkableConstant constant, Address dest) 663 { 664 constant.store(*this, dest); 665 } 666 667 JITCompiler::LinkableConstant::LinkableConstant(Graph& graph, JSCell* cell) 668 { 669 graph.m_plan.weakReferences().addLazily(cell); 670 if (graph.m_plan.isUnlinked()) { 671 m_index = graph.m_plan.addLinkableConstant(cell); 672 return; 673 } 674 m_pointer = cell; 675 } 676 677 JITCompiler::LinkableConstant::LinkableConstant(Graph& graph, void* pointer, NonCellTag) 678 { 679 if (graph.m_plan.isUnlinked()) { 680 m_index = graph.m_plan.addLinkableConstant(pointer); 681 return; 682 } 683 m_pointer = pointer; 684 } 685 686 void JITCompiler::LinkableConstant::materialize(CCallHelpers& jit, GPRReg resultGPR) 687 { 688 #if USE(JSVALUE64) 689 if (isUnlinked()) { 690 jit.loadPtr(unlinkedAddress(), resultGPR); 691 return; 692 } 693 #endif 694 jit.move(TrustedImmPtr(m_pointer), resultGPR); 695 } 696 697 void JITCompiler::LinkableConstant::store(CCallHelpers& jit, CCallHelpers::Address address) 698 { 699 #if USE(JSVALUE64) 700 if (isUnlinked()) { 701 jit.transferPtr(unlinkedAddress(), address); 702 return; 703 } 704 #endif 705 jit.storePtr(TrustedImmPtr(m_pointer), address); 706 } 707 649 708 } } // namespace JSC::DFG 650 709 -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r290647 r293009 257 257 258 258 template<typename T> 259 Jump branchWeakPtr(RelationalCondition cond, T left, JSCell* weakPtr)260 {261 Jump result = branchPtr(cond, left, TrustedImmPtr(weakPtr));262 addWeakReference(weakPtr);263 return result;264 }265 266 template<typename T>267 259 Jump branchWeakStructure(RelationalCondition cond, T left, RegisteredStructure weakStructure) 268 260 { … … 311 303 { 312 304 emitSaveCalleeSavesFor(&RegisterAtOffsetList::dfgCalleeSaveRegisters()); 305 } 306 307 class LinkableConstant final : public CCallHelpers::ConstantMaterializer { 308 public: 309 enum NonCellTag { NonCell }; 310 LinkableConstant(Graph&, JSCell*); 311 312 void materialize(CCallHelpers&, GPRReg); 313 void store(CCallHelpers&, CCallHelpers::Address); 314 315 template<typename T> 316 static LinkableConstant nonCellPointer(Graph& graph, T* pointer) 317 { 318 static_assert(!std::is_base_of_v<JSCell, T>); 319 return LinkableConstant(graph, pointer, NonCell); 320 } 321 322 static LinkableConstant structure(Graph& graph, RegisteredStructure structure) 323 { 324 return LinkableConstant(graph, structure.get()); 325 } 326 327 bool isUnlinked() const { return m_index != UINT_MAX; } 328 329 void* pointer() const { return m_pointer; } 330 331 #if USE(JSVALUE64) 332 Address unlinkedAddress() 333 { 334 ASSERT(isUnlinked()); 335 return Address(GPRInfo::constantsRegister, JITData::offsetOfData() + sizeof(void*) * m_index); 336 } 337 #endif 338 339 private: 340 LinkableConstant(Graph&, void*, NonCellTag); 341 342 unsigned m_index { UINT_MAX }; 343 void* m_pointer { nullptr }; 344 }; 345 346 void loadLinkableConstant(LinkableConstant, GPRReg); 347 void storeLinkableConstant(LinkableConstant, Address); 348 349 Jump branchLinkableConstant(RelationalCondition cond, GPRReg left, LinkableConstant constant) 350 { 351 #if USE(JSVALUE64) 352 if (constant.isUnlinked()) 353 return CCallHelpers::branchPtr(cond, left, constant.unlinkedAddress()); 354 #endif 355 return CCallHelpers::branchPtr(cond, left, CCallHelpers::TrustedImmPtr(constant.pointer())); 356 } 357 358 Jump branchLinkableConstant(RelationalCondition cond, Address left, LinkableConstant constant) 359 { 360 #if USE(JSVALUE64) 361 if (constant.isUnlinked()) 362 return CCallHelpers::branchPtr(cond, left, constant.unlinkedAddress()); 363 #endif 364 return CCallHelpers::branchPtr(cond, left, CCallHelpers::TrustedImmPtr(constant.pointer())); 313 365 } 314 366 -
trunk/Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp
r285687 r293009 65 65 66 66 codeBlock->setJITCode(m_jitCode.copyRef()); 67 codeBlock->setDFGJITData(m_plan.finalizeJITData()); 67 68 68 69 #if ENABLE(FTL_JIT) -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r291332 r293009 682 682 } 683 683 684 unsigned Plan::addLinkableConstant(void* ptr) 685 { 686 ASSERT(ptr); 687 return m_constantPool.add(ptr, m_constantPool.size()).iterator->value; 688 } 689 690 std::unique_ptr<JITData> Plan::finalizeJITData() 691 { 692 if (m_constantPool.isEmpty()) 693 return nullptr; 694 ASSERT(isUnlinked()); 695 auto jitData = JITData::create(m_constantPool.size()); 696 for (auto& pair : m_constantPool) 697 jitData->at(pair.value) = pair.key; 698 return jitData; 699 } 700 684 701 } } // namespace JSC::DFG 685 702 -
trunk/Source/JavaScriptCore/dfg/DFGPlan.h
r278253 r293009 49 49 50 50 class ThreadData; 51 class JITData; 51 52 52 53 #if ENABLE(DFG_JIT) … … 102 103 void setCallback(Ref<DeferredCompilationCallback>&& callback) { m_callback = WTFMove(callback); } 103 104 105 unsigned addLinkableConstant(void*); 106 std::unique_ptr<JITData> finalizeJITData(); 107 104 108 private: 105 109 CompilationPath compileInThreadImpl() override; … … 135 139 136 140 RefPtr<DeferredCompilationCallback> m_callback; 141 HashMap<void*, unsigned> m_constantPool; 137 142 }; 138 143 -
trunk/Source/JavaScriptCore/dfg/DFGSaneStringGetByValSlowPathGenerator.h
r261569 r293009 38 38 public: 39 39 SaneStringGetByValSlowPathGenerator( 40 const MacroAssembler::Jump& from, SpeculativeJIT* jit, JSValueRegs resultRegs, CCallHelpers::TrustedImmPtrglobalObject, GPRReg baseReg, GPRReg propertyReg)40 const MacroAssembler::Jump& from, SpeculativeJIT* jit, JSValueRegs resultRegs, JITCompiler::LinkableConstant globalObject, GPRReg baseReg, GPRReg propertyReg) 41 41 : JumpingSlowPathGenerator<MacroAssembler::Jump>(from, jit) 42 42 , m_resultRegs(resultRegs) … … 80 80 81 81 JSValueRegs m_resultRegs; 82 CCallHelpers::TrustedImmPtrm_globalObject;82 JITCompiler::LinkableConstant m_globalObject; 83 83 GPRReg m_baseReg; 84 84 GPRReg m_propertyReg; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r292929 r293009 62 62 #include "JSSetIterator.h" 63 63 #include "LLIntThunks.h" 64 #include "ProbeContext.h" 64 65 #include "RegExpObject.h" 65 66 #include "ScopedArguments.h" … … 206 207 JITCompiler::addressFor(inlineCallFrame->calleeRecovery.virtualRegister()), 207 208 calleeGPR); 208 } else { 209 m_jit.move( 210 TrustedImmPtr::weakPointer(m_graph, inlineCallFrame->calleeRecovery.constant().asCell()), 211 calleeGPR); 212 } 209 } else 210 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, inlineCallFrame->calleeRecovery.constant().asCell()), calleeGPR); 213 211 } else 214 212 m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), calleeGPR); … … 687 685 case SetCellConstant: 688 686 ASSERT(plan.node()->constant()->value().isCell()); 689 m_jit. move(TrustedImmPtr(plan.node()->constant()), plan.gpr());687 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, plan.node()->constant()->value().asCell()), plan.gpr()); 690 688 break; 691 689 #if USE(JSVALUE64) … … 1208 1206 slowPath = slowPathICCall( 1209 1207 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationDeleteByIdOptimize, 1210 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, JSValueRegs(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value()));1208 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, JSValueRegs(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value())); 1211 1209 } else { 1212 1210 slowPath = slowPathCall( 1213 1211 slowCases, this, operationDeleteByIdOptimize, 1214 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value()));1212 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value())); 1215 1213 } 1216 1214 #else … … 1219 1217 slowPath = slowPathICCall( 1220 1218 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationDeleteByIdOptimize, 1221 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value()));1219 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value())); 1222 1220 } else { 1223 1221 slowPath = slowPathCall( 1224 1222 slowCases, this, operationDeleteByIdOptimize, 1225 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value()));1223 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value())); 1226 1224 } 1227 1225 #endif … … 1244 1242 GPRFlushedCallResult result(this); 1245 1243 GPRReg resultGPR = result.gpr(); 1246 callOperation(operationDeleteByIdGeneric, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), nullptr, baseRegs, node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value()));1244 callOperation(operationDeleteByIdGeneric, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), nullptr, baseRegs, node->cacheableIdentifier().rawBits(), TrustedImm32(node->ecmaMode().value())); 1247 1245 m_jit.exceptionCheck(); 1248 1246 … … 1294 1292 slowPath = slowPathICCall( 1295 1293 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationDeleteByValOptimize, 1296 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, JSValueRegs(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value()));1294 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, JSValueRegs(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value())); 1297 1295 } else { 1298 1296 slowPath = slowPathCall( 1299 1297 slowCases, this, operationDeleteByValOptimize, 1300 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value()));1298 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value())); 1301 1299 } 1302 1300 #else … … 1305 1303 slowPath = slowPathICCall( 1306 1304 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationDeleteByValOptimize, 1307 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value()));1305 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value())); 1308 1306 } else { 1309 1307 slowPath = slowPathCall( 1310 1308 slowCases, this, operationDeleteByValOptimize, 1311 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value()));1309 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), keyRegs, TrustedImm32(node->ecmaMode().value())); 1312 1310 } 1313 1311 #endif … … 1331 1329 GPRFlushedCallResult result(this); 1332 1330 GPRReg resultGPR = result.gpr(); 1333 callOperation(operationDeleteByValGeneric, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), nullptr, baseRegs, keyRegs, TrustedImm32(node->ecmaMode().value()));1331 callOperation(operationDeleteByValGeneric, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), nullptr, baseRegs, keyRegs, TrustedImm32(node->ecmaMode().value())); 1334 1332 m_jit.exceptionCheck(); 1335 1333 … … 1374 1372 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInByIdOptimize, 1375 1373 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1376 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits());1374 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits()); 1377 1375 } else { 1378 1376 slowPath = slowPathCall( 1379 1377 slowCases, this, operationInByIdOptimize, 1380 1378 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1381 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits());1379 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), node->cacheableIdentifier().rawBits()); 1382 1380 } 1383 1381 … … 1424 1422 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInByValOptimize, 1425 1423 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1426 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, nullptr, CCallHelpers::CellValue(baseGPR), keyRegs);1424 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, nullptr, CCallHelpers::CellValue(baseGPR), keyRegs); 1427 1425 } else { 1428 1426 slowPath = slowPathCall( 1429 1427 slowCases, this, operationInByValOptimize, 1430 1428 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1431 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, CCallHelpers::CellValue(baseGPR), keyRegs);1429 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, CCallHelpers::CellValue(baseGPR), keyRegs); 1432 1430 } 1433 1431 … … 1478 1476 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), type == AccessType::HasPrivateName ? operationHasPrivateNameOptimize : operationHasPrivateBrandOptimize, 1479 1477 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1480 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyOrBrandGPR));1478 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyOrBrandGPR)); 1481 1479 } else { 1482 1480 slowPath = slowPathCall( 1483 1481 slowCases, this, type == AccessType::HasPrivateName ? operationHasPrivateNameOptimize : operationHasPrivateBrandOptimize, 1484 1482 NeedToSpill, ExceptionCheckRequirement::CheckNeeded, 1485 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyOrBrandGPR));1483 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyOrBrandGPR)); 1486 1484 } 1487 1485 … … 1517 1515 1518 1516 flushRegisters(); 1519 callOperation(operationPushWithScopeObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), currentScopeGPR, objectGPR);1517 callOperation(operationPushWithScopeObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), currentScopeGPR, objectGPR); 1520 1518 // No exception check here as we did not have to call toObject(). 1521 1519 } else { … … 1525 1523 1526 1524 flushRegisters(); 1527 callOperation(operationPushWithScope, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), currentScopeGPR, objectRegs);1525 callOperation(operationPushWithScope, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), currentScopeGPR, objectRegs); 1528 1526 m_jit.exceptionCheck(); 1529 1527 } … … 1912 1910 VM& vm = this->vm(); 1913 1911 auto nonEmptyCase = m_jit.branch32(MacroAssembler::Below, startIndexGPR, tempGPR); 1914 m_jit. move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm)), tempGPR);1912 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm)), tempGPR); 1915 1913 doneCases.append(m_jit.jump()); 1916 1914 … … 1944 1942 addSlowPathGenerator(slowPathCall(bigCharacter, this, operationSingleCharacterString, tempGPR, TrustedImmPtr(&vm), tempGPR)); 1945 1943 1946 addSlowPathGenerator(slowPathCall(slowCases, this, operationStringSubstr, tempGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startIndexGPR, tempGPR));1944 addSlowPathGenerator(slowPathCall(slowCases, this, operationStringSubstr, tempGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startIndexGPR, tempGPR)); 1947 1945 1948 1946 if (endGPR) 1949 addSlowPathGenerator(slowPathCall(isRope, this, operationStringSlice, tempGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startGPR, *endGPR));1947 addSlowPathGenerator(slowPathCall(isRope, this, operationStringSlice, tempGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startGPR, *endGPR)); 1950 1948 else 1951 addSlowPathGenerator(slowPathCall(isRope, this, operationStringSlice, tempGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startGPR, TrustedImm32(std::numeric_limits<int32_t>::max())));1949 addSlowPathGenerator(slowPathCall(isRope, this, operationStringSlice, tempGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, startGPR, TrustedImm32(std::numeric_limits<int32_t>::max()))); 1952 1950 1953 1951 doneCases.link(&m_jit); … … 1996 1994 slowPath.link(&m_jit); 1997 1995 silentSpillAllRegisters(lengthGPR); 1998 callOperation(operationToLowerCase, lengthGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, indexGPR);1996 callOperation(operationToLowerCase, lengthGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, indexGPR); 1999 1997 silentFillAllRegisters(); 2000 1998 m_jit.exceptionCheck(); … … 2223 2221 #endif 2224 2222 m_jit.emitMaterializeTagCheckRegisters(); 2223 #if USE(JSVALUE64) 2224 if (m_graph.m_plan.isUnlinked()) { 2225 m_jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::codeBlock, GPRInfo::constantsRegister); 2226 m_jit.loadPtr(CCallHelpers::Address(GPRInfo::constantsRegister, CodeBlock::offsetOfJITData()), GPRInfo::constantsRegister); 2227 } 2228 #endif 2225 2229 } 2226 2230 … … 2503 2507 TrustedImm32(VMTraps::AsyncEvents)); 2504 2508 2505 addSlowPathGenerator(slowPathCall(needTrapHandling, this, operationHandleTraps, unusedGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic))));2509 addSlowPathGenerator(slowPathCall(needTrapHandling, this, operationHandleTraps, unusedGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)))); 2506 2510 noResult(node); 2507 2511 } … … 2568 2572 (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsStrict : operationPutByValBeyondArrayBoundsStrict) : 2569 2573 (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsNonStrict : operationPutByValBeyondArrayBoundsNonStrict), 2570 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueRegs));2574 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueRegs)); 2571 2575 } 2572 2576 … … 2643 2647 (node->op() == PutByValDirect ? operationPutDoubleByValDirectBeyondArrayBoundsStrict : operationPutDoubleByValBeyondArrayBoundsStrict) : 2644 2648 (node->op() == PutByValDirect ? operationPutDoubleByValDirectBeyondArrayBoundsNonStrict : operationPutDoubleByValBeyondArrayBoundsNonStrict), 2645 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueReg));2649 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueReg)); 2646 2650 } 2647 2651 … … 2701 2705 flushRegisters(); 2702 2706 if (node->op() == PutByValDirect) 2703 callOperation(node->ecmaMode().isStrict() ? operationPutByValDirectStrict : operationPutByValDirectNonStrict, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyRegs, valueRegs);2707 callOperation(node->ecmaMode().isStrict() ? operationPutByValDirectStrict : operationPutByValDirectNonStrict, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyRegs, valueRegs); 2704 2708 else 2705 callOperation(node->ecmaMode().isStrict() ? operationPutByValStrict : operationPutByValNonStrict, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyRegs, valueRegs);2709 callOperation(node->ecmaMode().isStrict() ? operationPutByValStrict : operationPutByValNonStrict, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyRegs, valueRegs); 2706 2710 m_jit.exceptionCheck(); 2707 2711 … … 2756 2760 slowPath = slowPathICCall( 2757 2761 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operation, 2758 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), baseRegs, propertyRegs, valueRegs, stubInfoGPR, nullptr);2762 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), baseRegs, propertyRegs, valueRegs, stubInfoGPR, nullptr); 2759 2763 } else { 2760 2764 slowPath = slowPathCall( 2761 2765 slowCases, this, operation, 2762 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), baseRegs, propertyRegs, valueRegs, TrustedImmPtr(gen.stubInfo()), nullptr);2766 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), baseRegs, propertyRegs, valueRegs, TrustedImmPtr(gen.stubInfo()), nullptr); 2763 2767 } 2764 2768 … … 2851 2855 (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsStrict : operationPutByValBeyondArrayBoundsStrict) : 2852 2856 (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsNonStrict : operationPutByValBeyondArrayBoundsNonStrict), 2853 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueRegs));2857 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueRegs)); 2854 2858 } 2855 2859 … … 2962 2966 #endif 2963 2967 2964 JSGlobalObject* globalObject = m_ jit.globalObjectFor(node->origin.semantic);2968 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic); 2965 2969 Structure* stringPrototypeStructure = globalObject->stringPrototype()->structure(); 2966 2970 Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure(); … … 2978 2982 2979 2983 addSlowPathGenerator(makeUnique<SaneStringGetByValSlowPathGenerator>( 2980 outOfBounds, this, resultRegs, TrustedImmPtr::weakPointer(m_graph, globalObject), baseReg, propertyReg));2984 outOfBounds, this, resultRegs, JITCompiler::LinkableConstant(m_graph, globalObject), baseReg, propertyReg)); 2981 2985 } else { 2982 2986 addSlowPathGenerator( 2983 2987 slowPathCall( 2984 2988 outOfBounds, this, operationGetByValStringInt, 2985 resultRegs, TrustedImmPtr::weakPointer(m_graph, globalObject), baseReg, propertyReg));2989 resultRegs, JITCompiler::LinkableConstant(m_graph, globalObject), baseReg, propertyReg)); 2986 2990 } 2987 2991 … … 3007 3011 JSValueRegsFlushedCallResult result(this); 3008 3012 JSValueRegs resultRegs = result.regs(); 3009 callOperation(operationStringFromCharCodeUntyped, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), oprRegs);3013 callOperation(operationStringFromCharCodeUntyped, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), oprRegs); 3010 3014 m_jit.exceptionCheck(); 3011 3015 … … 3027 3031 3028 3032 slowCases.append(m_jit.branchTest32(MacroAssembler::Zero, scratchReg)); 3029 addSlowPathGenerator(slowPathCall(slowCases, this, operationStringFromCharCode, scratchReg, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), propertyReg));3033 addSlowPathGenerator(slowPathCall(slowCases, this, operationStringFromCharCode, scratchReg, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), propertyReg)); 3030 3034 cellResult(scratchReg, m_currentNode); 3031 3035 } … … 3951 3955 (node->op() == PutByValDirect ? operationPutByValDirectNonStrict : operationPutByValNonStrict), 3952 3956 #if USE(JSVALUE64) 3953 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueGPR));3957 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg, valueGPR)); 3954 3958 #else // not USE(JSVALUE64) 3955 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseReg), JSValueRegs(propertyTagGPR, propertyReg), JSValueRegs(valueTagGPR, valueGPR)));3959 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseReg), JSValueRegs(propertyTagGPR, propertyReg), JSValueRegs(valueTagGPR, valueGPR))); 3956 3960 #endif 3957 3961 } … … 4061 4065 else 4062 4066 flushRegisters(); 4063 callOperation(operationGetByValObjectString, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR);4067 callOperation(operationGetByValObjectString, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR); 4064 4068 if (canUseFlush == CanUseFlush::No) 4065 4069 silentFillAllRegisters(); … … 4088 4092 else 4089 4093 flushRegisters(); 4090 callOperation(operationGetByValObjectSymbol, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR);4094 callOperation(operationGetByValObjectSymbol, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR); 4091 4095 if (canUseFlush == CanUseFlush::No) 4092 4096 silentFillAllRegisters(); … … 4156 4160 return slowPathICCall( 4157 4161 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationGetPrivateNameOptimize, 4158 result.regs(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR,4162 result.regs(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, 4159 4163 base, CCallHelpers::CellValue(property.payloadGPR())); 4160 4164 } 4161 4165 return slowPathCall( 4162 4166 slowCases, this, operationGetPrivateNameOptimize, 4163 result.regs(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()),4167 result.regs(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), 4164 4168 base, CCallHelpers::CellValue(property.payloadGPR())); 4165 4169 }; … … 4249 4253 (node->op() == PutByValDirect ? operationPutByValDirectCellStringStrict : operationPutByValCellStringStrict) : 4250 4254 (node->op() == PutByValDirect ? operationPutByValDirectCellStringNonStrict : operationPutByValCellStringNonStrict), 4251 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR, arg3Regs);4255 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR, arg3Regs); 4252 4256 m_jit.exceptionCheck(); 4253 4257 … … 4272 4276 ? (node->op() == PutByValDirect ? operationPutByValDirectCellSymbolStrict : operationPutByValCellSymbolStrict) 4273 4277 : (node->op() == PutByValDirect ? operationPutByValDirectCellSymbolNonStrict : operationPutByValCellSymbolNonStrict), 4274 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR, arg3Regs);4278 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR, arg3Regs); 4275 4279 m_jit.exceptionCheck(); 4276 4280 … … 4290 4294 JSValueRegsFlushedCallResult result(this); 4291 4295 JSValueRegs resultRegs = result.regs(); 4292 callOperation(operationGetByValWithThis, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisValueRegs, subscriptRegs);4296 callOperation(operationGetByValWithThis, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisValueRegs, subscriptRegs); 4293 4297 m_jit.exceptionCheck(); 4294 4298 … … 4316 4320 flushRegisters(); 4317 4321 auto operation = node->privateFieldPutKind().isDefine() ? operationPutByValDefinePrivateFieldGeneric : operationPutByValSetPrivateFieldGeneric; 4318 callOperation(operation, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, CCallHelpers::CellValue(propertyGPR), valueRegs, TrustedImmPtr(nullptr), TrustedImmPtr(nullptr));4322 callOperation(operation, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, CCallHelpers::CellValue(propertyGPR), valueRegs, TrustedImmPtr(nullptr), TrustedImmPtr(nullptr)); 4319 4323 m_jit.exceptionCheck(); 4320 4324 … … 4360 4364 slowPath = slowPathICCall( 4361 4365 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operation, 4362 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyGPR), valueRegs, stubInfoGPR, nullptr);4366 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyGPR), valueRegs, stubInfoGPR, nullptr); 4363 4367 } else { 4364 4368 slowPath = slowPathCall( 4365 4369 slowCases, this, operation, 4366 NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyGPR), valueRegs, TrustedImmPtr(gen.stubInfo()), nullptr);4370 NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(propertyGPR), valueRegs, TrustedImmPtr(gen.stubInfo()), nullptr); 4367 4371 } 4368 4372 … … 4438 4442 slowPath = slowPathICCall( 4439 4443 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationCheckPrivateBrandOptimize, NoResult, 4440 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseRegs, CCallHelpers::CellValue(brandGPR));4444 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseRegs, CCallHelpers::CellValue(brandGPR)); 4441 4445 } else { 4442 4446 slowPath = slowPathCall( 4443 4447 slowCases, this, operationCheckPrivateBrandOptimize, NoResult, 4444 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseRegs, CCallHelpers::CellValue(brandGPR));4448 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseRegs, CCallHelpers::CellValue(brandGPR)); 4445 4449 } 4446 4450 … … 4486 4490 slowPath = slowPathICCall( 4487 4491 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationSetPrivateBrandOptimize, NoResult, 4488 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(brandGPR));4492 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(brandGPR)); 4489 4493 } else { 4490 4494 slowPath = slowPathCall( 4491 4495 slowCases, this, operationSetPrivateBrandOptimize, NoResult, 4492 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(brandGPR));4496 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), CCallHelpers::CellValue(baseGPR), CCallHelpers::CellValue(brandGPR)); 4493 4497 } 4494 4498 … … 4526 4530 JSValueRegsFlushedCallResult result(this); 4527 4531 JSValueRegs resultRegs = result.regs(); 4528 callOperation(operationParseIntGeneric, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, radixGPR);4532 callOperation(operationParseIntGeneric, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, radixGPR); 4529 4533 m_jit.exceptionCheck(); 4530 4534 jsValueResult(resultRegs, node); … … 4539 4543 JSValueRegsFlushedCallResult result(this); 4540 4544 JSValueRegs resultRegs = result.regs(); 4541 callOperation(operationParseIntString, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueGPR, radixGPR);4545 callOperation(operationParseIntString, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueGPR, radixGPR); 4542 4546 m_jit.exceptionCheck(); 4543 4547 jsValueResult(resultRegs, node); … … 4552 4556 JSValueRegsFlushedCallResult result(this); 4553 4557 JSValueRegs resultRegs = result.regs(); 4554 callOperation(operationParseIntNoRadixGeneric, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs);4558 callOperation(operationParseIntNoRadixGeneric, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs); 4555 4559 m_jit.exceptionCheck(); 4556 4560 jsValueResult(resultRegs, node); … … 4565 4569 JSValueRegsFlushedCallResult result(this); 4566 4570 JSValueRegs resultRegs = result.regs(); 4567 callOperation(operationParseIntStringNoRadix, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueGPR);4571 callOperation(operationParseIntStringNoRadix, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueGPR); 4568 4572 m_jit.exceptionCheck(); 4569 4573 jsValueResult(resultRegs, node); … … 4588 4592 if (!hasInstanceValueNode->isCellConstant() || defaultHasInstanceFunction != hasInstanceValueNode->asCell()) { 4589 4593 JSValueRegs hasInstanceValueRegs = hasInstanceValue.jsValueRegs(); 4594 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), resultGPR); 4590 4595 #if USE(JSVALUE64) 4591 notDefault.append(m_jit.branchPtr(MacroAssembler::NotEqual, hasInstanceValueRegs.gpr(), TrustedImmPtr(node->cellOperand())));4596 notDefault.append(m_jit.branchPtr(MacroAssembler::NotEqual, hasInstanceValueRegs.gpr(), resultGPR)); 4592 4597 #else 4593 4598 notDefault.append(m_jit.branchIfNotCell(hasInstanceValueRegs)); 4594 notDefault.append(m_jit.branchPtr(MacroAssembler::NotEqual, hasInstanceValueRegs.payloadGPR(), TrustedImmPtr(node->cellOperand())));4599 notDefault.append(m_jit.branchPtr(MacroAssembler::NotEqual, hasInstanceValueRegs.payloadGPR(), resultGPR)); 4595 4600 #endif 4596 4601 } … … 4626 4631 if (JITCode::useDataIC(JITType::DFGJIT)) { 4627 4632 slowPath = slowPathICCall( 4628 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInstanceOfOptimize, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stubInfoGPR, valueRegs, prototypeRegs);4633 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInstanceOfOptimize, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stubInfoGPR, valueRegs, prototypeRegs); 4629 4634 } else { 4630 4635 slowPath = slowPathCall( 4631 slowCases, this, operationInstanceOfOptimize, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), TrustedImmPtr(gen.stubInfo()), valueRegs, prototypeRegs);4636 slowCases, this, operationInstanceOfOptimize, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), TrustedImmPtr(gen.stubInfo()), valueRegs, prototypeRegs); 4632 4637 } 4633 4638 … … 4739 4744 JSValueRegs resultRegs = result.regs(); 4740 4745 4741 callOperation(operationBitNotHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandGPR);4746 callOperation(operationBitNotHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandGPR); 4742 4747 m_jit.exceptionCheck(); 4743 4748 jsValueResult(resultRegs, node); … … 4754 4759 JSValueRegsFlushedCallResult result(this); 4755 4760 JSValueRegs resultRegs = result.regs(); 4756 callOperation(operationValueBitNot, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandRegs);4761 callOperation(operationValueBitNot, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandRegs); 4757 4762 m_jit.exceptionCheck(); 4758 4763 … … 4794 4799 JSValueRegsFlushedCallResult result(this); 4795 4800 JSValueRegs resultRegs = result.regs(); 4796 callOperation(snippetSlowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);4801 callOperation(snippetSlowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 4797 4802 m_jit.exceptionCheck(); 4798 4803 … … 4859 4864 } 4860 4865 4861 callOperation(snippetSlowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);4866 callOperation(snippetSlowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 4862 4867 4863 4868 silentFillAllRegisters(); … … 4922 4927 switch (op) { 4923 4928 case ValueBitAnd: 4924 callOperation(operationBitAndHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);4929 callOperation(operationBitAndHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 4925 4930 break; 4926 4931 case ValueBitXor: 4927 callOperation(operationBitXorHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);4932 callOperation(operationBitXorHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 4928 4933 break; 4929 4934 case ValueBitOr: 4930 callOperation(operationBitOrHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);4935 callOperation(operationBitOrHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 4931 4936 break; 4932 4937 default: … … 5012 5017 JSValueRegsFlushedCallResult result(this); 5013 5018 JSValueRegs resultRegs = result.regs(); 5014 callOperation(snippetSlowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5019 callOperation(snippetSlowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5015 5020 m_jit.exceptionCheck(); 5016 5021 … … 5078 5083 } 5079 5084 5080 callOperation(snippetSlowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5085 callOperation(snippetSlowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5081 5086 5082 5087 silentFillAllRegisters(); … … 5107 5112 JSValueRegs resultRegs = result.regs(); 5108 5113 5109 callOperation(operationBitLShiftHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);5114 callOperation(operationBitLShiftHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 5110 5115 m_jit.exceptionCheck(); 5111 5116 jsValueResult(resultRegs, node); … … 5134 5139 JSValueRegsFlushedCallResult result(this); 5135 5140 JSValueRegs resultRegs = result.regs(); 5136 callOperation(operationBitRShiftHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);5141 callOperation(operationBitRShiftHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 5137 5142 m_jit.exceptionCheck(); 5138 5143 … … 5222 5227 JSValueRegs resultRegs = result.regs(); 5223 5228 // FIXME: call a more specialized function 5224 callOperation(operationValueAddNotNumber, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5229 callOperation(operationValueAddNotNumber, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5225 5230 m_jit.exceptionCheck(); 5226 5231 … … 5243 5248 JSValueRegsFlushedCallResult result(this); 5244 5249 JSValueRegs resultRegs = result.regs(); 5245 callOperation(operationAddHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);5250 callOperation(operationAddHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 5246 5251 m_jit.exceptionCheck(); 5247 5252 … … 5259 5264 JSValueRegsFlushedCallResult result(this); 5260 5265 JSValueRegs resultRegs = result.regs(); 5261 callOperation(operationValueAddNotNumber, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5266 callOperation(operationValueAddNotNumber, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5262 5267 m_jit.exceptionCheck(); 5263 5268 … … 5322 5327 JSValueRegsFlushedCallResult result(this); 5323 5328 JSValueRegs resultRegs = result.regs(); 5324 callOperation(operationValueSub, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5329 callOperation(operationValueSub, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5325 5330 m_jit.exceptionCheck(); 5326 5331 … … 5343 5348 JSValueRegs resultRegs = result.regs(); 5344 5349 5345 callOperation(operationSubHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);5350 callOperation(operationSubHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 5346 5351 5347 5352 m_jit.exceptionCheck(); … … 5450 5455 5451 5456 if (addICGenerationState->shouldSlowPathRepatch) 5452 addICGenerationState->slowPathCall = callOperation(repatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), innerLeftRegs, innerRightRegs, TrustedImmPtr(mathIC));5457 addICGenerationState->slowPathCall = callOperation(repatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), innerLeftRegs, innerRightRegs, TrustedImmPtr(mathIC)); 5453 5458 else 5454 addICGenerationState->slowPathCall = callOperation(nonRepatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), innerLeftRegs, innerRightRegs);5459 addICGenerationState->slowPathCall = callOperation(nonRepatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), innerLeftRegs, innerRightRegs); 5455 5460 5456 5461 silentFill(savePlans); … … 5481 5486 5482 5487 flushRegisters(); 5483 callOperation(nonRepatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);5488 callOperation(nonRepatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 5484 5489 m_jit.exceptionCheck(); 5485 5490 } … … 5514 5519 MacroAssembler::Jump slowCase = m_jit.jump(); 5515 5520 5516 addSlowPathGenerator(slowPathCall(slowCase, this, operationInstanceOfCustom, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, constructorGPR, hasInstanceRegs));5521 addSlowPathGenerator(slowPathCall(slowCase, this, operationInstanceOfCustom, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, constructorGPR, hasInstanceRegs)); 5517 5522 5518 5523 unblessedBooleanResult(resultGPR, node); … … 5613 5618 if (node->identifierNumber() != UINT32_MAX) 5614 5619 errorMessage = identifierUID(node->identifierNumber()); 5615 addSlowPathGenerator(slowPathCall(slowCases, this, operationToObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, TrustedImmPtr(errorMessage)));5620 addSlowPathGenerator(slowPathCall(slowCases, this, operationToObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, TrustedImmPtr(errorMessage))); 5616 5621 } else 5617 addSlowPathGenerator(slowPathCall(slowCases, this, operationCallObjectConstructor, resultGPR, TrustedImmPtr(node->cellOperand()), valueRegs));5622 addSlowPathGenerator(slowPathCall(slowCases, this, operationCallObjectConstructor, resultGPR, JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), valueRegs)); 5618 5623 5619 5624 cellResult(resultGPR, node); … … 5759 5764 flushRegisters(); 5760 5765 FPRResult result(this); 5761 callOperation(operationArithAbs, result.fpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);5766 callOperation(operationArithAbs, result.fpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 5762 5767 m_jit.exceptionCheck(); 5763 5768 doubleResult(result.fpr(), node); … … 5783 5788 GPRReg resultReg = result.gpr(); 5784 5789 flushRegisters(); 5785 callOperation(operationArithClz32, resultReg, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);5790 callOperation(operationArithClz32, resultReg, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 5786 5791 m_jit.exceptionCheck(); 5787 5792 strictInt32Result(resultReg, node); … … 5807 5812 flushRegisters(); 5808 5813 FPRResult result(this); 5809 callOperation(operation, result.fpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);5814 callOperation(operation, result.fpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 5810 5815 m_jit.exceptionCheck(); 5811 5816 doubleResult(result.fpr(), node); … … 5924 5929 JSValueRegs resultRegs = result.regs(); 5925 5930 auto operation = node->op() == Inc ? operationInc : operationDec; 5926 callOperation(operation, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);5931 callOperation(operation, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 5927 5932 m_jit.exceptionCheck(); 5928 5933 jsValueResult(resultRegs, node); … … 6063 6068 6064 6069 if (icGenerationState->shouldSlowPathRepatch) 6065 icGenerationState->slowPathCall = callOperation(repatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs, TrustedImmPtr(mathIC));6070 icGenerationState->slowPathCall = callOperation(repatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs, TrustedImmPtr(mathIC)); 6066 6071 else 6067 icGenerationState->slowPathCall = callOperation(nonRepatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs);6072 icGenerationState->slowPathCall = callOperation(nonRepatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs); 6068 6073 6069 6074 silentFill(savePlans); … … 6086 6091 } else { 6087 6092 flushRegisters(); 6088 callOperation(nonRepatchingFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs);6093 callOperation(nonRepatchingFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), childRegs); 6089 6094 m_jit.exceptionCheck(); 6090 6095 } … … 6151 6156 JSValueRegs resultRegs = result.regs(); 6152 6157 6153 callOperation(operationMulHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);6158 callOperation(operationMulHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 6154 6159 6155 6160 m_jit.exceptionCheck(); … … 6169 6174 JSValueRegsFlushedCallResult result(this); 6170 6175 JSValueRegs resultRegs = result.regs(); 6171 callOperation(operationValueMul, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);6176 callOperation(operationValueMul, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 6172 6177 m_jit.exceptionCheck(); 6173 6178 … … 6351 6356 JSValueRegs resultRegs = result.regs(); 6352 6357 6353 callOperation(operationDivHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);6358 callOperation(operationDivHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 6354 6359 6355 6360 m_jit.exceptionCheck(); … … 6369 6374 JSValueRegsFlushedCallResult result(this); 6370 6375 JSValueRegs resultRegs = result.regs(); 6371 callOperation(operationValueDiv, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);6376 callOperation(operationValueDiv, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 6372 6377 m_jit.exceptionCheck(); 6373 6378 … … 6453 6458 } 6454 6459 6455 callOperation(operationValueDiv, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);6460 callOperation(operationValueDiv, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 6456 6461 6457 6462 silentFillAllRegisters(); … … 6617 6622 flushRegisters(); 6618 6623 FPRResult result(this); 6619 callOperation(operationArithFRound, result.fpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);6624 callOperation(operationArithFRound, result.fpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 6620 6625 m_jit.exceptionCheck(); 6621 6626 doubleResult(result.fpr(), node); … … 6642 6647 JSValueRegs resultRegs = result.regs(); 6643 6648 6644 callOperation(operationModHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);6649 callOperation(operationModHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 6645 6650 6646 6651 m_jit.exceptionCheck(); … … 6659 6664 JSValueRegsFlushedCallResult result(this); 6660 6665 JSValueRegs resultRegs = result.regs(); 6661 callOperation(operationValueMod, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs);6666 callOperation(operationValueMod, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs); 6662 6667 m_jit.exceptionCheck(); 6663 6668 jsValueResult(resultRegs, node); … … 7056 7061 operation = operationArithTrunc; 7057 7062 } 7058 callOperation(operation, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs);7063 callOperation(operation, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs); 7059 7064 m_jit.exceptionCheck(); 7060 7065 jsValueResult(resultRegs, node); … … 7089 7094 flushRegisters(); 7090 7095 FPRResult result(this); 7091 callOperation(operationArithSqrt, result.fpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);7096 callOperation(operationArithSqrt, result.fpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 7092 7097 m_jit.exceptionCheck(); 7093 7098 doubleResult(result.fpr(), node); … … 7217 7222 JSValueRegs resultRegs = result.regs(); 7218 7223 7219 callOperation(operationPowHeapBigInt, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);7224 callOperation(operationPowHeapBigInt, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 7220 7225 7221 7226 m_jit.exceptionCheck(); … … 7236 7241 JSValueRegsFlushedCallResult result(this); 7237 7242 JSValueRegs resultRegs = result.regs(); 7238 callOperation(operationValuePow, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs);7243 callOperation(operationValuePow, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftRegs, rightRegs); 7239 7244 m_jit.exceptionCheck(); 7240 7245 … … 7973 7978 addSlowPathGenerator( 7974 7979 slowPathCall( 7975 slowCase, this, operationCompareStringEq, leftTempGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR));7980 slowCase, this, operationCompareStringEq, leftTempGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR)); 7976 7981 7977 7982 blessedBooleanResult(leftTempGPR, node); … … 8123 8128 8124 8129 flushRegisters(); 8125 callOperation(compareFunction, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);8130 callOperation(compareFunction, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 8126 8131 m_jit.exceptionCheck(); 8127 8132 … … 8224 8229 GPRFlushedCallResult result(this); 8225 8230 GPRReg resultGPR = result.gpr(); 8226 callOperation(operationSameValue, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);8231 callOperation(operationSameValue, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 8227 8232 m_jit.exceptionCheck(); 8228 8233 … … 8241 8246 GPRReg eqGPR = eq.gpr(); 8242 8247 8243 m_jit. move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), eqGPR);8248 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), eqGPR); 8244 8249 m_jit.comparePtr(invert ? CCallHelpers::Equal : CCallHelpers::NotEqual, strGPR, eqGPR, eqGPR); 8245 8250 unblessedBooleanResult(eqGPR, node); … … 8258 8263 valueRegs, node->child1(), (~SpecCellCheck) | SpecString, m_jit.branchIfNotString(cellGPR)); 8259 8264 8260 m_jit. move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), tempGPR);8265 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), tempGPR); 8261 8266 m_jit.comparePtr(invert ? CCallHelpers::Equal : CCallHelpers::NotEqual, cellGPR, tempGPR, tempGPR); 8262 8267 auto done = m_jit.jump(); … … 8279 8284 speculateString(nodeUse, strGPR); 8280 8285 8281 branch Ptr(CCallHelpers::Equal, strGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);8286 branchLinkableConstant(CCallHelpers::Equal, strGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken); 8282 8287 jump(taken); 8283 8288 … … 8296 8301 DFG_TYPE_CHECK(valueRegs, nodeUse, (~SpecCellCheck) | SpecString, m_jit.branchIfNotString(cellGPR)); 8297 8302 8298 branch Ptr(CCallHelpers::Equal, cellGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);8303 branchLinkableConstant(CCallHelpers::Equal, cellGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken); 8299 8304 jump(taken, ForceJump); 8300 8305 … … 8310 8315 GPRTemporary storage(this); 8311 8316 GPRReg storageGPR = storage.gpr(); 8312 m_jit. move(TrustedImmPtr(node->storagePointer()), storageGPR);8317 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant::nonCellPointer(m_graph, node->storagePointer()), storageGPR); 8313 8318 storageResult(storageGPR, node); 8314 8319 } … … 8357 8362 8358 8363 ASSERT(node->arrayMode().type() != Array::String); 8359 8360 8364 auto typedArrayType = node->arrayMode().typedArrayType(); 8361 8365 ASSERT_UNUSED(typedArrayType, isTypedView(typedArrayType)); … … 8383 8387 slowPathCall( 8384 8388 slowCases, 8385 this, operationResolveRopeString, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));8389 this, operationResolveRopeString, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 8386 8390 cellResult(resultGPR, node); 8387 8391 } … … 8480 8484 slowPathCall( 8481 8485 isOutOfBounds, this, operationGetByValObjectInt, 8482 extractResult(resultRegs), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));8486 extractResult(resultRegs), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 8483 8487 } 8484 8488 … … 8586 8590 GPRTemporary result(this); 8587 8591 GPRReg resultGPR = result.gpr(); 8588 auto* globalObject = m_graph.globalObjectFor(node->origin.semantic);8589 m_jit.loadPtr( globalObject->addressOfGlobalThis(), resultGPR);8592 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), resultGPR); 8593 m_jit.loadPtr(CCallHelpers::Address(resultGPR, JSGlobalObject::offsetOfGlobalThis()), resultGPR); 8590 8594 cellResult(resultGPR, node); 8591 8595 } … … 8749 8753 8750 8754 m_jit.storePtr(scopeGPR, JITCompiler::Address(resultGPR, JSFunction::offsetOfScopeChain())); 8751 m_jit.store Ptr(TrustedImmPtr::weakPointer(m_graph, executable), JITCompiler::Address(resultGPR, JSFunction::offsetOfExecutableOrRareData()));8755 m_jit.storeLinkableConstant(JITCompiler::LinkableConstant(m_graph, executable), JITCompiler::Address(resultGPR, JSFunction::offsetOfExecutableOrRareData())); 8752 8756 m_jit.mutatorFence(vm()); 8753 8757 } … … 8770 8774 8771 8775 if (nodeType == NewGeneratorFunction) 8772 callOperation(operationNewGeneratorFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable));8776 callOperation(operationNewGeneratorFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable)); 8773 8777 else if (nodeType == NewAsyncFunction) 8774 callOperation(operationNewAsyncFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable));8778 callOperation(operationNewAsyncFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable)); 8775 8779 else if (nodeType == NewAsyncGeneratorFunction) 8776 callOperation(operationNewAsyncGeneratorFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable));8780 callOperation(operationNewAsyncGeneratorFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable)); 8777 8781 else 8778 callOperation(operationNewFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable));8782 callOperation(operationNewFunction, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable)); 8779 8783 m_jit.exceptionCheck(); 8780 8784 cellResult(resultGPR, node); … … 8812 8816 compileNewFunctionCommon<JSFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSFunction::allocationSize(0), executable); 8813 8817 8814 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable)));8818 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable))); 8815 8819 } 8816 8820 … … 8818 8822 compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable); 8819 8823 8820 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable)));8824 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable))); 8821 8825 } 8822 8826 … … 8824 8828 compileNewFunctionCommon<JSAsyncFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncFunction::allocationSize(0), executable); 8825 8829 8826 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable)));8830 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable))); 8827 8831 } 8828 8832 … … 8830 8834 compileNewFunctionCommon<JSAsyncGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncGeneratorFunction::allocationSize(0), executable); 8831 8835 8832 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, TrustedImmPtr::weakPointer(m_graph, executable)));8836 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, TrustedImmPtr(&vm()), scopeGPR, JITCompiler::LinkableConstant(m_graph, executable))); 8833 8837 } 8834 8838 … … 8844 8848 8845 8849 flushRegisters(); 8846 callOperation(operationSetFunctionName, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), funcGPR, nameValueRegs);8850 callOperation(operationSetFunctionName, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), funcGPR, nameValueRegs); 8847 8851 m_jit.exceptionCheck(); 8848 8852 … … 8861 8865 unlock(GPRInfo::returnValueGPR); 8862 8866 8863 callOperation(operationSizeOfVarargs, GPRInfo::returnValueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsRegs, data->offset);8867 callOperation(operationSizeOfVarargs, GPRInfo::returnValueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsRegs, data->offset); 8864 8868 m_jit.exceptionCheck(); 8865 8869 … … 8898 8902 m_jit.store32(argumentCountIncludingThis, JITCompiler::payloadFor(data->machineCount)); 8899 8903 8900 callOperation(operationLoadVarargs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), data->machineStart.offset(), argumentsRegs, data->offset, argumentCountIncludingThis, data->mandatoryMinimum);8904 callOperation(operationLoadVarargs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), data->machineStart.offset(), argumentsRegs, data->offset, argumentCountIncludingThis, data->mandatoryMinimum); 8901 8905 m_jit.exceptionCheck(); 8902 8906 … … 8997 9001 #if USE(JSVALUE64) 8998 9002 callOperation(operationCreateActivationDirect, 8999 resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, TrustedImmPtr::weakPointer(m_graph, table), TrustedImm64(JSValue::encode(initializationValue)));9003 resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, JITCompiler::LinkableConstant(m_graph, table), TrustedImm64(JSValue::encode(initializationValue))); 9000 9004 #else 9001 9005 callOperation(operationCreateActivationDirect, 9002 resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, TrustedImmPtr::weakPointer(m_graph, table), initializationRegs);9006 resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, JITCompiler::LinkableConstant(m_graph, table), initializationRegs); 9003 9007 #endif 9004 9008 m_jit.exceptionCheck(); … … 9029 9033 // activation must be young. 9030 9034 m_jit.storePtr(scopeGPR, JITCompiler::Address(resultGPR, JSScope::offsetOfNext())); 9031 m_jit.storePtr( 9032 TrustedImmPtr(node->cellOperand()), 9033 JITCompiler::Address(resultGPR, JSLexicalEnvironment::offsetOfSymbolTable())); 9034 9035 m_jit.storeLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), JITCompiler::Address(resultGPR, JSLexicalEnvironment::offsetOfSymbolTable())); 9036 9035 9037 // Must initialize all members to undefined or the TDZ empty value. 9036 9038 for (unsigned i = 0; i < table->scopeSize(); ++i) { … … 9046 9048 addSlowPathGenerator( 9047 9049 slowPathCall( 9048 slowPath, this, operationCreateActivationDirect, resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, TrustedImmPtr::weakPointer(m_graph, table), TrustedImm64(JSValue::encode(initializationValue))));9050 slowPath, this, operationCreateActivationDirect, resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, JITCompiler::LinkableConstant(m_graph, table), TrustedImm64(JSValue::encode(initializationValue)))); 9049 9051 #else 9050 9052 addSlowPathGenerator( 9051 9053 slowPathCall( 9052 slowPath, this, operationCreateActivationDirect, resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, TrustedImmPtr::weakPointer(m_graph, table), initializationRegs));9054 slowPath, this, operationCreateActivationDirect, resultGPR, TrustedImmPtr(&vm()), structure, scopeGPR, JITCompiler::LinkableConstant(m_graph, table), initializationRegs)); 9053 9055 #endif 9054 9056 … … 9159 9161 inlineCallFrame->calleeRecovery.virtualRegister()), 9160 9162 scratch1GPR); 9161 } else { 9162 m_jit.move( 9163 TrustedImmPtr::weakPointer( 9164 m_graph, inlineCallFrame->calleeRecovery.constant().asCell()), 9165 scratch1GPR); 9166 } 9163 } else 9164 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, inlineCallFrame->calleeRecovery.constant().asCell()), scratch1GPR); 9167 9165 } else 9168 9166 m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), scratch1GPR); … … 9262 9260 flushRegisters(); 9263 9261 9264 JSGlobalObject* globalObject = m_ jit.globalObjectFor(node->origin.semantic);9262 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic); 9265 9263 9266 9264 // We set up the arguments ourselves, because we have the whole register file and we can … … 9279 9277 m_jit.setupArgument( 9280 9278 1, [&] (GPRReg destGPR) { 9281 m_jit.move( 9282 TrustedImmPtr::weakPointer(m_graph, globalObject->scopedArgumentsStructure()), 9283 destGPR); 9279 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject->scopedArgumentsStructure()), destGPR); 9284 9280 }); 9285 m_jit.setupArgument(0, [&] (GPRReg destGPR) { m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), destGPR); }); 9281 m_jit.setupArgument( 9282 0, [&] (GPRReg destGPR) { 9283 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), destGPR); 9284 }); 9286 9285 9287 9286 appendCallSetResult(operationCreateScopedArguments, resultGPR); … … 9297 9296 flushRegisters(); 9298 9297 9299 JSGlobalObject* globalObject = m_ jit.globalObjectFor(node->origin.semantic);9298 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic); 9300 9299 9301 9300 // We set up the arguments ourselves, because we have the whole register file and we can … … 9308 9307 m_jit.setupArgument( 9309 9308 1, [&] (GPRReg destGPR) { 9310 m_jit.move( 9311 TrustedImmPtr::weakPointer( 9312 m_graph, globalObject->clonedArgumentsStructure()), 9313 destGPR); 9309 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject->clonedArgumentsStructure()), destGPR); 9314 9310 }); 9315 m_jit.setupArgument(0, [&] (GPRReg destGPR) { m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), destGPR); }); 9311 m_jit.setupArgument( 9312 0, [&] (GPRReg destGPR) { 9313 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), destGPR); 9314 }); 9316 9315 9317 9316 appendCallSetResult(operationCreateClonedArguments, resultGPR); … … 9327 9326 flushRegisters(); 9328 9327 9329 JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);9330 9331 9328 // We set up the arguments ourselves, because we have the whole register file and we can 9332 9329 // set them up directly into the argument registers. … … 9335 9332 m_jit.setupArgument(2, [&] (GPRReg destGPR) { emitGetLength(node->origin.semantic, destGPR); }); 9336 9333 m_jit.setupArgument(1, [&] (GPRReg destGPR) { emitGetArgumentStart(node->origin.semantic, destGPR); }); 9337 m_jit.setupArgument(0, [&] (GPRReg destGPR) { m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), destGPR); }); 9334 m_jit.setupArgument( 9335 0, [&] (GPRReg destGPR) { 9336 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), destGPR); 9337 }); 9338 9338 9339 9339 appendCallSetResult(operationCreateArgumentsButterfly, resultGPR); … … 9404 9404 GPRFlushedCallResult result(this); 9405 9405 GPRReg resultGPR = result.gpr(); 9406 callOperation(operationCreateRest, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsStartGPR, Imm32(node->numberOfArgumentsToSkip()), arrayLengthGPR);9406 callOperation(operationCreateRest, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsStartGPR, Imm32(node->numberOfArgumentsToSkip()), arrayLengthGPR); 9407 9407 m_jit.exceptionCheck(); 9408 9408 … … 9458 9458 m_jit.add32(TrustedImm32(JSImmutableButterfly::offsetOfData()), scratch1GPR); 9459 9459 9460 m_jit.emitAllocateVariableSizedCell<JSImmutableButterfly>(vm(), resultGPR, TrustedImmPtr(m_graph.registerStructure( m_graph.m_vm.immutableButterflyStructures[arrayIndexFromIndexingType(CopyOnWriteArrayWithContiguous) - NumberOfIndexingShapes].get())), scratch1GPR, scratch1GPR, scratch2GPR, slowPath);9460 m_jit.emitAllocateVariableSizedCell<JSImmutableButterfly>(vm(), resultGPR, TrustedImmPtr(m_graph.registerStructure(vm().immutableButterflyStructures[arrayIndexFromIndexingType(CopyOnWriteArrayWithContiguous) - NumberOfIndexingShapes].get())), scratch1GPR, scratch1GPR, scratch2GPR, slowPath); 9461 9461 m_jit.store32(lengthGPR, MacroAssembler::Address(resultGPR, JSImmutableButterfly::offsetOfPublicLength())); 9462 9462 m_jit.store32(lengthGPR, MacroAssembler::Address(resultGPR, JSImmutableButterfly::offsetOfVectorLength())); … … 9498 9498 } 9499 9499 9500 addSlowPathGenerator(slowPathCall(slowPath, this, operationSpreadFastArray, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument));9500 addSlowPathGenerator(slowPathCall(slowPath, this, operationSpreadFastArray, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument)); 9501 9501 9502 9502 done.link(&m_jit); … … 9508 9508 GPRFlushedCallResult result(this); 9509 9509 GPRReg resultGPR = result.gpr(); 9510 callOperation(operationSpreadFastArray, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument);9510 callOperation(operationSpreadFastArray, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument); 9511 9511 m_jit.exceptionCheck(); 9512 9512 cellResult(resultGPR, node); … … 9517 9517 GPRFlushedCallResult result(this); 9518 9518 GPRReg resultGPR = result.gpr(); 9519 callOperation(operationSpreadGeneric, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument);9519 callOperation(operationSpreadGeneric, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argument); 9520 9520 m_jit.exceptionCheck(); 9521 9521 cellResult(resultGPR, node); … … 9654 9654 9655 9655 callOperation( 9656 operationNewArray, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject), m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(node->indexingType())),9656 operationNewArray, resultGPR, JITCompiler::LinkableConstant(m_graph, globalObject), m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(node->indexingType())), 9657 9657 TrustedImmPtr(buffer), size_t(node->numChildren())); 9658 9658 m_jit.exceptionCheck(); … … 9813 9813 GPRReg resultGPR = result.gpr(); 9814 9814 9815 callOperation(operationNewArrayWithSpreadSlow, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject), TrustedImmPtr(buffer), node->numChildren());9815 callOperation(operationNewArrayWithSpreadSlow, resultGPR, JITCompiler::LinkableConstant(m_graph, globalObject), TrustedImmPtr(buffer), node->numChildren()); 9816 9816 m_jit.exceptionCheck(); 9817 9817 … … 9993 9993 9994 9994 addSlowPathGenerator(makeUnique<CallArrayAllocatorWithVariableStructureVariableSizeSlowPathGenerator>( 9995 slowCases, this, operationNewArrayWithSize, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject), tempValue, sizeGPR, storageResultGPR));9995 slowCases, this, operationNewArrayWithSize, resultGPR, JITCompiler::LinkableConstant(m_graph, globalObject), tempValue, sizeGPR, storageResultGPR)); 9996 9996 } 9997 9997 … … 10212 10212 flushRegisters(); 10213 10213 10214 callOperation(operationArrayIndexOfString, lengthGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementGPR, indexGPR);10214 callOperation(operationArrayIndexOfString, lengthGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementGPR, indexGPR); 10215 10215 m_jit.exceptionCheck(); 10216 10216 … … 10227 10227 switch (node->arrayMode().type()) { 10228 10228 case Array::Double: 10229 callOperation(operationArrayIndexOfValueDouble, lengthGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementRegs, indexGPR);10229 callOperation(operationArrayIndexOfValueDouble, lengthGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementRegs, indexGPR); 10230 10230 break; 10231 10231 case Array::Int32: 10232 10232 case Array::Contiguous: 10233 callOperation(operationArrayIndexOfValueInt32OrContiguous, lengthGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementRegs, indexGPR);10233 callOperation(operationArrayIndexOfValueInt32OrContiguous, lengthGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), storageGPR, searchElementRegs, indexGPR); 10234 10234 break; 10235 10235 default: … … 10300 10300 10301 10301 addSlowPathGenerator( 10302 slowPathCall(slowPath, this, operationArrayPush, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, baseGPR));10302 slowPathCall(slowPath, this, operationArrayPush, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, baseGPR)); 10303 10303 10304 10304 jsValueResult(resultRegs, node); … … 10346 10346 MacroAssembler::Jump fastPath = m_jit.branchPtr(MacroAssembler::NotEqual, bufferGPR, TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()))); 10347 10347 10348 addSlowPathGenerator(slowPathCall(m_jit.jump(), this, operationArrayPushMultiple, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount)));10348 addSlowPathGenerator(slowPathCall(m_jit.jump(), this, operationArrayPushMultiple, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount))); 10349 10349 10350 10350 base.use(); … … 10371 10371 10372 10372 addSlowPathGenerator( 10373 slowPathCall(slowPath, this, operationArrayPushDouble, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueFPR, baseGPR));10373 slowPathCall(slowPath, this, operationArrayPushDouble, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueFPR, baseGPR)); 10374 10374 10375 10375 jsValueResult(resultRegs, node); … … 10415 10415 MacroAssembler::Jump fastPath = m_jit.branchPtr(MacroAssembler::NotEqual, bufferGPR, TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer()))); 10416 10416 10417 addSlowPathGenerator(slowPathCall(m_jit.jump(), this, operationArrayPushDoubleMultiple, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount)));10417 addSlowPathGenerator(slowPathCall(m_jit.jump(), this, operationArrayPushDoubleMultiple, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount))); 10418 10418 10419 10419 base.use(); … … 10448 10448 10449 10449 addSlowPathGenerator( 10450 slowPathCall(slowPath, this, operationArrayPush, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, baseGPR));10450 slowPathCall(slowPath, this, operationArrayPush, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs, baseGPR)); 10451 10451 10452 10452 jsValueResult(resultRegs, node); … … 10492 10492 10493 10493 addSlowPathGenerator( 10494 slowPathCall(m_jit.jump(), this, operationArrayPushMultiple, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount)));10494 slowPathCall(m_jit.jump(), this, operationArrayPushMultiple, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, bufferGPR, TrustedImm32(elementCount))); 10495 10495 10496 10496 base.use(); … … 10547 10547 void SpeculativeJIT::compileTypeOfIsObject(Node* node) 10548 10548 { 10549 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);10550 10551 10549 JSValueOperand value(this, node->child1()); 10552 10550 JSValueRegs valueRegs = value.jsValueRegs(); … … 10580 10578 addSlowPathGenerator( 10581 10579 slowPathCall( 10582 slowPath, this, operationTypeOfIsObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject),10580 slowPath, this, operationTypeOfIsObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), 10583 10581 valueRegs.payloadGPR())); 10584 10582 … … 10590 10588 void SpeculativeJIT::compileIsCallable(Node* node, S_JITOperation_GC slowPathOperation) 10591 10589 { 10592 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);10593 10594 10590 JSValueOperand value(this, node->child1()); 10595 10591 JSValueRegs valueRegs = value.jsValueRegs(); … … 10617 10613 addSlowPathGenerator( 10618 10614 slowPathCall( 10619 slowPath, this, slowPathOperation, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject),10615 slowPath, this, slowPathOperation, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), 10620 10616 valueRegs.payloadGPR())); 10621 10617 … … 10633 10629 GPRReg resultGPR = result.gpr(); 10634 10630 10635 callOperation(operationIsConstructor, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs);10631 callOperation(operationIsConstructor, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs); 10636 10632 unblessedBooleanResult(resultGPR, node); 10637 10633 } … … 10639 10635 void SpeculativeJIT::compileTypeOf(Node* node) 10640 10636 { 10641 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);10642 10643 10637 JSValueOperand value(this, node->child1()); 10644 10638 JSValueRegs valueRegs = value.jsValueRegs(); … … 10652 10646 valueRegs, resultGPR, 10653 10647 [&] (TypeofType type, bool fallsThrough) { 10654 m_jit. move(TrustedImmPtr::weakPointer(m_graph, vm().smallStrings.typeString(type)), resultGPR);10648 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().smallStrings.typeString(type)), resultGPR); 10655 10649 if (!fallsThrough) 10656 10650 done.append(m_jit.jump()); … … 10663 10657 addSlowPathGenerator( 10664 10658 slowPathCall( 10665 slowPath, this, operationTypeOfObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject),10659 slowPath, this, operationTypeOfObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), 10666 10660 valueRegs.payloadGPR())); 10667 10661 … … 10712 10706 if (node->child1().useKind() == CellUse) { 10713 10707 SpeculateCellOperand cell(this, node->child1()); 10714 speculationCheck(BadConstantValue, JSValueSource::unboxedCell(cell.gpr()), node->child1(), m_jit.branch WeakPtr(JITCompiler::NotEqual, cell.gpr(), node->cellOperand()->cell()));10708 speculationCheck(BadConstantValue, JSValueSource::unboxedCell(cell.gpr()), node->child1(), m_jit.branchLinkableConstant(JITCompiler::NotEqual, cell.gpr(), JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()))); 10715 10709 } else { 10716 10710 ASSERT(!node->constant()->value().isCell() || !node->constant()->value()); … … 10983 10977 switch (argumentCountIncludingThis) { 10984 10978 case 1: 10985 callOperation(reinterpret_cast<J_JITOperation_GP>(function.get()), extractResult(resultRegs), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0]);10979 callOperation(reinterpret_cast<J_JITOperation_GP>(function.get()), extractResult(resultRegs), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0]); 10986 10980 break; 10987 10981 case 2: 10988 callOperation(reinterpret_cast<J_JITOperation_GPP>(function.get()), extractResult(resultRegs), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0], regs[1]);10982 callOperation(reinterpret_cast<J_JITOperation_GPP>(function.get()), extractResult(resultRegs), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0], regs[1]); 10989 10983 break; 10990 10984 case 3: 10991 callOperation(reinterpret_cast<J_JITOperation_GPPP>(function.get()), extractResult(resultRegs), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0], regs[1], regs[2]);10985 callOperation(reinterpret_cast<J_JITOperation_GPPP>(function.get()), extractResult(resultRegs), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), regs[0], regs[1], regs[2]); 10992 10986 break; 10993 10987 default: … … 11013 11007 flushRegisters(); 11014 11008 if (Options::useJITCage()) 11015 m_jit.setupArguments<J_JITOperation_GJIP>( TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseGPR), TrustedImmPtr(identifierUID(node->callDOMGetterData()->identifierNumber)), TrustedImmPtr(getter.executableAddress()));11009 m_jit.setupArguments<J_JITOperation_GJIP>(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseGPR), TrustedImmPtr(identifierUID(node->callDOMGetterData()->identifierNumber)), TrustedImmPtr(getter.executableAddress())); 11016 11010 else 11017 m_jit.setupArguments<J_JITOperation_GJI>( TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseGPR), TrustedImmPtr(identifierUID(node->callDOMGetterData()->identifierNumber)));11011 m_jit.setupArguments<J_JITOperation_GJI>(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseGPR), TrustedImmPtr(identifierUID(node->callDOMGetterData()->identifierNumber))); 11018 11012 11019 11013 m_jit.storePtr(GPRInfo::callFrameRegister, &vm().topCallFrame); … … 11156 11150 11157 11151 if (node->op() == ToString) 11158 callOperation(operationToString, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);11152 callOperation(operationToString, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 11159 11153 else { 11160 11154 ASSERT(node->op() == CallStringConstructor); 11161 callOperation(operationCallStringConstructor, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);11155 callOperation(operationCallStringConstructor, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 11162 11156 } 11163 11157 m_jit.exceptionCheck(); … … 11186 11180 } 11187 11181 if (node->op() == ToString) 11188 callOperation(operationToString, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);11182 callOperation(operationToString, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 11189 11183 else if (node->op() == StringValueOf) 11190 callOperation(operationStringValueOf, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);11184 callOperation(operationStringValueOf, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 11191 11185 else { 11192 11186 ASSERT(node->op() == CallStringConstructor); 11193 callOperation(operationCallStringConstructor, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs);11187 callOperation(operationCallStringConstructor, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs); 11194 11188 } 11195 11189 m_jit.exceptionCheck(); … … 11262 11256 } 11263 11257 if (node->op() == ToString) 11264 callOperation(operationToStringOnCell, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1GPR);11258 callOperation(operationToStringOnCell, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1GPR); 11265 11259 else { 11266 11260 ASSERT(node->op() == CallStringConstructor); 11267 callOperation(operationCallStringConstructorOnCell, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1GPR);11261 callOperation(operationCallStringConstructorOnCell, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1GPR); 11268 11262 } 11269 11263 m_jit.exceptionCheck(); … … 11318 11312 slowCases.append(m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr())); 11319 11313 11320 addSlowPathGenerator(slowPathCall(slowCases, this, operationFunctionToString, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), function.gpr()));11314 addSlowPathGenerator(slowPathCall(slowCases, this, operationFunctionToString, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), function.gpr())); 11321 11315 11322 11316 cellResult(result.gpr(), node); … … 11332 11326 auto callToString = [&] (auto operation, GPRReg resultGPR, auto valueReg) { 11333 11327 flushRegisters(); 11334 callOperation(operation, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueReg, TrustedImm32(radix));11328 callOperation(operation, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueReg, TrustedImm32(radix)); 11335 11329 m_jit.exceptionCheck(); 11336 11330 cellResult(resultGPR, node); … … 11377 11371 auto callToString = [&] (auto operation, GPRReg resultGPR, auto valueReg, GPRReg radixGPR) { 11378 11372 flushRegisters(); 11379 callOperation(operation, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueReg, radixGPR);11373 callOperation(operation, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueReg, radixGPR); 11380 11374 m_jit.exceptionCheck(); 11381 11375 cellResult(resultGPR, node); … … 11475 11469 GPRFlushedCallResult result(this); 11476 11470 GPRReg resultGPR = result.gpr(); 11477 callOperation(operationNewSymbolWithStringDescription, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR);11471 callOperation(operationNewSymbolWithStringDescription, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR); 11478 11472 m_jit.exceptionCheck(); 11479 11473 cellResult(resultGPR, node); … … 11486 11480 GPRFlushedCallResult result(this); 11487 11481 GPRReg resultGPR = result.gpr(); 11488 callOperation(operationNewSymbolWithDescription, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs);11482 callOperation(operationNewSymbolWithDescription, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs); 11489 11483 m_jit.exceptionCheck(); 11490 11484 cellResult(resultGPR, node); … … 11609 11603 addSlowPathGenerator(slowPathCall( 11610 11604 slowCases, this, operationNewTypedArrayWithSizeForType(typedArrayType), 11611 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), structure, sizeGPR, storageGPR));11605 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), structure, sizeGPR, storageGPR)); 11612 11606 11613 11607 cellResult(resultGPR, node); … … 11634 11628 emitAllocateJSObject<RegExpObject>(resultGPR, TrustedImmPtr(structure), butterfly, scratch1GPR, scratch2GPR, slowPath); 11635 11629 11636 m_jit.storePtr( 11637 TrustedImmPtr(node->cellOperand()), 11638 CCallHelpers::Address(resultGPR, RegExpObject::offsetOfRegExpAndFlags())); 11630 m_jit.storeLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), CCallHelpers::Address(resultGPR, RegExpObject::offsetOfRegExpAndFlags())); 11639 11631 m_jit.storeValue(lastIndexRegs, CCallHelpers::Address(resultGPR, RegExpObject::offsetOfLastIndex())); 11640 11632 m_jit.mutatorFence(vm()); 11641 11633 11642 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewRegexpWithLastIndex, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), TrustedImmPtr::weakPointer(m_graph, regexp), lastIndexRegs));11634 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewRegexpWithLastIndex, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JITCompiler::LinkableConstant(m_graph, regexp), lastIndexRegs)); 11643 11635 11644 11636 cellResult(resultGPR, node); … … 12562 12554 m_jit.loadPtr(MacroAssembler::Address(value, JSString::offsetOfValue()), scratch); 12563 12555 auto isRope = m_jit.branchIfRopeStringImpl(scratch); 12564 addSlowPathGenerator(slowPathCall(isRope, this, operationResolveRope, scratch, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), value));12556 addSlowPathGenerator(slowPathCall(isRope, this, operationResolveRope, scratch, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), value)); 12565 12557 12566 12558 addBranch( … … 12804 12796 if (!canDoBinarySwitch || totalLength > Options::maximumBinaryStringSwitchTotalLength()) { 12805 12797 flushRegisters(); 12806 callOperation(operationSwitchString, string, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), static_cast<size_t>(data->switchTableIndex), TrustedImmPtr(&unlinkedTable), string);12798 callOperation(operationSwitchString, string, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), static_cast<size_t>(data->switchTableIndex), TrustedImmPtr(&unlinkedTable), string); 12807 12799 m_jit.exceptionCheck(); 12808 12800 m_jit.farJump(string, JSSwitchPtrTag); … … 12841 12833 slowCases.link(&m_jit); 12842 12834 silentSpillAllRegisters(string); 12843 callOperation(operationSwitchString, string, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), static_cast<size_t>(data->switchTableIndex), TrustedImmPtr(&unlinkedTable), string);12835 callOperation(operationSwitchString, string, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), static_cast<size_t>(data->switchTableIndex), TrustedImmPtr(&unlinkedTable), string); 12844 12836 silentFillAllRegisters(); 12845 12837 m_jit.exceptionCheck(); … … 12988 12980 12989 12981 flushRegisters(); 12990 callOperation(node->op() == PutGetterById ? operationPutGetterById : operationPutSetterById, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), accessorGPR);12982 callOperation(node->op() == PutGetterById ? operationPutGetterById : operationPutSetterById, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), accessorGPR); 12991 12983 m_jit.exceptionCheck(); 12992 12984 … … 13006 12998 13007 12999 flushRegisters(); 13008 callOperation(operationPutGetterSetter, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), getterGPR, setterGPR);13000 callOperation(operationPutGetterSetter, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), getterGPR, setterGPR); 13009 13001 #else 13010 13002 // These JSValues may be JSUndefined OR JSFunction*. … … 13018 13010 13019 13011 flushRegisters(); 13020 callOperation(operationPutGetterSetter, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), getterRegs.payloadGPR(), setterRegs.payloadGPR());13012 callOperation(operationPutGetterSetter, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->accessorAttributes(), getterRegs.payloadGPR(), setterRegs.payloadGPR()); 13021 13013 #endif 13022 13014 m_jit.exceptionCheck(); … … 13032 13024 GPRReg resultGPR = result.gpr(); 13033 13025 flushRegisters(); 13034 callOperation(operationResolveScope, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber())));13026 callOperation(operationResolveScope, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber()))); 13035 13027 m_jit.exceptionCheck(); 13036 13028 cellResult(resultGPR, node); … … 13044 13036 JSValueRegsFlushedCallResult result(this); 13045 13037 JSValueRegs resultRegs = result.regs(); 13046 callOperation(operationResolveScopeForHoistingFuncDeclInEval, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber())));13038 callOperation(operationResolveScopeForHoistingFuncDeclInEval, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber()))); 13047 13039 m_jit.exceptionCheck(); 13048 13040 jsValueResult(resultRegs, node); … … 13072 13064 JSValueRegsFlushedCallResult result(this); 13073 13065 JSValueRegs resultRegs = result.regs(); 13074 callOperation(operationGetDynamicVar, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->getPutInfo());13066 callOperation(operationGetDynamicVar, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, TrustedImmPtr(identifierUID(node->identifierNumber())), node->getPutInfo()); 13075 13067 m_jit.exceptionCheck(); 13076 13068 jsValueResult(resultRegs, node); … … 13086 13078 13087 13079 flushRegisters(); 13088 callOperation(node->ecmaMode().isStrict() ? operationPutDynamicVarStrict : operationPutDynamicVarNonStrict, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, valueRegs, TrustedImmPtr(identifierUID(node->identifierNumber())), node->getPutInfo());13080 callOperation(node->ecmaMode().isStrict() ? operationPutDynamicVarStrict : operationPutDynamicVarNonStrict, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scopeGPR, valueRegs, TrustedImmPtr(identifierUID(node->identifierNumber())), node->getPutInfo()); 13089 13081 m_jit.exceptionCheck(); 13090 13082 noResult(node); … … 13152 13144 13153 13145 flushRegisters(); 13154 callOperation(operation, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, subscriptRegs, node->accessorAttributes(), accessorGPR);13146 callOperation(operation, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, subscriptRegs, node->accessorAttributes(), accessorGPR); 13155 13147 m_jit.exceptionCheck(); 13156 13148 … … 13329 13321 flushRegisters(); 13330 13322 GPRFlushedCallResult result(this); 13331 callOperation(operationStringProtoFuncReplaceRegExpEmptyStr, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, regExpGPR);13323 callOperation(operationStringProtoFuncReplaceRegExpEmptyStr, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, regExpGPR); 13332 13324 m_jit.exceptionCheck(); 13333 13325 cellResult(result.gpr(), node); … … 13350 13342 flushRegisters(); 13351 13343 GPRFlushedCallResult result(this); 13352 callOperation(operationStringProtoFuncReplaceRegExpString, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, regExpGPR, replaceGPR);13344 callOperation(operationStringProtoFuncReplaceRegExpString, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringGPR, regExpGPR, replaceGPR); 13353 13345 m_jit.exceptionCheck(); 13354 13346 cellResult(result.gpr(), node); … … 13372 13364 flushRegisters(); 13373 13365 GPRFlushedCallResult result(this); 13374 callOperation(operationStringProtoFuncReplaceGeneric, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringRegs, searchRegs, replaceRegs);13366 callOperation(operationStringProtoFuncReplaceGeneric, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), stringRegs, searchRegs, replaceRegs); 13375 13367 m_jit.exceptionCheck(); 13376 13368 cellResult(result.gpr(), node); … … 13393 13385 callOperation( 13394 13386 operationRegExpExecNonGlobalOrSticky, resultRegs, 13395 globalObjectGPR, TrustedImmPtr(node->cellOperand()), argumentGPR);13387 globalObjectGPR, JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), argumentGPR); 13396 13388 m_jit.exceptionCheck(); 13397 13389 … … 13413 13405 callOperation( 13414 13406 operationRegExpMatchFastGlobalString, resultRegs, 13415 globalObjectGPR, TrustedImmPtr(node->cellOperand()), argumentGPR);13407 globalObjectGPR, JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), argumentGPR); 13416 13408 m_jit.exceptionCheck(); 13417 13409 … … 13597 13589 13598 13590 flushRegisters(); 13599 callOperation(operationDefineDataPropertyString, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, valueRegs, attributesGPR);13591 callOperation(operationDefineDataPropertyString, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, valueRegs, attributesGPR); 13600 13592 m_jit.exceptionCheck(); 13601 13593 break; … … 13614 13606 13615 13607 flushRegisters(); 13616 callOperation(operationDefineDataPropertyStringIdent, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, identGPR, valueRegs, attributesGPR);13608 callOperation(operationDefineDataPropertyStringIdent, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, identGPR, valueRegs, attributesGPR); 13617 13609 m_jit.exceptionCheck(); 13618 13610 break; … … 13626 13618 13627 13619 flushRegisters(); 13628 callOperation(operationDefineDataPropertySymbol, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, valueRegs, attributesGPR);13620 callOperation(operationDefineDataPropertySymbol, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, valueRegs, attributesGPR); 13629 13621 m_jit.exceptionCheck(); 13630 13622 break; … … 13637 13629 13638 13630 flushRegisters(); 13639 callOperation(operationDefineDataProperty, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs, valueRegs, attributesGPR);13631 callOperation(operationDefineDataProperty, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs, valueRegs, attributesGPR); 13640 13632 m_jit.exceptionCheck(); 13641 13633 break; … … 13678 13670 13679 13671 flushRegisters(); 13680 callOperation(operationDefineAccessorPropertyString, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, getterGPR, setterGPR, attributesGPR);13672 callOperation(operationDefineAccessorPropertyString, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, getterGPR, setterGPR, attributesGPR); 13681 13673 m_jit.exceptionCheck(); 13682 13674 break; … … 13695 13687 13696 13688 flushRegisters(); 13697 callOperation(operationDefineAccessorPropertyStringIdent, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, identGPR, getterGPR, setterGPR, attributesGPR);13689 callOperation(operationDefineAccessorPropertyStringIdent, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, identGPR, getterGPR, setterGPR, attributesGPR); 13698 13690 m_jit.exceptionCheck(); 13699 13691 break; … … 13707 13699 13708 13700 flushRegisters(); 13709 callOperation(operationDefineAccessorPropertySymbol, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, getterGPR, setterGPR, attributesGPR);13701 callOperation(operationDefineAccessorPropertySymbol, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR, getterGPR, setterGPR, attributesGPR); 13710 13702 m_jit.exceptionCheck(); 13711 13703 break; … … 13718 13710 13719 13711 flushRegisters(); 13720 callOperation(operationDefineAccessorProperty, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs, getterGPR, setterGPR, attributesGPR);13712 callOperation(operationDefineAccessorProperty, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs, getterGPR, setterGPR, attributesGPR); 13721 13713 m_jit.exceptionCheck(); 13722 13714 break; … … 13850 13842 sentinel = vm().sentinelSetBucket(); 13851 13843 } 13852 m_jit. move(TrustedImmPtr::weakPointer(m_graph, sentinel), resultGPR);13844 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, sentinel), resultGPR); 13853 13845 done.link(&m_jit); 13854 13846 … … 13912 13904 JSValueRegs valueRegs = value.jsValueRegs(); 13913 13905 flushRegisters(); 13914 callOperation(operationThrowDFG, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs);13906 callOperation(operationThrowDFG, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs); 13915 13907 m_jit.exceptionCheck(); 13916 13908 m_jit.breakpoint(); … … 13924 13916 speculateString(node->child1(), messageGPR); 13925 13917 flushRegisters(); 13926 callOperation(operationThrowStaticError, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), messageGPR, node->errorType());13918 callOperation(operationThrowStaticError, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), messageGPR, node->errorType()); 13927 13919 m_jit.exceptionCheck(); 13928 13920 m_jit.breakpoint(); … … 14014 14006 JSValueRegsFlushedCallResult result(this); 14015 14007 JSValueRegs resultRegs = result.regs(); 14016 callOperation(operationEnumeratorNextUpdateIndexAndMode, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, indexGPR, modeGPR, enumeratorGPR);14008 callOperation(operationEnumeratorNextUpdateIndexAndMode, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, indexGPR, modeGPR, enumeratorGPR); 14017 14009 m_jit.exceptionCheck(); 14018 14010 jsValueResult(resultRegs, node); … … 14087 14079 14088 14080 outOfBounds.link(&m_jit); 14089 m_jit. move(TrustedImmPtr::weakPointer(m_graph, vm().smallStrings.sentinelString()), resultGPR);14081 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().smallStrings.sentinelString()), resultGPR); 14090 14082 doneCases.append(m_jit.jump()); 14091 14083 operationCall.link(&m_jit); 14092 14084 } 14093 14085 14094 callOperation(operationEnumeratorNextUpdatePropertyName, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), index, mode, enumerator);14086 callOperation(operationEnumeratorNextUpdatePropertyName, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), index, mode, enumerator); 14095 14087 m_jit.exceptionCheck(); 14096 14088 … … 14136 14128 14137 14129 if (baseRegs.tagGPR() == InvalidGPRReg) 14138 callOperation(slowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseRegs.payloadGPR()), propertyNameRegs, indexGPR, modeGPR);14130 callOperation(slowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseRegs.payloadGPR()), propertyNameRegs, indexGPR, modeGPR); 14139 14131 else 14140 callOperation(slowPathFunction, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyNameRegs, indexGPR, modeGPR);14132 callOperation(slowPathFunction, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, propertyNameRegs, indexGPR, modeGPR); 14141 14133 m_jit.exceptionCheck(); 14142 14134 … … 14252 14244 flushRegisters(); 14253 14245 callOperation(node->ecmaMode().isStrict() ? operationPutByIdWithThisStrict : operationPutByIdWithThis, 14254 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisRegs, valueRegs, node->cacheableIdentifier().rawBits());14246 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisRegs, valueRegs, node->cacheableIdentifier().rawBits()); 14255 14247 m_jit.exceptionCheck(); 14256 14248 … … 14333 14325 if (node->child1().useKind() == CellOrOtherUse) { 14334 14326 auto notOther = m_jit.branchIfNotOther(baseRegs, scratch1GPR); 14335 m_jit. move(TrustedImmPtr::weakPointer(m_graph, vm().emptyPropertyNameEnumerator()), scratch1GPR);14327 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().emptyPropertyNameEnumerator()), scratch1GPR); 14336 14328 doneCases.append(m_jit.jump()); 14337 14329 notOther.link(&m_jit); … … 14391 14383 slowCases.link(&m_jit); 14392 14384 silentSpillAllRegisters(scratch1GPR); 14393 callOperation(operationGetPropertyEnumeratorCell, scratch1GPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs.payloadGPR());14385 callOperation(operationGetPropertyEnumeratorCell, scratch1GPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs.payloadGPR()); 14394 14386 silentFillAllRegisters(); 14395 14387 m_jit.exceptionCheck(); … … 14406 14398 GPRFlushedCallResult result(this); 14407 14399 GPRReg resultGPR = result.gpr(); 14408 callOperation(operationGetPropertyEnumerator, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs);14400 callOperation(operationGetPropertyEnumerator, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs); 14409 14401 m_jit.exceptionCheck(); 14410 14402 cellResult(resultGPR, node); … … 14495 14487 GPRFlushedCallResult result(this); 14496 14488 if (node->child3()) 14497 callOperation(operationStrCat3, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs, op3Regs);14489 callOperation(operationStrCat3, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs, op3Regs); 14498 14490 else 14499 callOperation(operationStrCat2, result.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs);14491 callOperation(operationStrCat2, result.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), op1Regs, op2Regs); 14500 14492 m_jit.exceptionCheck(); 14501 14493 … … 14524 14516 emitAllocateJSObject<JSArray>(resultGPR, TrustedImmPtr(structure), TrustedImmPtr(array->toButterfly()), scratch1GPR, scratch2GPR, slowCases); 14525 14517 14526 addSlowPathGenerator(slowPathCall(slowCases, this, operationNewArrayBuffer, result.gpr(), TrustedImmPtr(&vm()), structure, TrustedImmPtr::weakPointer(m_graph, array)));14518 addSlowPathGenerator(slowPathCall(slowCases, this, operationNewArrayBuffer, result.gpr(), TrustedImmPtr(&vm()), structure, JITCompiler::LinkableConstant(m_graph, array))); 14527 14519 14528 14520 DFG_ASSERT(m_graph, node, indexingMode & IsArray, indexingMode); … … 14567 14559 m_jit.move(TrustedImmPtr(m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage))), structureGPR); 14568 14560 done.link(&m_jit); 14569 callOperation(operationNewArrayWithSize, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), structureGPR, sizeGPR, nullptr);14561 callOperation(operationNewArrayWithSize, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), structureGPR, sizeGPR, nullptr); 14570 14562 m_jit.exceptionCheck(); 14571 14563 cellResult(resultGPR, node); … … 14595 14587 callOperation( 14596 14588 operationNewTypedArrayWithOneArgumentForType(node->typedArrayType()), 14597 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), m_graph.registerStructure(globalObject->typedArrayStructureConcurrently(node->typedArrayType())), argumentRegs);14589 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), m_graph.registerStructure(globalObject->typedArrayStructureConcurrently(node->typedArrayType())), argumentRegs); 14598 14590 m_jit.exceptionCheck(); 14599 14591 … … 14630 14622 else 14631 14623 function = operationToThis; 14632 addSlowPathGenerator(slowPathCall(slowCases, this, function, tempRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), thisValueRegs));14624 addSlowPathGenerator(slowPathCall(slowCases, this, function, tempRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), thisValueRegs)); 14633 14625 14634 14626 jsValueResult(tempRegs, node); … … 14680 14672 addSlowPathGenerator(slowPathCall(slowButArrayBufferCases, this, operationNewArrayBuffer, resultGPR, TrustedImmPtr(&vm()), arrayStructure, scratch3GPR)); 14681 14673 14682 addSlowPathGenerator(slowPathCall(slowCases, this, node->op() == ObjectKeys ? operationObjectKeysObject : operationObjectGetOwnPropertyNamesObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR));14674 addSlowPathGenerator(slowPathCall(slowCases, this, node->op() == ObjectKeys ? operationObjectKeysObject : operationObjectGetOwnPropertyNamesObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR)); 14683 14675 14684 14676 cellResult(resultGPR, node); … … 14695 14687 GPRFlushedCallResult result(this); 14696 14688 GPRReg resultGPR = result.gpr(); 14697 callOperation(node->op() == ObjectKeys ? operationObjectKeysObject : operationObjectGetOwnPropertyNamesObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR);14689 callOperation(node->op() == ObjectKeys ? operationObjectKeysObject : operationObjectGetOwnPropertyNamesObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR); 14698 14690 m_jit.exceptionCheck(); 14699 14691 … … 14710 14702 GPRFlushedCallResult result(this); 14711 14703 GPRReg resultGPR = result.gpr(); 14712 callOperation(node->op() == ObjectKeys ? operationObjectKeys : operationObjectGetOwnPropertyNames, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectRegs);14704 callOperation(node->op() == ObjectKeys ? operationObjectKeys : operationObjectGetOwnPropertyNames, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectRegs); 14713 14705 m_jit.exceptionCheck(); 14714 14706 … … 14737 14729 14738 14730 flushRegisters(); 14739 callOperation(operationObjectAssignObject, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), targetGPR, sourceGPR);14731 callOperation(operationObjectAssignObject, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), targetGPR, sourceGPR); 14740 14732 m_jit.exceptionCheck(); 14741 14733 … … 14750 14742 14751 14743 flushRegisters(); 14752 callOperation(operationObjectAssignUntyped, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), targetGPR, sourceRegs);14744 callOperation(operationObjectAssignUntyped, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), targetGPR, sourceRegs); 14753 14745 m_jit.exceptionCheck(); 14754 14746 … … 14775 14767 GPRFlushedCallResult result(this); 14776 14768 GPRReg resultGPR = result.gpr(); 14777 callOperation(operationObjectCreateObject, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), prototypeGPR);14769 callOperation(operationObjectCreateObject, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), prototypeGPR); 14778 14770 m_jit.exceptionCheck(); 14779 14771 … … 14790 14782 GPRFlushedCallResult result(this); 14791 14783 GPRReg resultGPR = result.gpr(); 14792 callOperation(operationObjectCreate, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), prototypeRegs);14784 callOperation(operationObjectCreate, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), prototypeRegs); 14793 14785 m_jit.exceptionCheck(); 14794 14786 … … 14842 14834 m_jit.mutatorFence(vm()); 14843 14835 14844 addSlowPathGenerator(slowPathCall(slowPath, this, operationCreateThis, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), calleeGPR, node->inlineCapacity()));14836 addSlowPathGenerator(slowPathCall(slowPath, this, operationCreateThis, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), calleeGPR, node->inlineCapacity())); 14845 14837 14846 14838 cellResult(resultGPR, node); … … 14849 14841 void SpeculativeJIT::compileCreatePromise(Node* node) 14850 14842 { 14851 JSGlobalObject* globalObject = m_ jit.globalObjectFor(node->origin.semantic);14843 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic); 14852 14844 14853 14845 SpeculateCellOperand callee(this, node->child1()); … … 14867 14859 14868 14860 m_jit.move(TrustedImmPtr(m_graph.registerStructure(node->isInternalPromise() ? globalObject->internalPromiseStructure() : globalObject->promiseStructure())), structureGPR); 14869 auto fastPromisePath = m_jit.branch Ptr(CCallHelpers::Equal, calleeGPR, TrustedImmPtr::weakPointer(m_graph, node->isInternalPromise() ? globalObject->internalPromiseConstructor() : globalObject->promiseConstructor()));14861 auto fastPromisePath = m_jit.branchLinkableConstant(CCallHelpers::Equal, calleeGPR, JITCompiler::LinkableConstant(m_graph, node->isInternalPromise() ? globalObject->internalPromiseConstructor() : globalObject->promiseConstructor())); 14870 14862 14871 14863 MacroAssembler::JumpList slowCases; … … 14879 14871 m_jit.move(TrustedImmPtr(node->isInternalPromise() ? JSInternalPromise::info() : JSPromise::info()), scratch1GPR); 14880 14872 slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::classInfoOffset()))); 14881 m_jit. move(TrustedImmPtr::weakPointer(m_graph, globalObject), scratch1GPR);14873 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), scratch1GPR); 14882 14874 slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::globalObjectOffset()))); 14883 14875 … … 14892 14884 m_jit.mutatorFence(vm()); 14893 14885 14894 addSlowPathGenerator(slowPathCall(slowCases, this, node->isInternalPromise() ? operationCreateInternalPromise : operationCreatePromise, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject), calleeGPR));14886 addSlowPathGenerator(slowPathCall(slowCases, this, node->isInternalPromise() ? operationCreateInternalPromise : operationCreatePromise, resultGPR, JITCompiler::LinkableConstant(m_graph, globalObject), calleeGPR)); 14895 14887 14896 14888 cellResult(resultGPR, node); … … 14901 14893 void SpeculativeJIT::compileCreateInternalFieldObject(Node* node, Operation operation) 14902 14894 { 14903 JSGlobalObject* globalObject = m_ jit.globalObjectFor(node->origin.semantic);14895 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic); 14904 14896 14905 14897 SpeculateCellOperand callee(this, node->child1()); … … 14928 14920 m_jit.move(TrustedImmPtr(JSClass::info()), scratch1GPR); 14929 14921 slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::classInfoOffset()))); 14930 m_jit. move(TrustedImmPtr::weakPointer(m_graph, globalObject), scratch1GPR);14922 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), scratch1GPR); 14931 14923 slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::globalObjectOffset()))); 14932 14924 … … 14939 14931 m_jit.mutatorFence(vm()); 14940 14932 14941 addSlowPathGenerator(slowPathCall(slowCases, this, operation, resultGPR, TrustedImmPtr::weakPointer(m_graph, globalObject), calleeGPR));14933 addSlowPathGenerator(slowPathCall(slowCases, this, operation, resultGPR, JITCompiler::LinkableConstant(m_graph, globalObject), calleeGPR)); 14942 14934 14943 14935 cellResult(resultGPR, node); … … 15063 15055 m_jit.moveValueRegs(argumentRegs, resultRegs); 15064 15056 15065 addSlowPathGenerator(slowPathCall(notPrimitive, this, operationToPrimitive, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs));15057 addSlowPathGenerator(slowPathCall(notPrimitive, this, operationToPrimitive, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs)); 15066 15058 15067 15059 jsValueResult(resultRegs, node, DataFormatJS, UseChildrenCalledExplicitly); … … 15087 15079 m_jit.moveValueRegs(argumentRegs, resultRegs); 15088 15080 15089 addSlowPathGenerator(slowPathCall(slowCases, this, operationToPropertyKey, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs));15081 addSlowPathGenerator(slowPathCall(slowCases, this, operationToPropertyKey, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs)); 15090 15082 15091 15083 jsValueResult(resultRegs, node, DataFormatJSCell, UseChildrenCalledExplicitly); … … 15117 15109 m_jit.moveValueRegs(argumentRegs, resultRegs); 15118 15110 15119 addSlowPathGenerator(slowPathCall(slowCases, this, operationToNumeric, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs));15111 addSlowPathGenerator(slowPathCall(slowCases, this, operationToNumeric, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs)); 15120 15112 15121 15113 jsValueResult(resultRegs, node, DataFormatJS); … … 15152 15144 slowCases.append(m_jit.branchIfNotNumber(argumentRegs, tempGPR)); 15153 15145 m_jit.moveValueRegs(argumentRegs, resultRegs); 15154 addSlowPathGenerator(slowPathCall(slowCases, this, operationCallNumberConstructor, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs));15146 addSlowPathGenerator(slowPathCall(slowCases, this, operationCallNumberConstructor, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs)); 15155 15147 15156 15148 jsValueResult(resultRegs, node); … … 15219 15211 GPRFlushedCallResult result(this); 15220 15212 GPRReg resultGPR = result.gpr(); 15221 callOperation(operationSetAdd, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), setGPR, keyRegs, hashGPR);15213 callOperation(operationSetAdd, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), setGPR, keyRegs, hashGPR); 15222 15214 m_jit.exceptionCheck(); 15223 15215 cellResult(resultGPR, node); … … 15241 15233 GPRFlushedCallResult result(this); 15242 15234 GPRReg resultGPR = result.gpr(); 15243 callOperation(operationMapSet, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, valueRegs, hashGPR);15235 callOperation(operationMapSet, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, valueRegs, hashGPR); 15244 15236 m_jit.exceptionCheck(); 15245 15237 cellResult(resultGPR, node); … … 15460 15452 m_jit.emitLoadPrototype(vm(), objectGPR, resultRegs, slowCases); 15461 15453 addSlowPathGenerator(slowPathCall(slowCases, this, operationGetPrototypeOfObject, 15462 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR));15454 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR)); 15463 15455 15464 15456 jsValueResult(resultRegs, node); … … 15477 15469 m_jit.emitLoadPrototype(vm(), valueGPR, resultRegs, slowCases); 15478 15470 addSlowPathGenerator(slowPathCall(slowCases, this, operationGetPrototypeOf, 15479 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs));15471 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), valueRegs)); 15480 15472 15481 15473 jsValueResult(resultRegs, node); … … 15604 15596 addSlowPathGenerator(makeUnique<CallArrayAllocatorWithVariableSizeSlowPathGenerator>( 15605 15597 slowCases, this, operationNewArrayWithSize, resultGPR, 15606 TrustedImmPtr::weakPointer(m_graph, globalObject),15598 JITCompiler::LinkableConstant(m_graph, globalObject), 15607 15599 structure, 15608 15600 shouldConvertLargeSizeToArrayStorage ? m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage)) : structure, … … 15737 15729 } 15738 15730 15739 addSlowPathGenerator(slowPathCall(slowCases, this, slowPathOperation, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, indexGPR));15731 addSlowPathGenerator(slowPathCall(slowCases, this, slowPathOperation, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, indexGPR)); 15740 15732 } 15741 15733 … … 15862 15854 if (JITCode::useDataIC(JITType::DFGJIT)) { 15863 15855 slowPath = slowPathICCall( 15864 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), gen.slowPathFunction(), NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, valueRegs,15856 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), gen.slowPathFunction(), NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, valueRegs, 15865 15857 CCallHelpers::CellValue(baseGPR), identifier.rawBits()); 15866 15858 } else { 15867 15859 slowPath = slowPathCall( 15868 slowCases, this, gen.slowPathFunction(), NoResult, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), valueRegs,15860 slowCases, this, gen.slowPathFunction(), NoResult, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), valueRegs, 15869 15861 CCallHelpers::CellValue(baseGPR), identifier.rawBits()); 15870 15862 } … … 15895 15887 15896 15888 flushRegisters(); 15897 callOperation(helperFunction, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);15889 callOperation(helperFunction, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 15898 15890 m_jit.exceptionCheck(); 15899 15891 … … 15916 15908 15917 15909 if (!isKnownInteger(node->child1().node()) || !isKnownInteger(node->child2().node())) 15918 addSlowPathGenerator(slowPathCall(slowPath, this, helperFunction, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs));15910 addSlowPathGenerator(slowPathCall(slowPath, this, helperFunction, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs)); 15919 15911 15920 15912 unblessedBooleanResult(resultGPR, node, UseChildrenCalledExplicitly); … … 15956 15948 15957 15949 flushRegisters(); 15958 callOperation(helperFunction, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);15950 callOperation(helperFunction, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 15959 15951 m_jit.exceptionCheck(); 15960 15952 … … 15980 15972 15981 15973 silentSpillAllRegisters(resultGPR); 15982 callOperation(helperFunction, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);15974 callOperation(helperFunction, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 15983 15975 silentFillAllRegisters(); 15984 15976 m_jit.exceptionCheck(); … … 16020 16012 16021 16013 silentSpillAllRegisters(resultGPR); 16022 callOperation(operationCompareStrictEqCell, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR);16014 callOperation(operationCompareStrictEqCell, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), leftGPR, rightGPR); 16023 16015 silentFillAllRegisters(); 16024 16016 … … 16173 16165 auto isNonEmptyString = m_jit.branchTest32(CCallHelpers::NonZero, allocatorGPR); 16174 16166 16175 m_jit. move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(m_graph.m_vm)), resultGPR);16167 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), resultGPR); 16176 16168 16177 16169 isNonEmptyString.link(&m_jit); … … 16181 16173 case 2: 16182 16174 addSlowPathGenerator(slowPathCall( 16183 slowPath, this, operationMakeRope2, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1]));16175 slowPath, this, operationMakeRope2, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1])); 16184 16176 break; 16185 16177 case 3: 16186 16178 addSlowPathGenerator(slowPathCall( 16187 slowPath, this, operationMakeRope3, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1], opGPRs[2]));16179 slowPath, this, operationMakeRope3, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1], opGPRs[2])); 16188 16180 break; 16189 16181 default: … … 16199 16191 switch (numOpGPRs) { 16200 16192 case 2: 16201 callOperation(operationMakeRope2, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1]);16193 callOperation(operationMakeRope2, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1]); 16202 16194 m_jit.exceptionCheck(); 16203 16195 break; 16204 16196 case 3: 16205 callOperation(operationMakeRope3, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1], opGPRs[2]);16197 callOperation(operationMakeRope3, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), opGPRs[0], opGPRs[1], opGPRs[2]); 16206 16198 m_jit.exceptionCheck(); 16207 16199 break; … … 16306 16298 if (!recoverGenericCase.empty()) { 16307 16299 if (baseRegs.tagGPR() == InvalidGPRReg) 16308 addSlowPathGenerator(slowPathCall(recoverGenericCase, this, operationEnumeratorRecoverNameAndGetByVal, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseRegs.payloadGPR()), indexGPR, enumeratorGPR));16300 addSlowPathGenerator(slowPathCall(recoverGenericCase, this, operationEnumeratorRecoverNameAndGetByVal, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), CCallHelpers::CellValue(baseRegs.payloadGPR()), indexGPR, enumeratorGPR)); 16309 16301 else 16310 addSlowPathGenerator(slowPathCall(recoverGenericCase, this, operationEnumeratorRecoverNameAndGetByVal, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, indexGPR, enumeratorGPR));16302 addSlowPathGenerator(slowPathCall(recoverGenericCase, this, operationEnumeratorRecoverNameAndGetByVal, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, indexGPR, enumeratorGPR)); 16311 16303 } 16312 16304 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r292697 r293009 123 123 : m_value(value) 124 124 { 125 static_assert(!std::is_base_of<JSCell, T>::value, "To use a GC pointer, the graph must be aware of it. Use SpeculativeJIT:: TrustedImmPtr::weakPointerinstead.");125 static_assert(!std::is_base_of<JSCell, T>::value, "To use a GC pointer, the graph must be aware of it. Use SpeculativeJIT::JITCompiler::LinkableConstant instead."); 126 126 } 127 127 … … 143 143 : m_value(bitwise_cast<void*>(value)) 144 144 { 145 }146 147 static TrustedImmPtr weakPointer(Graph& graph, JSCell* cell)148 {149 graph.m_plan.weakReferences().addLazily(cell);150 return TrustedImmPtr(bitwise_cast<size_t>(cell));151 145 } 152 146 … … 981 975 } 982 976 983 JITCompiler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_G operation, GPRReg result, JSGlobalObject* globalObject)984 { 985 m_jit.setupArguments<Z_JITOperation_G>( TrustedImmPtr::weakPointer(m_graph, globalObject));977 JITCompiler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_G operation, GPRReg result, GPRReg globalObjectGPR) 978 { 979 m_jit.setupArguments<Z_JITOperation_G>(globalObjectGPR); 986 980 return appendCallWithCallFrameRollbackOnExceptionSetResult(operation, result); 987 981 } … … 1157 1151 { 1158 1152 return addBranch(m_jit.branchPtr(cond, left, right), destination); 1153 } 1154 1155 template<typename T, typename U> 1156 void branchLinkableConstant(JITCompiler::RelationalCondition cond, T left, U right, BasicBlock* destination) 1157 { 1158 return addBranch(m_jit.branchLinkableConstant(cond, left, right), destination); 1159 1159 } 1160 1160 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r292929 r293009 216 216 slowPath = slowPathCall( 217 217 slowCases, this, appropriateOptimizingGetByIdFunction(type), 218 JSValueRegs(resultTagGPR, resultPayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()),218 JSValueRegs(resultTagGPR, resultPayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), 219 219 CCallHelpers::CellValue(basePayloadGPR), 220 220 identifier.rawBits()); … … 222 222 slowPath = slowPathCall( 223 223 slowCases, this, appropriateOptimizingGetByIdFunction(type), 224 JSValueRegs(resultTagGPR, resultPayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseTagGPROrNone, basePayloadGPR), identifier.rawBits());224 JSValueRegs(resultTagGPR, resultPayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseTagGPROrNone, basePayloadGPR), identifier.rawBits()); 225 225 } 226 226 … … 252 252 slowPath = slowPathCall( 253 253 slowCases, this, operationGetByIdWithThisOptimize, 254 JSValueRegs(resultTagGPR, resultPayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()),254 JSValueRegs(resultTagGPR, resultPayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), 255 255 CCallHelpers::CellValue(basePayloadGPR), 256 256 CCallHelpers::CellValue(thisPayloadGPR), … … 262 262 slowPath = slowPathCall( 263 263 slowCases, this, operationGetByIdWithThisOptimize, 264 JSValueRegs(resultTagGPR, resultPayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseTagGPROrNone, basePayloadGPR), JSValueRegs(thisTagGPR, thisPayloadGPR), identifier.rawBits());264 JSValueRegs(resultTagGPR, resultPayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), JSValueRegs(baseTagGPROrNone, basePayloadGPR), JSValueRegs(thisTagGPR, thisPayloadGPR), identifier.rawBits()); 265 265 } 266 266 … … 290 290 GPRTemporary remoteGlobalObject(this); 291 291 292 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 293 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 294 292 295 if (!isKnownCell(operand.node())) 293 296 notCell = m_jit.branchIfNotCell(arg.jsValueRegs()); … … 302 305 303 306 isMasqueradesAsUndefined.link(&m_jit); 304 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 305 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 306 m_jit.move(TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 307 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 307 308 m_jit.loadPtr(JITCompiler::Address(argPayloadGPR, JSCell::structureIDOffset()), resultPayloadGPR); 308 309 m_jit.loadPtr(JITCompiler::Address(resultPayloadGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 358 359 GPRTemporary remoteGlobalObject(this); 359 360 361 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 362 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 363 360 364 if (!isKnownCell(operand.node())) 361 365 notCell = m_jit.branchIfNotCell(arg.jsValueRegs()); … … 366 370 invert ? taken : notTaken); 367 371 368 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 369 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 370 m_jit.move(TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 372 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 371 373 m_jit.loadPtr(JITCompiler::Address(argPayloadGPR, JSCell::structureIDOffset()), resultGPR); 372 374 m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 422 424 423 425 silentSpillAllRegisters(resultPayloadGPR); 424 callOperation(operationCompareStrictEqCell, resultPayloadGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1PayloadGPR, arg2PayloadGPR);426 callOperation(operationCompareStrictEqCell, resultPayloadGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1PayloadGPR, arg2PayloadGPR); 425 427 m_jit.exceptionCheck(); 426 428 silentFillAllRegisters(); … … 431 433 432 434 silentSpillAllRegisters(resultPayloadGPR); 433 callOperation(operationCompareStrictEq, resultPayloadGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);435 callOperation(operationCompareStrictEq, resultPayloadGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 434 436 m_jit.exceptionCheck(); 435 437 silentFillAllRegisters(); … … 470 472 471 473 silentSpillAllRegisters(resultPayloadGPR); 472 callOperation(operationCompareStrictEqCell, resultPayloadGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1PayloadGPR, arg2PayloadGPR);474 callOperation(operationCompareStrictEqCell, resultPayloadGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1PayloadGPR, arg2PayloadGPR); 473 475 m_jit.exceptionCheck(); 474 476 silentFillAllRegisters(); … … 481 483 482 484 silentSpillAllRegisters(resultPayloadGPR); 483 callOperation(operationCompareStrictEq, resultPayloadGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);485 callOperation(operationCompareStrictEq, resultPayloadGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 484 486 silentFillAllRegisters(); 485 487 m_jit.exceptionCheck(); … … 634 636 JITCompiler::Jump done = m_jit.jump(); 635 637 slowCase.link(&m_jit); 636 callOperation(operationThrowStackOverflowForVarargs, TrustedImmPtr::weakPointer(m_graph, globalObject));638 callOperation(operationThrowStackOverflowForVarargs, JITCompiler::LinkableConstant(m_graph, globalObject)); 637 639 m_jit.exceptionCheck(); 638 640 m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow); … … 666 668 // Right now, arguments is in argumentsTagGPR/argumentsPayloadGPR and the register file is 667 669 // flushed. 668 callOperation(operationSizeFrameForVarargs, GPRInfo::returnValueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(argumentsTagGPR, argumentsPayloadGPR), numUsedStackSlots, data->firstVarArgOffset);670 callOperation(operationSizeFrameForVarargs, GPRInfo::returnValueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(argumentsTagGPR, argumentsPayloadGPR), numUsedStackSlots, data->firstVarArgOffset); 669 671 m_jit.exceptionCheck(); 670 672 … … 676 678 m_jit.addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 6 * sizeof(void*)))), scratchGPR1, JITCompiler::stackPointerRegister); 677 679 678 callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scratchGPR1, JSValueRegs(argumentsTagGPR, argumentsPayloadGPR), data->firstVarArgOffset, GPRInfo::returnValueGPR);680 callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scratchGPR1, JSValueRegs(argumentsTagGPR, argumentsPayloadGPR), data->firstVarArgOffset, GPRInfo::returnValueGPR); 679 681 m_jit.exceptionCheck(); 680 682 m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister); … … 817 819 m_jit.subPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister); 818 820 m_jit.move(TrustedImm32(node->ecmaMode().value()), GPRInfo::regT1); 819 m_jit.setupArguments<decltype(operationCallEval)>( TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT0, GPRInfo::regT1);821 m_jit.setupArguments<decltype(operationCallEval)>(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT0, GPRInfo::regT1); 820 822 prepareForExternalCall(); 821 823 m_jit.appendCall(operationCallEval); … … 826 828 m_jit.addPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister); 827 829 m_jit.loadValue(JITCompiler::calleeFrameSlot(CallFrameSlot::callee), JSValueRegs { GPRInfo::regT1, GPRInfo::regT0 }); 828 m_jit. move(TrustedImmPtr(info), GPRInfo::regT2);829 m_jit. move(TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT3);830 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT3); 831 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant::nonCellPointer(m_graph, info), GPRInfo::regT2); 830 832 m_jit.emitVirtualCallWithoutMovingGlobalObject(vm(), GPRInfo::regT2, CallMode::Regular); 831 833 ASSERT(info->callMode() == CallMode::Regular); … … 933 935 } 934 936 935 m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT3); 937 ASSERT(!m_graph.m_plan.isUnlinked()); 938 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT3); 936 939 info->emitSlowPath(vm(), m_jit); 937 940 … … 1503 1506 m_jit.loadPtr(MacroAssembler::Address(valuePayloadGPR, JSCell::structureIDOffset()), structureGPR); 1504 1507 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1505 m_jit.branch Ptr(1508 m_jit.branchLinkableConstant( 1506 1509 MacroAssembler::Equal, 1507 1510 MacroAssembler::Address(structureGPR, Structure::globalObjectOffset()), 1508 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic))));1511 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)))); 1509 1512 1510 1513 isNotMasqueradesAsUndefined.link(&m_jit); … … 1628 1631 m_jit.loadPtr(MacroAssembler::Address(valuePayloadGPR, JSCell::structureIDOffset()), scratchGPR); 1629 1632 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1630 m_jit.branch Ptr(1633 m_jit.branchLinkableConstant( 1631 1634 MacroAssembler::Equal, 1632 1635 MacroAssembler::Address(scratchGPR, Structure::globalObjectOffset()), 1633 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic))));1636 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)))); 1634 1637 1635 1638 isNotMasqueradesAsUndefined.link(&m_jit); … … 1801 1804 else 1802 1805 flushRegisters(); 1803 callOperation(operationGetByVal, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs);1806 callOperation(operationGetByVal, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyRegs); 1804 1807 if (canUseFlush == CanUseFlush::No) 1805 1808 silentFillAllRegisters(); … … 1845 1848 slowPath = slowPathCall( 1846 1849 slowCases, this, operationGetByValOptimize, 1847 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, CCallHelpers::CellValue(baseRegs.payloadGPR()), propertyRegs);1850 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, CCallHelpers::CellValue(baseRegs.payloadGPR()), propertyRegs); 1848 1851 } else { 1849 1852 slowPath = slowPathCall( 1850 1853 slowCases, this, operationGetByValOptimize, 1851 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, baseRegs, propertyRegs);1854 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, baseRegs, propertyRegs); 1852 1855 } 1853 1856 … … 1946 1949 slowPathCall( 1947 1950 slowCases, this, operationGetByValObjectInt, 1948 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));1951 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 1949 1952 1950 1953 jsValueResult(resultRegs, node); … … 2012 2015 slowPathCall( 2013 2016 slowCases, this, operationGetByValObjectInt, 2014 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));2017 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 2015 2018 2016 2019 jsValueResult(resultRegs, node); … … 2069 2072 slowPathCall( 2070 2073 slowCases, this, operationGetByValObjectInt, 2071 resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));2074 resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 2072 2075 2073 2076 jsValueResult(resultRegs, node); … … 2656 2659 flushRegisters(); 2657 2660 callOperation(node->ecmaMode().isStrict() ? operationPutByValWithThisStrict : operationPutByValWithThis, 2658 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisRegs, propertyRegs, valueRegs);2661 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, thisRegs, propertyRegs, valueRegs); 2659 2662 m_jit.exceptionCheck(); 2660 2663 … … 2757 2760 slowPathCall( 2758 2761 slowCase, this, operationArrayPopAndRecoverLength, 2759 JSValueRegs(valueTagGPR, valuePayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));2762 JSValueRegs(valueTagGPR, valuePayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 2760 2763 2761 2764 jsValueResult(valueTagGPR, valuePayloadGPR, node); … … 2792 2795 slowPathCall( 2793 2796 slowCase, this, operationArrayPopAndRecoverLength, 2794 JSValueRegs(valueTagGPR, valuePayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));2797 JSValueRegs(valueTagGPR, valuePayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 2795 2798 2796 2799 jsValueResult(valueTagGPR, valuePayloadGPR, node); … … 2830 2833 slowPathCall( 2831 2834 slowCase, this, operationArrayPop, 2832 JSValueRegs(valueTagGPR, valuePayloadGPR), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));2835 JSValueRegs(valueTagGPR, valuePayloadGPR), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 2833 2836 2834 2837 jsValueResult(valueTagGPR, valuePayloadGPR, node); … … 2987 2990 if (!(m_state.forNode(node->child1()).m_type & SpecBytecodeNumber)) { 2988 2991 flushRegisters(); 2989 callOperation(operationToNumber, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs);2992 callOperation(operationToNumber, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs); 2990 2993 m_jit.exceptionCheck(); 2991 2994 } else { … … 3001 3004 notNumber.link(&m_jit); 3002 3005 silentSpillAllRegisters(resultRegs); 3003 callOperation(operationToNumber, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs);3006 callOperation(operationToNumber, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentRegs); 3004 3007 silentFillAllRegisters(); 3005 3008 m_jit.exceptionCheck(); … … 3510 3513 GPRTemporary localGlobalObject(this); 3511 3514 GPRTemporary remoteGlobalObject(this); 3515 3516 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 3517 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 3512 3518 3513 3519 JITCompiler::Jump isCell = m_jit.branchIfCell(value.jsValueRegs()); … … 3530 3536 3531 3537 isMasqueradesAsUndefined.link(&m_jit); 3532 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 3533 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 3534 m_jit.move(TrustedImmPtr::weakPointer(m_graph, m_jit.globalObjectFor(node->origin.semantic)), localGlobalObjectGPR); 3538 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), localGlobalObjectGPR); 3535 3539 m_jit.loadPtr(JITCompiler::Address(value.payloadGPR(), JSCell::structureIDOffset()), result.gpr()); 3536 3540 m_jit.loadPtr(JITCompiler::Address(result.gpr(), Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 3596 3600 GPRFlushedCallResult result(this); 3597 3601 GPRReg resultGPR = result.gpr(); 3598 callOperation(operationNumberIsInteger, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs);3602 callOperation(operationNumberIsInteger, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs); 3599 3603 booleanResult(resultGPR, node); 3600 3604 break; … … 3639 3643 GPRFlushedCallResult result(this); 3640 3644 GPRReg resultGPR = result.gpr(); 3641 callOperation(operationMapHash, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs);3645 callOperation(operationMapHash, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), inputRegs); 3642 3646 m_jit.exceptionCheck(); 3643 3647 strictInt32Result(resultGPR, node); … … 3670 3674 GPRReg resultGPR = result.gpr(); 3671 3675 if (node->child1().useKind() == MapObjectUse) 3672 callOperation(operationJSMapFindBucket, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, hashGPR);3676 callOperation(operationJSMapFindBucket, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, hashGPR); 3673 3677 else 3674 callOperation(operationJSSetFindBucket, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, hashGPR);3678 callOperation(operationJSSetFindBucket, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyRegs, hashGPR); 3675 3679 m_jit.exceptionCheck(); 3676 3680 cellResult(resultGPR, node); … … 3931 3935 keyRegs = JSValueRegs(tempGPR, keyRegs.payloadGPR()); 3932 3936 } 3933 callOperation(operationHasOwnProperty, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR, keyRegs);3937 callOperation(operationHasOwnProperty, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR, keyRegs); 3934 3938 silentFillAllRegisters(); 3935 3939 m_jit.exceptionCheck(); … … 4219 4223 void SpeculativeJIT::compileArithRandom(Node* node) 4220 4224 { 4221 JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);4222 4223 4225 flushRegisters(); 4224 4226 4225 4227 FPRResult result(this); 4226 callOperation(operationRandom, result.fpr(), TrustedImmPtr::weakPointer(m_graph, globalObject));4228 callOperation(operationRandom, result.fpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic))); 4227 4229 // operationRandom does not raise any exception. 4228 4230 doubleResult(result.fpr(), node); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r292929 r293009 182 182 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), appropriateOptimizingGetByIdFunction(type), 183 183 spillMode, ExceptionCheckRequirement::CheckNeeded, 184 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseGPR, identifier.rawBits());184 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseGPR, identifier.rawBits()); 185 185 } else { 186 186 slowPath = slowPathCall( 187 187 slowCases, this, appropriateOptimizingGetByIdFunction(type), 188 188 spillMode, ExceptionCheckRequirement::CheckNeeded, 189 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseGPR, identifier.rawBits());189 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseGPR, identifier.rawBits()); 190 190 } 191 191 … … 222 222 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationGetByIdWithThisOptimize, 223 223 DontSpill, ExceptionCheckRequirement::CheckNeeded, 224 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseGPR, thisGPR, identifier.rawBits());224 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, baseGPR, thisGPR, identifier.rawBits()); 225 225 } else { 226 226 slowPath = slowPathCall( 227 227 slowCases, this, operationGetByIdWithThisOptimize, 228 228 DontSpill, ExceptionCheckRequirement::CheckNeeded, 229 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseGPR, thisGPR, identifier.rawBits());229 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), baseGPR, thisGPR, identifier.rawBits()); 230 230 } 231 231 … … 264 264 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 265 265 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 266 m_jit. move(TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR);266 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 267 267 m_jit.emitLoadStructure(vm(), argGPR, resultGPR); 268 268 m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 306 306 GPRTemporary remoteGlobalObject(this); 307 307 308 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 309 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 310 308 311 JITCompiler::Jump notCell; 309 312 if (!isKnownCell(operand.node())) … … 314 317 JITCompiler::TrustedImm32(MasqueradesAsUndefined), notTaken); 315 318 316 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 317 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 318 m_jit.move(TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 319 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), localGlobalObjectGPR); 319 320 m_jit.emitLoadStructure(vm(), argGPR, resultGPR); 320 321 m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 459 460 460 461 silentSpillAllRegisters(resultGPR); 461 callOperation(operationCompareStrictEqCell, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR);462 callOperation(operationCompareStrictEqCell, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR); 462 463 silentFillAllRegisters(); 463 464 m_jit.exceptionCheck(); … … 510 511 jump(invert ? taken : notTaken, ForceJump); 511 512 512 addSlowPathGenerator(slowPathCall(slowPathCases, this, operationCompareStrictEq, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR));513 addSlowPathGenerator(slowPathCall(slowPathCases, this, operationCompareStrictEq, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1GPR, arg2GPR)); 513 514 branchTest32(invert ? JITCompiler::Zero : JITCompiler::NonZero, resultGPR, taken); 514 515 } … … 548 549 549 550 silentSpillAllRegisters(resultGPR); 550 callOperation(operationCompareStrictEqCell, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs);551 callOperation(operationCompareStrictEqCell, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs); 551 552 silentFillAllRegisters(); 552 553 m_jit.exceptionCheck(); … … 604 605 m_jit.move(TrustedImm64(0), resultGPR); 605 606 606 addSlowPathGenerator(slowPathCall(slowPathCases, this, operationCompareStrictEq, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs));607 addSlowPathGenerator(slowPathCall(slowPathCases, this, operationCompareStrictEq, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), arg1Regs, arg2Regs)); 607 608 608 609 done.link(&m_jit); … … 698 699 GPRReg calleeGPR = InvalidGPRReg; 699 700 GPRReg callLinkInfoGPR = InvalidGPRReg; 701 GPRReg globalObjectGPR = InvalidGPRReg; 700 702 CallFrameShuffleData shuffleData; 701 703 … … 744 746 JITCompiler::Jump done = m_jit.jump(); 745 747 slowCase.link(&m_jit); 746 callOperation(operationThrowStackOverflowForVarargs, TrustedImmPtr::weakPointer(m_graph, globalObject));748 callOperation(operationThrowStackOverflowForVarargs, JITCompiler::LinkableConstant(m_graph, globalObject)); 747 749 m_jit.exceptionCheck(); 748 750 m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow); … … 773 775 774 776 // Right now, arguments is in argumentsGPR and the register file is flushed. 775 callOperation(operationSizeFrameForVarargs, GPRInfo::returnValueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsGPR, numUsedStackSlots, data->firstVarArgOffset);777 callOperation(operationSizeFrameForVarargs, GPRInfo::returnValueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentsGPR, numUsedStackSlots, data->firstVarArgOffset); 776 778 m_jit.exceptionCheck(); 777 779 … … 783 785 m_jit.addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 5 * sizeof(void*)))), scratchGPR1, JITCompiler::stackPointerRegister); 784 786 785 callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scratchGPR1, argumentsGPR, data->firstVarArgOffset, GPRInfo::returnValueGPR);787 callOperation(operationSetupVarargsFrame, GPRInfo::returnValueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), scratchGPR1, argumentsGPR, data->firstVarArgOffset, GPRInfo::returnValueGPR); 786 788 m_jit.exceptionCheck(); 787 789 m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister); … … 830 832 calleeGPR = callee.gpr(); 831 833 832 // callLinkInfoGPR must be non callee-save register. Otherwise, tail-call preparation will fill it834 // callLinkInfoGPR/globalObjectGPR must be non callee-save register. Otherwise, tail-call preparation will fill it 833 835 // with saved callee-save. Also, it should not be the same to calleeGPR and regT0 since both will 834 836 // be used later differently. … … 836 838 // 1. We do not want to keep the register locked in the following sequence of the Call. 837 839 // 2. This must be the last register allocation from DFG register bank, so it is OK (otherwise, callee.use() is wrong). 838 if (callLinkInfo->isDataIC()) { 839 GPRTemporary callLinkInfoTemp(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0)); 840 callLinkInfoGPR = callLinkInfoTemp.gpr(); 840 // if (callLinkInfo->isDataIC() || m_graph.m_plan.isUnlinked()) { 841 if (!isDirect) { 842 std::optional<GPRTemporary> callLinkInfoTemp; 843 std::optional<GPRTemporary> globalObjectTemp; 844 if (callLinkInfo->isDataIC()) { 845 callLinkInfoTemp.emplace(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0, GPRInfo::regT3)); 846 callLinkInfoGPR = callLinkInfoTemp->gpr(); 847 } 848 // Regardless of whether we are using DataIC, we need globalObjectGPR. 849 if (node->op() == TailCall) { 850 globalObjectTemp.emplace(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0, callLinkInfoGPR)); 851 globalObjectGPR = globalObjectTemp->gpr(); 852 } 841 853 } 842 854 if (!isDirect) … … 893 905 // 2. This must be the last register allocation from DFG register bank, so it is OK (otherwise, callee.use() is wrong). 894 906 if (callLinkInfo->isDataIC()) { 895 GPRTemporary callLinkInfoTemp(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0 ));907 GPRTemporary callLinkInfoTemp(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0, GPRInfo::regT3)); 896 908 callLinkInfoGPR = callLinkInfoTemp.gpr(); 897 909 } … … 944 956 m_jit.subPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister); 945 957 m_jit.move(TrustedImm32(node->ecmaMode().value()), GPRInfo::regT1); 946 m_jit.setupArguments<decltype(operationCallEval)>( TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT0, GPRInfo::regT1);958 m_jit.setupArguments<decltype(operationCallEval)>(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT0, GPRInfo::regT1); 947 959 prepareForExternalCall(); 948 960 m_jit.appendCall(operationCallEval); … … 953 965 m_jit.addPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister); 954 966 m_jit.load64(JITCompiler::calleeFrameSlot(CallFrameSlot::callee), GPRInfo::regT0); 955 m_jit. move(TrustedImmPtr(callLinkInfo), GPRInfo::regT2);956 m_jit. move(TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT3);967 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT3); 968 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant::nonCellPointer(m_graph, callLinkInfo), GPRInfo::regT2); 957 969 m_jit.emitVirtualCallWithoutMovingGlobalObject(vm(), GPRInfo::regT2, CallMode::Regular); 958 970 ASSERT(callLinkInfo->callMode() == CallMode::Regular); … … 1015 1027 1016 1028 CCallHelpers::JumpList slowCases; 1029 std::optional<CCallHelpers::Jump> done; 1017 1030 if (isTail) { 1018 1031 slowCases = callLinkInfo->emitTailCallFastPath(m_jit, calleeGPR, callLinkInfoGPR, scopedLambda<void()>([&]{ … … 1025 1038 } 1026 1039 })); 1027 } else 1040 } else { 1028 1041 slowCases = callLinkInfo->emitFastPath(m_jit, calleeGPR, callLinkInfoGPR); 1029 JITCompiler::Jump done = m_jit.jump(); 1042 done = m_jit.jump(); 1043 } 1030 1044 1031 1045 slowCases.link(&m_jit); … … 1033 1047 1034 1048 if (node->op() == TailCall) { 1049 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), globalObjectGPR); 1050 shuffleData.registers[GPRInfo::regT3] = ValueRecovery::inGPR(globalObjectGPR, DataFormatJS); 1035 1051 CallFrameShuffler callFrameShuffler(m_jit, shuffleData); 1036 1052 callFrameShuffler.setCalleeJSValueRegs(JSValueRegs(GPRInfo::regT0)); … … 1038 1054 } else { 1039 1055 m_jit.move(calleeGPR, GPRInfo::regT0); // Callee needs to be in regT0 1056 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), GPRInfo::regT3); // JSGlobalObject needs to be in regT3 1040 1057 if (isTail) 1041 1058 m_jit.emitRestoreCalleeSaves(); // This needs to happen after we moved calleeGPR to regT0 1042 1059 } 1043 1060 1044 m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT3); // JSGlobalObject needs to be in regT31045 1061 callLinkInfo->emitSlowPath(vm(), m_jit); 1046 1062 1047 done.link(&m_jit); 1063 if (done) 1064 done->link(&m_jit); 1048 1065 auto doneLocation = m_jit.label(); 1049 1066 … … 1927 1944 GPRReg resultGPR = result.gpr(); 1928 1945 1929 m_jit. move(TrustedImmPtr::weakPointer(m_graph, node->cellOperand()->cell()), resultGPR);1946 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), resultGPR); 1930 1947 m_jit.compare64(MacroAssembler::Equal, valueGPR, resultGPR, resultGPR); 1931 1948 unblessedBooleanResult(resultGPR, node); … … 1968 1985 m_jit.emitLoadStructure(vm(), valueGPR, structureGPR); 1969 1986 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 1970 m_jit.branch Ptr(1987 m_jit.branchLinkableConstant( 1971 1988 MacroAssembler::Equal, 1972 1989 MacroAssembler::Address(structureGPR, Structure::globalObjectOffset()), 1973 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic))));1990 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)))); 1974 1991 1975 1992 isNotMasqueradesAsUndefined.link(&m_jit); … … 2123 2140 m_jit.emitLoadStructure(vm(), valueGPR, structureGPR); 2124 2141 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 2125 m_jit.branch Ptr(2142 m_jit.branchLinkableConstant( 2126 2143 MacroAssembler::Equal, 2127 2144 MacroAssembler::Address(structureGPR, Structure::globalObjectOffset()), 2128 TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic))));2145 JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)))); 2129 2146 2130 2147 isNotMasqueradesAsUndefined.link(&m_jit); … … 2192 2209 skipStringCase = m_jit.branchIfNotString(valueGPR); 2193 2210 2194 branch Ptr(MacroAssembler::Equal, valueGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);2211 branchLinkableConstant(MacroAssembler::Equal, valueGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken); 2195 2212 jump(taken, ForceJump); 2196 2213 … … 2216 2233 branchTest8(MacroAssembler::Zero, MacroAssembler::Address(valueGPR, JSCell::typeInfoFlagsOffset()), TrustedImm32(MasqueradesAsUndefined), taken); 2217 2234 m_jit.emitLoadStructure(vm(), valueGPR, temp1GPR); 2218 JSGlobalObject* globalObject = m_graph.globalObjectFor(m_currentNode->origin.semantic); 2219 m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), temp2GPR); 2235 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(m_currentNode->origin.semantic)), temp2GPR); 2220 2236 branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp1GPR, Structure::globalObjectOffset()), temp2GPR, taken); 2221 2237 jump(notTaken, ForceJump); … … 2415 2431 else 2416 2432 flushRegisters(); 2417 callOperation(operationGetByVal, resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR);2433 callOperation(operationGetByVal, resultRegs, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, propertyGPR); 2418 2434 if (canUseFlush == CanUseFlush::No) 2419 2435 silentFillAllRegisters(); … … 2471 2487 slowPath = slowPathICCall( 2472 2488 slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationGetByValOptimize, 2473 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, nullptr, baseGPR, propertyGPR);2489 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), stubInfoGPR, nullptr, baseGPR, propertyGPR); 2474 2490 } else { 2475 2491 slowPath = slowPathCall( 2476 2492 slowCases, this, operationGetByValOptimize, 2477 resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, baseGPR, propertyGPR);2493 resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(codeOrigin)), TrustedImmPtr(gen.stubInfo()), nullptr, baseGPR, propertyGPR); 2478 2494 } 2479 2495 … … 2550 2566 slowPathCall( 2551 2567 slowCases, this, operationGetByValObjectInt, 2552 resultReg, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));2568 resultReg, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 2553 2569 } 2554 2570 … … 2642 2658 slowPathCall( 2643 2659 slowCases, this, operationGetByValObjectInt, 2644 resultRegs.gpr(), TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));2660 resultRegs.gpr(), JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 2645 2661 jsValueResult(resultRegs.gpr(), node); 2646 2662 } … … 2700 2716 slowPathCall( 2701 2717 slowCases, this, operationGetByValObjectInt, 2702 resultReg, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg));2718 resultReg, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseReg, propertyReg)); 2703 2719 2704 2720 jsValueResult(resultReg, node); … … 2806 2822 ptrdiff_t offset = JSGlobalObject::regExpGlobalDataOffset() + RegExpGlobalData::offsetOfCachedResult(); 2807 2823 2808 m_jit.store Ptr(TrustedImmPtr::weakPointer(m_graph, regExp), JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfLastRegExp()));2824 m_jit.storeLinkableConstant(JITCompiler::LinkableConstant(m_graph, regExp), JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfLastRegExp())); 2809 2825 m_jit.storePtr(argumentGPR, JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfLastInput())); 2810 2826 m_jit.store32(yarrRegisters.returnRegister, JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfResult() + OBJECT_OFFSETOF(MatchResult, start))); … … 3531 3547 if (!storageEdge) { 3532 3548 auto callSlowPath = [&] () { 3533 auto globalObjectImmPtr = TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic));3549 auto globalObjectImmPtr = JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)); 3534 3550 switch (node->op()) { 3535 3551 case AtomicsAdd: … … 3740 3756 GPRFlushedCallResult result(this); 3741 3757 GPRReg resultGPR = result.gpr(); 3742 callOperation(operationAtomicsIsLockFree, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandGPR);3758 callOperation(operationAtomicsIsLockFree, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), operandGPR); 3743 3759 m_jit.exceptionCheck(); 3744 3760 jsValueResult(resultGPR, node); … … 3882 3898 addSlowPathGenerator( 3883 3899 slowPathCall( 3884 slowCase, this, operationArrayPopAndRecoverLength, valueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));3900 slowCase, this, operationArrayPopAndRecoverLength, valueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 3885 3901 3886 3902 // We can't know for sure that the result is an int because of the slow paths. :-/ … … 3915 3931 addSlowPathGenerator( 3916 3932 slowPathCall( 3917 slowCases, this, operationArrayPop, valueGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR));3933 slowCases, this, operationArrayPop, valueGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR)); 3918 3934 3919 3935 jsValueResult(valueGPR, node); … … 4041 4057 if (!(m_state.forNode(node->child1()).m_type & SpecBytecodeNumber)) { 4042 4058 flushRegisters(); 4043 callOperation(operationToNumber, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentGPR);4059 callOperation(operationToNumber, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentGPR); 4044 4060 m_jit.exceptionCheck(); 4045 4061 } else { … … 4050 4066 notNumber.link(&m_jit); 4051 4067 silentSpillAllRegisters(resultGPR); 4052 callOperation(operationToNumber, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentGPR);4068 callOperation(operationToNumber, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), argumentGPR); 4053 4069 silentFillAllRegisters(); 4054 4070 m_jit.exceptionCheck(); … … 4540 4556 4541 4557 flushRegisters(); 4542 callOperation(node->ecmaMode().isStrict() ? operationPutByValWithThisStrict : operationPutByValWithThis, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, thisValueGPR, propertyGPR, valueGPR);4558 callOperation(node->ecmaMode().isStrict() ? operationPutByValWithThisStrict : operationPutByValWithThis, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseGPR, thisValueGPR, propertyGPR, valueGPR); 4543 4559 m_jit.exceptionCheck(); 4544 4560 … … 4678 4694 GPRReg localGlobalObjectGPR = localGlobalObject.gpr(); 4679 4695 GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr(); 4680 m_jit. move(TrustedImmPtr::weakPointer(m_graph, m_jit.globalObjectFor(node->origin.semantic)), localGlobalObjectGPR);4696 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), localGlobalObjectGPR); 4681 4697 m_jit.emitLoadStructure(vm(), value.gpr(), result.gpr()); 4682 4698 m_jit.loadPtr(JITCompiler::Address(result.gpr(), Structure::globalObjectOffset()), remoteGlobalObjectGPR); … … 4883 4899 slowPath.link(&m_jit); 4884 4900 silentSpillAllRegisters(resultGPR); 4885 callOperation(operationMapHash, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(inputGPR));4901 callOperation(operationMapHash, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(inputGPR)); 4886 4902 silentFillAllRegisters(); 4887 4903 m_jit.exceptionCheck(); … … 4928 4944 slowPath.link(&m_jit); 4929 4945 silentSpillAllRegisters(resultGPR); 4930 callOperation(operationMapHash, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(inputGPR));4946 callOperation(operationMapHash, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), JSValueRegs(inputGPR)); 4931 4947 silentFillAllRegisters(); 4932 4948 m_jit.exceptionCheck(); … … 5076 5092 silentSpillAllRegisters(indexGPR); 5077 5093 if (node->child1().useKind() == MapObjectUse) 5078 callOperation(operationJSMapFindBucket, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyGPR, hashGPR);5094 callOperation(operationJSMapFindBucket, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyGPR, hashGPR); 5079 5095 else 5080 callOperation(operationJSSetFindBucket, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyGPR, hashGPR);5096 callOperation(operationJSSetFindBucket, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), mapGPR, keyGPR, hashGPR); 5081 5097 silentFillAllRegisters(); 5082 5098 m_jit.exceptionCheck(); … … 5086 5102 notPresentInTable.link(&m_jit); 5087 5103 if (node->child1().useKind() == MapObjectUse) 5088 m_jit. move(TrustedImmPtr::weakPointer(m_graph, vm().sentinelMapBucket()), resultGPR);5104 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().sentinelMapBucket()), resultGPR); 5089 5105 else 5090 m_jit. move(TrustedImmPtr::weakPointer(m_graph, vm().sentinelSetBucket()), resultGPR);5106 m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().sentinelSetBucket()), resultGPR); 5091 5107 done.link(&m_jit); 5092 5108 cellResult(resultGPR, node); … … 5391 5407 slowPath.link(&m_jit); 5392 5408 silentSpillAllRegisters(resultGPR); 5393 callOperation(operationHasOwnProperty, resultGPR, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR, keyGPR);5409 callOperation(operationHasOwnProperty, resultGPR, JITCompiler::LinkableConstant(m_graph, m_graph.globalObjectFor(node->origin.semantic)), objectGPR, keyGPR); 5394 5410 silentFillAllRegisters(); 5395 5411 m_jit.exceptionCheck(); -
trunk/Source/JavaScriptCore/dfg/DFGThunks.cpp
r292447 r293009 168 168 jit.restoreCalleeSavesFromEntryFrameCalleeSavesBuffer(vm.topEntryFrame); 169 169 jit.emitMaterializeTagCheckRegisters(); 170 #if USE(JSVALUE64) 171 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::codeBlock, GPRInfo::constantsRegister); 172 jit.loadPtr(CCallHelpers::Address(GPRInfo::constantsRegister, CodeBlock::offsetOfJITData()), GPRInfo::constantsRegister); 173 #endif 170 174 171 175 jit.farJump(GPRInfo::regT1, GPRInfo::callFrameRegister); -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
r292447 r293009 45 45 46 46 namespace JSC { 47 48 ExecutableBase* AssemblyHelpers::executableFor(CodeBlock* codeBlock, const CodeOrigin& codeOrigin)49 {50 auto* inlineCallFrame = codeOrigin.inlineCallFrame();51 if (!inlineCallFrame)52 return codeBlock->ownerExecutable();53 return inlineCallFrame->baselineCodeBlock->ownerExecutable();54 }55 47 56 48 AssemblyHelpers::Jump AssemblyHelpers::branchIfFastTypedArray(GPRReg baseGPR) -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r292457 r293009 1546 1546 #endif 1547 1547 1548 JSGlobalObject* globalObjectFor(CodeOrigin codeOrigin)1549 {1550 return codeBlock()->globalObjectFor(codeOrigin);1551 }1552 1553 ExecutableBase* executableFor(CodeBlock*, const CodeOrigin&);1554 1555 1548 CodeBlock* baselineCodeBlockFor(const CodeOrigin& codeOrigin) 1556 1549 { -
trunk/Source/JavaScriptCore/jit/CCallHelpers.h
r292445 r293009 70 70 }; 71 71 72 // Base class for constant materializers. 73 // It offers DerivedClass::materialize and poke functions. 74 class ConstantMaterializer { }; 75 72 76 // The most general helper for setting arguments that fit in a GPR, if you can compute each 73 77 // argument without using any argument registers. You usually want one of the setupArguments*() … … 366 370 { 367 371 unsigned pokeOffset = calculatePokeOffset(currentGPRArgument, currentFPRArgument, numCrossSources, extraGPRArgs, nonArgGPRs, extraPoke); 368 poke(arg, pokeOffset); 372 if constexpr (std::is_base_of_v<ConstantMaterializer, ArgType>) 373 arg.store(*this, addressForPoke(pokeOffset)); 374 else 375 poke(arg, pokeOffset); 369 376 } 370 377 … … 645 652 { 646 653 setupArgumentsImpl<OperationType>(argSourceRegs, TrustedImmPtr(arg.get()), args...); 654 } 655 656 template<typename OperationType, unsigned numGPRArgs, unsigned numGPRSources, unsigned numFPRArgs, unsigned numFPRSources, unsigned numCrossSources, unsigned extraGPRArgs, unsigned nonArgGPRs, unsigned extraPoke, typename Arg, typename... Args> 657 ALWAYS_INLINE std::enable_if_t<std::is_base_of_v<ConstantMaterializer, Arg>> 658 setupArgumentsImpl(ArgCollection<numGPRArgs, numGPRSources, numFPRArgs, numFPRSources, numCrossSources, extraGPRArgs, nonArgGPRs, extraPoke> argSourceRegs, Arg arg, Args... args) 659 { 660 static_assert(!std::is_floating_point<CURRENT_ARGUMENT_TYPE>::value, "We don't support immediate floats/doubles in setupArguments"); 661 auto numArgRegisters = GPRInfo::numberOfArgumentRegisters; 662 #if OS(WINDOWS) && CPU(X86_64) 663 auto currentArgCount = numGPRArgs + numFPRArgs + (std::is_same<RESULT_TYPE, SlowPathReturnType>::value ? 1 : 0); 664 #else 665 auto currentArgCount = numGPRArgs + extraGPRArgs; 666 #endif 667 if (currentArgCount < numArgRegisters) { 668 setupArgumentsImpl<OperationType>(argSourceRegs.addGPRArg(), args...); 669 arg.materialize(*this, GPRInfo::toArgumentRegister(currentArgCount)); 670 return; 671 } 672 673 pokeForArgument(arg, numGPRArgs, numFPRArgs, numCrossSources, extraGPRArgs, nonArgGPRs, extraPoke); 674 setupArgumentsImpl<OperationType>(argSourceRegs.addGPRArg(), args...); 647 675 } 648 676 -
trunk/Source/JavaScriptCore/jit/GPRInfo.h
r292080 r293009 421 421 public: 422 422 typedef GPRReg RegisterType; 423 static constexpr unsigned numberOfRegisters = 1 1;423 static constexpr unsigned numberOfRegisters = 10; 424 424 static constexpr unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS; 425 425 … … 428 428 static constexpr GPRReg numberTagRegister = X86Registers::r14; 429 429 static constexpr GPRReg notCellMaskRegister = X86Registers::r15; 430 static constexpr GPRReg constantsRegister = X86Registers::r13; 430 431 431 432 // Temporary registers. … … 451 452 #if !OS(WINDOWS) 452 453 static constexpr GPRReg regCS1 = X86Registers::r12; 453 static constexpr GPRReg regCS2 = X86Registers::r13; 454 static constexpr GPRReg regCS3 = X86Registers::r14; 455 static constexpr GPRReg regCS4 = X86Registers::r15; 454 static constexpr GPRReg regCS2 = X86Registers::r13; // constantsRegister 455 static constexpr GPRReg regCS3 = X86Registers::r14; // numberTagRegister 456 static constexpr GPRReg regCS4 = X86Registers::r15; // notCellMaskRegister 456 457 #else 457 458 static constexpr GPRReg regCS1 = X86Registers::esi; 458 459 static constexpr GPRReg regCS2 = X86Registers::edi; 459 460 static constexpr GPRReg regCS3 = X86Registers::r12; 460 static constexpr GPRReg regCS4 = X86Registers::r13; 461 static constexpr GPRReg regCS5 = X86Registers::r14; 462 static constexpr GPRReg regCS6 = X86Registers::r15; 461 static constexpr GPRReg regCS4 = X86Registers::r13; // constantsRegister 462 static constexpr GPRReg regCS5 = X86Registers::r14; // numberTagRegister 463 static constexpr GPRReg regCS6 = X86Registers::r15; // notCellMaskRegister 463 464 #endif 464 465 … … 498 499 ASSERT(index < numberOfRegisters); 499 500 #if !OS(WINDOWS) 500 static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regT6, regT7, regCS0, regCS1 , regCS2};501 static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regT6, regT7, regCS0, regCS1 }; 501 502 #else 502 static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regCS0, regCS1, regCS2, regCS3 , regCS4};503 static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regCS0, regCS1, regCS2, regCS3 }; 503 504 #endif 504 505 return registerForIndex[index]; … … 635 636 static constexpr GPRReg numberTagRegister = ARM64Registers::x27; 636 637 static constexpr GPRReg notCellMaskRegister = ARM64Registers::x28; 638 static constexpr GPRReg constantsRegister = ARM64Registers::x26; 637 639 static constexpr GPRReg dataTempRegister = MacroAssembler::dataTempRegister; 638 640 static constexpr GPRReg memoryTempRegister = MacroAssembler::memoryTempRegister; … … 661 663 static constexpr GPRReg regCS5 = ARM64Registers::x24; // Used by FTL only 662 664 static constexpr GPRReg regCS6 = ARM64Registers::x25; 663 static constexpr GPRReg regCS7 = ARM64Registers::x26; 665 static constexpr GPRReg regCS7 = ARM64Registers::x26; // constants 664 666 static constexpr GPRReg regCS8 = ARM64Registers::x27; // numberTag 665 667 static constexpr GPRReg regCS9 = ARM64Registers::x28; // notCellMask … … 778 780 static constexpr GPRReg nonPreservedNonReturnGPR = regT2; 779 781 static constexpr GPRReg regCS0 = MIPSRegisters::s0; 780 static constexpr GPRReg regCS1 = MIPSRegisters::s1; 782 static constexpr GPRReg regCS1 = MIPSRegisters::s1; // constants 781 783 782 784 static GPRReg toRegister(unsigned index) … … 833 835 static constexpr GPRReg numberTagRegister = RISCV64Registers::x25; 834 836 static constexpr GPRReg notCellMaskRegister = RISCV64Registers::x26; 837 static constexpr GPRReg constantsRegister = RISCV64Registers::x24; 835 838 836 839 static constexpr GPRReg regT0 = RISCV64Registers::x10; … … 855 858 static constexpr GPRReg regCS5 = RISCV64Registers::x22; 856 859 static constexpr GPRReg regCS6 = RISCV64Registers::x23; 857 static constexpr GPRReg regCS7 = RISCV64Registers::x24; 860 static constexpr GPRReg regCS7 = RISCV64Registers::x24; // constants 858 861 static constexpr GPRReg regCS8 = RISCV64Registers::x25; // numberTag 859 862 static constexpr GPRReg regCS9 = RISCV64Registers::x26; // notCellMask -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r292767 r293009 238 238 239 239 #if ASSERT_ENABLED 240 if (opcodeID != op_catch) 240 if (opcodeID != op_catch) { 241 loadPtr(addressFor(CallFrameSlot::codeBlock), regT0); 242 loadPtr(Address(regT0, CodeBlock::offsetOfMetadataTable()), regT1); 243 loadPtr(Address(regT0, CodeBlock::offsetOfJITData()), regT2); 244 241 245 m_consistencyCheckCalls.append(nearCall()); 246 } 242 247 #endif 243 248 … … 651 656 loadPtr(addressFor(CallFrameSlot::codeBlock), regT0); 652 657 loadPtr(Address(regT0, CodeBlock::offsetOfMetadataTable()), s_metadataGPR); 653 loadPtr(Address(regT0, CodeBlock::offsetOf BaselineJITData()), s_constantsGPR);658 loadPtr(Address(regT0, CodeBlock::offsetOfJITData()), s_constantsGPR); 654 659 } 655 660 … … 684 689 jit.loadPtr(addressFor(CallFrameSlot::codeBlock), expectedConstantsGPR); 685 690 jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOfMetadataTable()), expectedMetadataGPR); 686 jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOf BaselineJITData()), expectedConstantsGPR);691 jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOfJITData()), expectedConstantsGPR); 687 692 688 693 auto stackPointerOK = jit.branchPtr(Equal, expectedStackPointerGPR, stackPointerRegister); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r292445 r293009 1016 1016 { 1017 1017 loadPtr(addressFor(CallFrameSlot::codeBlock), regT0); 1018 loadPtr(Address(regT0, CodeBlock::offsetOf BaselineJITData()), s_constantsGPR);1018 loadPtr(Address(regT0, CodeBlock::offsetOfJITData()), s_constantsGPR); 1019 1019 } 1020 1020 … … 1037 1037 callOperationNoExceptionCheck(operationTryOSREnterAtCatchAndValueProfile, TrustedImmPtr(&vm()), m_bytecodeIndex.asBits()); 1038 1038 auto skipOSREntry = branchTestPtr(Zero, returnValueGPR); 1039 emitPutToCallFrameHeader(returnValueGPR2, CallFrameSlot::codeBlock); 1039 1040 emitRestoreCalleeSaves(); 1040 1041 farJump(returnValueGPR, ExceptionHandlerPtrTag); -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r292929 r293009 2085 2085 } 2086 2086 2087 JSC_DEFINE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, char*, (VM* vmPointer, uint32_t bytecodeIndexBits))2087 JSC_DEFINE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, SlowPathReturnType, (VM* vmPointer, uint32_t bytecodeIndexBits)) 2088 2088 { 2089 2089 VM& vm = *vmPointer; … … 2095 2095 CodeBlock* optimizedReplacement = codeBlock->replacement(); 2096 2096 if (UNLIKELY(!optimizedReplacement)) 2097 return nullptr;2097 return encodeResult(nullptr, nullptr); 2098 2098 2099 2099 switch (optimizedReplacement->jitType()) { … … 2101 2101 case JITType::FTLJIT: { 2102 2102 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, codeBlock, optimizedReplacement, bytecodeIndex); 2103 return en try.executableAddress<char*>();2103 return encodeResult(entry.executableAddress<char*>(), optimizedReplacement); 2104 2104 } 2105 2105 default: … … 2114 2114 }); 2115 2115 2116 return nullptr;2116 return encodeResult(nullptr, nullptr); 2117 2117 } 2118 2118 -
trunk/Source/JavaScriptCore/jit/JITOperations.h
r292372 r293009 261 261 #if ENABLE(DFG_JIT) 262 262 JSC_DECLARE_JIT_OPERATION(operationOptimize, SlowPathReturnType, (VM*, uint32_t)); 263 JSC_DECLARE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, char*, (VM*, uint32_t));263 JSC_DECLARE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, SlowPathReturnType, (VM*, uint32_t)); 264 264 #endif 265 265 JSC_DECLARE_JIT_OPERATION(operationPutGetterById, void, (JSGlobalObject*, JSCell*, UniquedStringImpl*, int32_t options, JSCell*)); -
trunk/Source/JavaScriptCore/jit/RegisterSet.cpp
r291937 r293009 201 201 #if !OS(WINDOWS) 202 202 result.set(GPRInfo::regCS1); 203 result.set(GPRInfo::regCS2);203 static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister); 204 204 static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister); 205 205 static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister); 206 result.set(GPRInfo::regCS3); 207 result.set(GPRInfo::regCS4); 208 #else 209 result.set(GPRInfo::regCS3); 210 result.set(GPRInfo::regCS4); 206 result.set(GPRInfo::regCS2); 207 result.set(GPRInfo::regCS3); 208 result.set(GPRInfo::regCS4); 209 #else 210 result.set(GPRInfo::regCS3); 211 static_assert(GPRInfo::regCS4 == GPRInfo::constantsRegister); 211 212 static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister); 212 213 static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister); 214 result.set(GPRInfo::regCS4); 213 215 result.set(GPRInfo::regCS5); 214 216 result.set(GPRInfo::regCS6); … … 219 221 #elif CPU(ARM64) || CPU(RISCV64) 220 222 result.set(GPRInfo::regCS6); 221 result.set(GPRInfo::regCS7);223 static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister); 222 224 static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister); 223 225 static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister); 226 result.set(GPRInfo::regCS7); 224 227 result.set(GPRInfo::regCS8); 225 228 result.set(GPRInfo::regCS9); … … 237 240 result.set(GPRInfo::regCS0); 238 241 result.set(GPRInfo::regCS1); 239 result.set(GPRInfo::regCS2);240 242 #if !OS(WINDOWS) 243 static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister); 241 244 static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister); 242 245 static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister); 243 result.set(GPRInfo::regCS3); 244 result.set(GPRInfo::regCS4); 245 #else 246 result.set(GPRInfo::regCS3); 247 result.set(GPRInfo::regCS4); 246 result.set(GPRInfo::regCS2); 247 result.set(GPRInfo::regCS3); 248 result.set(GPRInfo::regCS4); 249 #else 250 result.set(GPRInfo::regCS2); 251 result.set(GPRInfo::regCS3); 252 static_assert(GPRInfo::regCS4 == GPRInfo::constantsRegister); 248 253 static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister); 249 254 static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister); 255 result.set(GPRInfo::regCS4); 250 256 result.set(GPRInfo::regCS5); 251 257 result.set(GPRInfo::regCS6); … … 255 261 result.set(GPRInfo::regCS1); 256 262 #elif CPU(ARM64) || CPU(RISCV64) 263 static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister); 257 264 static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister); 258 265 static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister); 266 result.set(GPRInfo::regCS7); 259 267 result.set(GPRInfo::regCS8); 260 268 result.set(GPRInfo::regCS9); … … 272 280 result.set(GPRInfo::regCS0); 273 281 result.set(GPRInfo::regCS1); 274 result.set(GPRInfo::regCS2);282 static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister); 275 283 static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister); 276 284 static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister); 285 result.set(GPRInfo::regCS2); 277 286 result.set(GPRInfo::regCS3); 278 287 result.set(GPRInfo::regCS4); … … 286 295 result.set(GPRInfo::regCS5); 287 296 result.set(GPRInfo::regCS6); 288 result.set(GPRInfo::regCS7);297 static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister); 289 298 static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister); 290 299 static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister); 300 result.set(GPRInfo::regCS7); 291 301 result.set(GPRInfo::regCS8); 292 302 result.set(GPRInfo::regCS9); … … 307 317 result.set(GPRInfo::regCS5); 308 318 result.set(GPRInfo::regCS6); 309 result.set(GPRInfo::regCS7);319 static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister); 310 320 static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister); 311 321 static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister); 322 result.set(GPRInfo::regCS7); 312 323 result.set(GPRInfo::regCS8); 313 324 result.set(GPRInfo::regCS9); -
trunk/Source/JavaScriptCore/llint/LLIntData.h
r290768 r293009 396 396 #if CPU(X86_64) && !OS(WINDOWS) 397 397 static constexpr GPRReg metadataTableGPR = GPRInfo::regCS1; 398 static constexpr GPRReg pbGPR = GPRInfo:: regCS2;398 static constexpr GPRReg pbGPR = GPRInfo::constantsRegister; 399 399 #elif CPU(X86_64) && OS(WINDOWS) 400 400 static constexpr GPRReg metadataTableGPR = GPRInfo::regCS3; 401 static constexpr GPRReg pbGPR = GPRInfo:: regCS4;401 static constexpr GPRReg pbGPR = GPRInfo::constantsRegister; 402 402 #elif CPU(ARM64) || CPU(RISCV64) 403 403 static constexpr GPRReg metadataTableGPR = GPRInfo::regCS6; 404 static constexpr GPRReg pbGPR = GPRInfo:: regCS7;404 static constexpr GPRReg pbGPR = GPRInfo::constantsRegister; 405 405 #elif CPU(MIPS) || CPU(ARM_THUMB2) 406 406 static constexpr GPRReg metadataTableGPR = GPRInfo::regCS0; -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r292372 r293009 2571 2571 # Baseline uses LLInt's PB register for its JIT constant pool. 2572 2572 loadp CodeBlock[cfr], PB 2573 loadp CodeBlock::m_ baselineJITData[PB], PB2573 loadp CodeBlock::m_jitData[PB], PB 2574 2574 end 2575 2575 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r292929 r293009 925 925 static ptrdiff_t regExpGlobalDataOffset() { return OBJECT_OFFSETOF(JSGlobalObject, m_regExpGlobalData); } 926 926 927 static ptrdiff_t offsetOfGlobalThis() { return OBJECT_OFFSETOF(JSGlobalObject, m_globalThis); } 927 928 static ptrdiff_t offsetOfVM() { return OBJECT_OFFSETOF(JSGlobalObject, m_vm); } 928 929 static ptrdiff_t offsetOfGlobalLexicalEnvironment() { return OBJECT_OFFSETOF(JSGlobalObject, m_globalLexicalEnvironment); }
Note:
See TracChangeset
for help on using the changeset viewer.