Changeset 293009 in webkit


Ignore:
Timestamp:
Apr 19, 2022, 1:06:44 AM (3 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Use constants buffer in DFG
https://bugs.webkit.org/show_bug.cgi?id=237863

Reviewed by Saam Barati.

This patch newly introduces LinkableConstant concept. We replace TrustedImmPtr::weakPointer with
that, and it can be switched between two modes: (1) just embedding a constant pointer in machine code
or (2) emitting a load from specific callee-save register. We use (2) for unlinked DFG code so that
we can start decoupling constants from machine code, which will be separately allocated as DFG constant buffer.
To introduce this mechanism, we introduce CCallHelpers::ConstantMaterializer concept, which can be used
to materialize constant in a specified way in CCallHelpers. And we use this to implement DFG LinkableConstant.

We also avoid embedding global object pointer in the tail call by modifying CallFrameShuffler to save it.

  • Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::transfer64):
(JSC::MacroAssemblerARM64::transferPtr):
(JSC::MacroAssemblerARM64::branch64):
(JSC::MacroAssemblerARM64::branchPtr):

  • Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::transfer64):
(JSC::MacroAssemblerRISCV64::transferPtr):
(JSC::MacroAssemblerRISCV64::branch64):
(JSC::MacroAssemblerRISCV64::branchPtr):

  • Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::transfer64):
(JSC::MacroAssemblerX86_64::transferPtr):
(JSC::MacroAssemblerX86_64::branch64):
(JSC::MacroAssemblerX86_64::branchPtr):

  • Source/JavaScriptCore/bytecode/CodeBlock.cpp:

(JSC::CodeBlock::setupWithLinkableBaselineCode):
(JSC::CodeBlock::~CodeBlock):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeJITInlineCaches):
(JSC::CodeBlock::getICStatusMap):
(JSC::CodeBlock::findStubInfo):
(JSC::CodeBlock::resetBaselineJITData):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::findPC):

  • Source/JavaScriptCore/bytecode/CodeBlock.h:

(JSC::CodeBlock::offsetOfJITData):
(JSC::CodeBlock::baselineJITData):
(JSC::CodeBlock::setDFGJITData):
(JSC::CodeBlock::dfgJITData):
(JSC::CodeBlock::offsetOfBaselineJITData): Deleted.

  • Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
  • Source/JavaScriptCore/dfg/DFGJITCode.h:
  • Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileSetupRegistersForEntry):
(JSC::DFG::JITCompiler::compileFunction):
(JSC::DFG::JITCompiler::loadLinkableConstant):
(JSC::DFG::JITCompiler::storeLinkableConstant):
(JSC::DFG::JITCompiler::LinkableConstant::LinkableConstant):
(JSC::DFG::JITCompiler::LinkableConstant::materialize):
(JSC::DFG::JITCompiler::LinkableConstant::poke):

  • Source/JavaScriptCore/dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::branchLinkableConstant):
(JSC::DFG::JITCompiler::branchWeakPtr): Deleted.

  • Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp:

(JSC::DFG::JITFinalizer::finalize):

  • Source/JavaScriptCore/dfg/DFGPlan.cpp:

(JSC::DFG::Plan::addLinkableConstant):
(JSC::DFG::Plan::finalizeJITData):

  • Source/JavaScriptCore/dfg/DFGPlan.h:
  • Source/JavaScriptCore/dfg/DFGSaneStringGetByValSlowPathGenerator.h:
  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::emitGetCallee):
(JSC::DFG::SpeculativeJIT::silentFill):
(JSC::DFG::SpeculativeJIT::compileDeleteById):
(JSC::DFG::SpeculativeJIT::compileDeleteByVal):
(JSC::DFG::SpeculativeJIT::compileInById):
(JSC::DFG::SpeculativeJIT::compileInByVal):
(JSC::DFG::SpeculativeJIT::compileHasPrivate):
(JSC::DFG::SpeculativeJIT::compilePushWithScope):
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compileCheckTraps):
(JSC::DFG::SpeculativeJIT::compileContiguousPutByVal):
(JSC::DFG::SpeculativeJIT::compileDoublePutByVal):
(JSC::DFG::SpeculativeJIT::compilePutByVal):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
(JSC::DFG::SpeculativeJIT::compileFromCharCode):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr):
(JSC::DFG::SpeculativeJIT::callOperationWithCallFrameRollbackOnException):
(JSC::DFG::SpeculativeJIT::branchLinkableConstant):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::genericJSValueNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileToBooleanObjectOrOther):
(JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileArithRandom):

  • Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::genericJSValueNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileCompareEqPtr):
(JSC::DFG::SpeculativeJIT::compileToBooleanObjectOrOther):
(JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
(JSC::DFG::SpeculativeJIT::emitUntypedBranch):
(JSC::DFG::SpeculativeJIT::compileGetByVal):
(JSC::DFG::SpeculativeJIT::compileRegExpTestInline):
(JSC::DFG::SpeculativeJIT::compile):

  • Source/JavaScriptCore/dfg/DFGThunks.cpp:

(JSC::DFG::osrEntryThunkGenerator):

  • Source/JavaScriptCore/jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::executableFor): Deleted.

  • Source/JavaScriptCore/jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::globalObjectFor): Deleted.

  • Source/JavaScriptCore/jit/CCallHelpers.h:

(JSC::CCallHelpers::pokeForArgument):
(JSC::CCallHelpers::setupArgumentsImpl):

  • Source/JavaScriptCore/jit/GPRInfo.h:

(JSC::GPRInfo::toRegister):

  • Source/JavaScriptCore/jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::emitMaterializeMetadataAndConstantPoolRegisters):

  • Source/JavaScriptCore/jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_catch):

  • Source/JavaScriptCore/jit/JITOperations.cpp:

(JSC::JSC_DEFINE_JIT_OPERATION):

  • Source/JavaScriptCore/jit/JITOperations.h:
  • Source/JavaScriptCore/jit/RegisterSet.cpp:

(JSC::RegisterSet::llintBaselineCalleeSaveRegisters):
(JSC::RegisterSet::dfgCalleeSaveRegisters):

  • Source/JavaScriptCore/llint/LLIntData.h:
  • Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
  • Source/JavaScriptCore/runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::offsetOfGlobalThis):

Canonical link: https://commits.webkit.org/249748@main

Location:
trunk/Source/JavaScriptCore
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r292978 r293009  
     12022-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
    11492022-04-18  Mark Lam  <mark.lam@apple.com>
    2150
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h

    r292540 r293009  
    19631963    }
    19641964
     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
    19651976    DataLabel32 store64WithAddressOffsetPatch(RegisterID src, Address address)
    19661977    {
     
    33453356        load64(left, getCachedMemoryTempRegisterIDAndInvalidate());
    33463357        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);
    33473371    }
    33483372
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h

    r292540 r293009  
    11741174    }
    11751175
     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
    11761188    void storePair32(RegisterID src1, RegisterID src2, RegisterID dest)
    11771189    {
     
    21572169    }
    21582170
     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
    21592181    Jump branch32WithUnalignedHalfWords(RelationalCondition cond, BaseIndex address, TrustedImm32 imm)
    21602182    {
     
    26462668    {
    26472669        return branch64(cond, address, rhs);
     2670    }
     2671
     2672    Jump branchPtr(RelationalCondition cond, Address left, Address right)
     2673    {
     2674        return branch64(cond, left, right);
    26482675    }
    26492676
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h

    r290647 r293009  
    10271027        m_assembler.movq_rm(scratchRegister(), address.offset, address.base, address.index, address.scale);
    10281028    }
     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    }
    10291040   
    10301041    DataLabel32 store64WithAddressOffsetPatch(RegisterID src, Address address)
     
    11351146        return Jump(m_assembler.jCC(x86Condition(cond)));
    11361147    }
     1148
     1149    Jump branch64(RelationalCondition cond, Address left, Address right)
     1150    {
     1151        load64(right, scratchRegister());
     1152        return branch64(cond, left, scratchRegister());
     1153    }
    11371154   
    11381155    Jump branch32(RelationalCondition cond, AbsoluteAddress left, RegisterID right)
     
    11511168        move(right, scratchRegister());
    11521169        return branchPtr(cond, left, scratchRegister());
     1170    }
     1171
     1172    Jump branchPtr(RelationalCondition cond, Address left, Address right)
     1173    {
     1174        return branch64(cond, left, right);
    11531175    }
    11541176
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r292929 r293009  
    774774    {
    775775        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());
    779779        for (auto& unlinkedCallLinkInfo : jitCode->m_unlinkedCalls) {
    780780            CallLinkInfo* callLinkInfo = getCallLinkInfoForBytecodeIndex(locker, unlinkedCallLinkInfo.bytecodeIndex);
     
    787787            switch (entry.type()) {
    788788            case JITConstantPool::Type::GlobalObject:
    789                 m_baselineJITData->at(i) = m_globalObject.get();
     789                baselineJITData->at(i) = m_globalObject.get();
    790790                break;
    791791            case JITConstantPool::Type::StructureStubInfo: {
    792792                unsigned index = bitwise_cast<uintptr_t>(entry.pointer());
    793793                UnlinkedStructureStubInfo& unlinkedStubInfo = jitCode->m_unlinkedStubInfos[index];
    794                 StructureStubInfo& stubInfo = m_baselineJITData->m_stubInfos[index];
     794                StructureStubInfo& stubInfo = baselineJITData->m_stubInfos[index];
    795795                stubInfo.initializeFromUnlinkedStructureStubInfo(this, unlinkedStubInfo);
    796                 m_baselineJITData->at(i) = &stubInfo;
     796                baselineJITData->at(i) = &stubInfo;
    797797                break;
    798798            }
    799799            case JITConstantPool::Type::FunctionDecl: {
    800800                unsigned index = bitwise_cast<uintptr_t>(entry.pointer());
    801                 m_baselineJITData->at(i) = functionDecl(index);
     801                baselineJITData->at(i) = functionDecl(index);
    802802                break;
    803803            }
    804804            case JITConstantPool::Type::FunctionExpr: {
    805805                unsigned index = bitwise_cast<uintptr_t>(entry.pointer());
    806                 m_baselineJITData->at(i) = functionExpr(index);
     806                baselineJITData->at(i) = functionExpr(index);
    807807                break;
    808808            }
    809809            }
    810810        }
     811        m_jitData = baselineJITData.release();
    811812    }
    812813
     
    893894
    894895#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())) {
    901902#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    }
    909915#endif // ENABLE(JIT)
    910916}
     
    12341240
    12351241#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()) {
    12381253            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    }
    12481257#endif // ENABLE(JIT)
    12491258   
     
    15711580void CodeBlock::finalizeJITInlineCaches()
    15721581{
    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())) {
    15801588#if ENABLE(DFG_JIT)
    1581     if (JITCode::isOptimizingJIT(jitType())) {
    15821589        DFG::CommonData* dfgCommon = m_jitCode->dfgCommon();
    15831590        for (auto* callLinkInfo : dfgCommon->m_callLinkInfos)
    15841591            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    }
    15911601}
    15921602#endif
     
    16751685#if ENABLE(JIT)
    16761686    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())) {
    16811688#if ENABLE(DFG_JIT)
    1682         if (JITCode::isOptimizingJIT(jitType())) {
    16831689            DFG::CommonData* dfgCommon = m_jitCode->dfgCommon();
    16841690            for (auto* stubInfo : dfgCommon->m_stubInfos)
     
    16961702            for (auto& pair : dfgCommon->recordedStatuses.deletes)
    16971703                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        }
    17001711    }
    17011712#else
     
    17141725{
    17151726    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())) {
    17231728#if ENABLE(DFG_JIT)
    1724     if (JITCode::isOptimizingJIT(jitType())) {
    17251729        for (auto* stubInfo : jitCode()->dfgCommon()->m_stubInfos) {
    17261730            if (stubInfo->codeOrigin == codeOrigin)
    17271731                return stubInfo;
    17281732        }
    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    }
    17311742    return nullptr;
    17321743}
     
    17671778    ConcurrentJSLocker locker(m_lock);
    17681779   
    1769     if (auto* jitData = m_baselineJITData.get()) {
     1780    if (auto* jitData = baselineJITData()) {
    17701781        // We can clear these because no other thread will have references to any stub infos, call
    17711782        // link infos, or by val infos if we don't have JIT code. Attempts to query these data
     
    17881799        // there is JIT code.
    17891800
    1790         m_baselineJITData = nullptr;
     1801        m_jitData = nullptr;
    17911802    }
    17921803}
     
    18341845
    18351846#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())) {
    18421852#if ENABLE(DFG_JIT)
    1843     if (JITCode::isOptimizingJIT(jitType())) {
    18441853        DFG::CommonData* dfgCommon = m_jitCode->dfgCommon();
    18451854        for (auto* stubInfo : dfgCommon->m_stubInfos)
    1846             stubInfo->visitAggregate(visitor);
     1855            handleStubInfo(*stubInfo);
    18471856        dfgCommon->recordedStatuses.visitAggregate(visitor);
    18481857        visitOSRExitTargets(locker, visitor);
     1858#endif
     1859    } else {
     1860        if (auto* jitData = baselineJITData()) {
     1861            for (auto& stubInfo : jitData->m_stubInfos)
     1862                handleStubInfo(stubInfo);
     1863        }
    18491864    }
    18501865#endif
     
    34633478    {
    34643479        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())) {
    34713481#if ENABLE(DFG_JIT)
    3472         if (JITCode::isOptimizingJIT(jitType())) {
    34733482            DFG::CommonData* dfgCommon = m_jitCode->dfgCommon();
    34743483            for (auto* stubInfo : dfgCommon->m_stubInfos) {
     
    34763485                    return stubInfo->codeOrigin;
    34773486            }
    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        }
    34803496    }
    34813497
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r292191 r293009  
    8080#if ENABLE(DFG_JIT)
    8181namespace DFG {
     82class JITData;
    8283struct OSRExitState;
    8384} // namespace DFG
     
    246247    std::optional<BytecodeIndex> bytecodeIndexFromCallSiteIndex(CallSiteIndex);
    247248
    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),
    249250    // you need to be careful about the lifetime of when you use the return value of this function.
    250251    // The return value may have raw pointers into this data structure that gets thrown away.
     
    257258    void setupWithUnlinkedBaselineCode(Ref<BaselineJITCode>);
    258259
    259     static ptrdiff_t offsetOfBaselineJITData() { return OBJECT_OFFSETOF(CodeBlock, m_baselineJITData); }
     260    static ptrdiff_t offsetOfJITData() { return OBJECT_OFFSETOF(CodeBlock, m_jitData); }
    260261
    261262    StructureStubInfo* addOptimizingStubInfo(AccessType, CodeOrigin);
     
    531532    BaselineJITData* baselineJITData()
    532533    {
    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
    536553#endif
    537554    size_t numberOfUnlinkedSwitchJumpTables() const { return m_unlinkedCode->numberOfUnlinkedSwitchJumpTables(); }
     
    934951#if ENABLE(JIT)
    935952public:
    936     std::unique_ptr<BaselineJITData> m_baselineJITData;
     953    void* m_jitData { nullptr };
    937954private:
    938955#endif
  • trunk/Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h

    r292445 r293009  
    7676    CallArrayAllocatorWithVariableSizeSlowPathGenerator(
    7777        MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_GStZB function,
    78         GPRReg resultGPR, CCallHelpers::TrustedImmPtr globalObject, RegisteredStructure contiguousStructure, RegisteredStructure arrayStorageStructure, GPRReg sizeGPR, GPRReg storageGPR)
     78        GPRReg resultGPR, JITCompiler::LinkableConstant globalObject, RegisteredStructure contiguousStructure, RegisteredStructure arrayStorageStructure, GPRReg sizeGPR, GPRReg storageGPR)
    7979        : JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
    8080        , m_function(function)
     
    116116    RegisteredStructure m_arrayStorageOrContiguousStructure;
    117117    GPRReg m_resultGPR;
    118     CCallHelpers::TrustedImmPtr m_globalObject;
     118    JITCompiler::LinkableConstant m_globalObject;
    119119    GPRReg m_sizeGPR;
    120120    GPRReg m_storageGPR;
     
    126126    CallArrayAllocatorWithVariableStructureVariableSizeSlowPathGenerator(
    127127        MacroAssembler::JumpList from, SpeculativeJIT* jit, P_JITOperation_GStZB function,
    128         GPRReg resultGPR, CCallHelpers::TrustedImmPtr globalObject, GPRReg structureGPR, GPRReg sizeGPR, GPRReg storageGPR)
     128        GPRReg resultGPR, JITCompiler::LinkableConstant globalObject, GPRReg structureGPR, GPRReg sizeGPR, GPRReg storageGPR)
    129129        : JumpingSlowPathGenerator<MacroAssembler::JumpList>(from, jit)
    130130        , m_function(function)
     
    153153    P_JITOperation_GStZB m_function;
    154154    GPRReg m_resultGPR;
    155     CCallHelpers::TrustedImmPtr m_globalObject;
     155    JITCompiler::LinkableConstant m_globalObject;
    156156    GPRReg m_structureGPR;
    157157    GPRReg m_sizeGPR;
  • trunk/Source/JavaScriptCore/dfg/DFGJITCode.h

    r283139 r293009  
    4949
    5050class JITCompiler;
     51
     52class JITData final : public TrailingArray<JITData, void*> {
     53    WTF_MAKE_FAST_ALLOCATED;
     54    friend class LLIntOffsetsExtractor;
     55public:
     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};
    5168
    5269class JITCode final : public DirectJITCode {
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r292447 r293009  
    119119    emitSaveCalleeSaves();
    120120    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
    121127}
    122128
     
    436442        if (maxFrameExtentForSlowPathCall)
    437443            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);
    439447        if (maxFrameExtentForSlowPathCall)
    440448            addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister);
     
    647655}
    648656
     657void JITCompiler::loadLinkableConstant(LinkableConstant constant, GPRReg dest)
     658{
     659    constant.materialize(*this, dest);
     660}
     661
     662void JITCompiler::storeLinkableConstant(LinkableConstant constant, Address dest)
     663{
     664    constant.store(*this, dest);
     665}
     666
     667JITCompiler::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
     677JITCompiler::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
     686void 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
     697void 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
    649708} } // namespace JSC::DFG
    650709
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r290647 r293009  
    257257   
    258258    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>
    267259    Jump branchWeakStructure(RelationalCondition cond, T left, RegisteredStructure weakStructure)
    268260    {
     
    311303    {
    312304        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()));
    313365    }
    314366
  • trunk/Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp

    r285687 r293009  
    6565
    6666    codeBlock->setJITCode(m_jitCode.copyRef());
     67    codeBlock->setDFGJITData(m_plan.finalizeJITData());
    6768
    6869#if ENABLE(FTL_JIT)
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r291332 r293009  
    682682}
    683683
     684unsigned Plan::addLinkableConstant(void* ptr)
     685{
     686    ASSERT(ptr);
     687    return m_constantPool.add(ptr, m_constantPool.size()).iterator->value;
     688}
     689
     690std::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
    684701} } // namespace JSC::DFG
    685702
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.h

    r278253 r293009  
    4949
    5050class ThreadData;
     51class JITData;
    5152
    5253#if ENABLE(DFG_JIT)
     
    102103    void setCallback(Ref<DeferredCompilationCallback>&& callback) { m_callback = WTFMove(callback); }
    103104
     105    unsigned addLinkableConstant(void*);
     106    std::unique_ptr<JITData> finalizeJITData();
     107
    104108private:
    105109    CompilationPath compileInThreadImpl() override;
     
    135139
    136140    RefPtr<DeferredCompilationCallback> m_callback;
     141    HashMap<void*, unsigned> m_constantPool;
    137142};
    138143
  • trunk/Source/JavaScriptCore/dfg/DFGSaneStringGetByValSlowPathGenerator.h

    r261569 r293009  
    3838public:
    3939    SaneStringGetByValSlowPathGenerator(
    40         const MacroAssembler::Jump& from, SpeculativeJIT* jit, JSValueRegs resultRegs, CCallHelpers::TrustedImmPtr globalObject, GPRReg baseReg, GPRReg propertyReg)
     40        const MacroAssembler::Jump& from, SpeculativeJIT* jit, JSValueRegs resultRegs, JITCompiler::LinkableConstant globalObject, GPRReg baseReg, GPRReg propertyReg)
    4141        : JumpingSlowPathGenerator<MacroAssembler::Jump>(from, jit)
    4242        , m_resultRegs(resultRegs)
     
    8080
    8181    JSValueRegs m_resultRegs;
    82     CCallHelpers::TrustedImmPtr m_globalObject;
     82    JITCompiler::LinkableConstant m_globalObject;
    8383    GPRReg m_baseReg;
    8484    GPRReg m_propertyReg;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r292929 r293009  
    6262#include "JSSetIterator.h"
    6363#include "LLIntThunks.h"
     64#include "ProbeContext.h"
    6465#include "RegExpObject.h"
    6566#include "ScopedArguments.h"
     
    206207                JITCompiler::addressFor(inlineCallFrame->calleeRecovery.virtualRegister()),
    207208                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);
    213211    } else
    214212        m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), calleeGPR);
     
    687685    case SetCellConstant:
    688686        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());
    690688        break;
    691689#if USE(JSVALUE64)
     
    12081206            slowPath = slowPathICCall(
    12091207                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()));
    12111209        } else {
    12121210            slowPath = slowPathCall(
    12131211                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()));
    12151213        }
    12161214#else
     
    12191217            slowPath = slowPathICCall(
    12201218                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()));
    12221220        } else {
    12231221            slowPath = slowPathCall(
    12241222                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()));
    12261224        }
    12271225#endif
     
    12441242    GPRFlushedCallResult result(this);
    12451243    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()));
    12471245    m_jit.exceptionCheck();
    12481246
     
    12941292            slowPath = slowPathICCall(
    12951293                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()));
    12971295        } else {
    12981296            slowPath = slowPathCall(
    12991297                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()));
    13011299        }
    13021300#else
     
    13051303            slowPath = slowPathICCall(
    13061304                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()));
    13081306        } else {
    13091307            slowPath = slowPathCall(
    13101308                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()));
    13121310        }
    13131311#endif
     
    13311329    GPRFlushedCallResult result(this);
    13321330    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()));
    13341332    m_jit.exceptionCheck();
    13351333
     
    13741372            slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInByIdOptimize,
    13751373            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());
    13771375    } else {
    13781376        slowPath = slowPathCall(
    13791377            slowCases, this, operationInByIdOptimize,
    13801378            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());
    13821380    }
    13831381
     
    14241422            slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationInByValOptimize,
    14251423            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);
    14271425    } else {
    14281426        slowPath = slowPathCall(
    14291427            slowCases, this, operationInByValOptimize,
    14301428            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);
    14321430    }
    14331431
     
    14781476            slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), type == AccessType::HasPrivateName ? operationHasPrivateNameOptimize : operationHasPrivateBrandOptimize,
    14791477            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));
    14811479    } else {
    14821480        slowPath = slowPathCall(
    14831481            slowCases, this, type == AccessType::HasPrivateName ? operationHasPrivateNameOptimize : operationHasPrivateBrandOptimize,
    14841482            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));
    14861484    }
    14871485
     
    15171515
    15181516        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);
    15201518        // No exception check here as we did not have to call toObject().
    15211519    } else {
     
    15251523
    15261524        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);
    15281526        m_jit.exceptionCheck();
    15291527    }
     
    19121910    VM& vm = this->vm();
    19131911    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);
    19151913    doneCases.append(m_jit.jump());
    19161914
     
    19441942    addSlowPathGenerator(slowPathCall(bigCharacter, this, operationSingleCharacterString, tempGPR, TrustedImmPtr(&vm), tempGPR));
    19451943
    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));
    19471945
    19481946    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));
    19501948    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())));
    19521950
    19531951    doneCases.link(&m_jit);
     
    19961994    slowPath.link(&m_jit);
    19971995    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);
    19991997    silentFillAllRegisters();
    20001998    m_jit.exceptionCheck();
     
    22232221#endif
    22242222        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
    22252229    }
    22262230
     
    25032507        TrustedImm32(VMTraps::AsyncEvents));
    25042508
    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))));
    25062510    noResult(node);
    25072511}
     
    25682572                (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsStrict : operationPutByValBeyondArrayBoundsStrict) :
    25692573                (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));
    25712575    }
    25722576
     
    26432647                    (node->op() == PutByValDirect ? operationPutDoubleByValDirectBeyondArrayBoundsStrict : operationPutDoubleByValBeyondArrayBoundsStrict) :
    26442648                    (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));
    26462650    }
    26472651
     
    27012705            flushRegisters();
    27022706            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);
    27042708            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);
    27062710            m_jit.exceptionCheck();
    27072711
     
    27562760            slowPath = slowPathICCall(
    27572761                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);
    27592763        } else {
    27602764            slowPath = slowPathCall(
    27612765                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);
    27632767        }
    27642768
     
    28512855                    (node->op() == PutByValDirect ? operationPutByValDirectBeyondArrayBoundsStrict : operationPutByValBeyondArrayBoundsStrict) :
    28522856                    (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));
    28542858        }
    28552859
     
    29622966#endif
    29632967
    2964         JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
     2968        JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    29652969        Structure* stringPrototypeStructure = globalObject->stringPrototype()->structure();
    29662970        Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure();
     
    29782982
    29792983            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));
    29812985        } else {
    29822986            addSlowPathGenerator(
    29832987                slowPathCall(
    29842988                    outOfBounds, this, operationGetByValStringInt,
    2985                     resultRegs, TrustedImmPtr::weakPointer(m_graph, globalObject), baseReg, propertyReg));
     2989                    resultRegs, JITCompiler::LinkableConstant(m_graph, globalObject), baseReg, propertyReg));
    29862990        }
    29872991       
     
    30073011        JSValueRegsFlushedCallResult result(this);
    30083012        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);
    30103014        m_jit.exceptionCheck();
    30113015       
     
    30273031
    30283032    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));
    30303034    cellResult(scratchReg, m_currentNode);
    30313035}
     
    39513955                (node->op() == PutByValDirect ? operationPutByValDirectNonStrict : operationPutByValNonStrict),
    39523956#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));
    39543958#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)));
    39563960#endif
    39573961    }
     
    40614065    else
    40624066        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);
    40644068    if (canUseFlush == CanUseFlush::No)
    40654069        silentFillAllRegisters();
     
    40884092    else
    40894093        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);
    40914095    if (canUseFlush == CanUseFlush::No)
    40924096        silentFillAllRegisters();
     
    41564160            return slowPathICCall(
    41574161                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,
    41594163                base, CCallHelpers::CellValue(property.payloadGPR()));
    41604164        }
    41614165        return slowPathCall(
    41624166            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()),
    41644168            base, CCallHelpers::CellValue(property.payloadGPR()));
    41654169    };
     
    42494253            (node->op() == PutByValDirect ? operationPutByValDirectCellStringStrict : operationPutByValCellStringStrict) :
    42504254            (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);
    42524256    m_jit.exceptionCheck();
    42534257
     
    42724276            ? (node->op() == PutByValDirect ? operationPutByValDirectCellSymbolStrict : operationPutByValCellSymbolStrict)
    42734277            : (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);
    42754279    m_jit.exceptionCheck();
    42764280
     
    42904294    JSValueRegsFlushedCallResult result(this);
    42914295    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);
    42934297    m_jit.exceptionCheck();
    42944298
     
    43164320        flushRegisters();
    43174321        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));
    43194323        m_jit.exceptionCheck();
    43204324
     
    43604364        slowPath = slowPathICCall(
    43614365            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);
    43634367    } else {
    43644368        slowPath = slowPathCall(
    43654369            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);
    43674371    }
    43684372
     
    44384442        slowPath = slowPathICCall(
    44394443            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));
    44414445    } else {
    44424446        slowPath = slowPathCall(
    44434447            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));
    44454449    }
    44464450
     
    44864490        slowPath = slowPathICCall(
    44874491            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));
    44894493    } else {
    44904494        slowPath = slowPathCall(
    44914495            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));
    44934497    }
    44944498
     
    45264530            JSValueRegsFlushedCallResult result(this);
    45274531            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);
    45294533            m_jit.exceptionCheck();
    45304534            jsValueResult(resultRegs, node);
     
    45394543        JSValueRegsFlushedCallResult result(this);
    45404544        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);
    45424546        m_jit.exceptionCheck();
    45434547        jsValueResult(resultRegs, node);
     
    45524556        JSValueRegsFlushedCallResult result(this);
    45534557        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);
    45554559        m_jit.exceptionCheck();
    45564560        jsValueResult(resultRegs, node);
     
    45654569    JSValueRegsFlushedCallResult result(this);
    45664570    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);
    45684572    m_jit.exceptionCheck();
    45694573    jsValueResult(resultRegs, node);
     
    45884592    if (!hasInstanceValueNode->isCellConstant() || defaultHasInstanceFunction != hasInstanceValueNode->asCell()) {
    45894593        JSValueRegs hasInstanceValueRegs = hasInstanceValue.jsValueRegs();
     4594        m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), resultGPR);
    45904595#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));
    45924597#else
    45934598        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));
    45954600#endif
    45964601    }
     
    46264631    if (JITCode::useDataIC(JITType::DFGJIT)) {
    46274632        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);
    46294634    } else {
    46304635        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);
    46324637    }
    46334638   
     
    47394744        JSValueRegs resultRegs = result.regs();
    47404745
    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);
    47424747        m_jit.exceptionCheck();
    47434748        jsValueResult(resultRegs, node);
     
    47544759    JSValueRegsFlushedCallResult result(this);
    47554760    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);
    47574762    m_jit.exceptionCheck();
    47584763
     
    47944799        JSValueRegsFlushedCallResult result(this);
    47954800        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);
    47974802        m_jit.exceptionCheck();
    47984803
     
    48594864    }
    48604865
    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);
    48624867
    48634868    silentFillAllRegisters();
     
    49224927        switch (op) {
    49234928        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);
    49254930            break;
    49264931        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);
    49284933            break;
    49294934        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);
    49314936            break;
    49324937        default:
     
    50125017        JSValueRegsFlushedCallResult result(this);
    50135018        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);
    50155020        m_jit.exceptionCheck();
    50165021
     
    50785083    }
    50795084
    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);
    50815086
    50825087    silentFillAllRegisters();
     
    51075112        JSValueRegs resultRegs = result.regs();
    51085113
    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);
    51105115        m_jit.exceptionCheck();
    51115116        jsValueResult(resultRegs, node);
     
    51345139        JSValueRegsFlushedCallResult result(this);
    51355140        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);
    51375142        m_jit.exceptionCheck();
    51385143
     
    52225227        JSValueRegs resultRegs = result.regs();
    52235228        // 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);
    52255230        m_jit.exceptionCheck();
    52265231
     
    52435248        JSValueRegsFlushedCallResult result(this);
    52445249        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);
    52465251        m_jit.exceptionCheck();
    52475252
     
    52595264        JSValueRegsFlushedCallResult result(this);
    52605265        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);
    52625267        m_jit.exceptionCheck();
    52635268   
     
    53225327        JSValueRegsFlushedCallResult result(this);
    53235328        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);
    53255330        m_jit.exceptionCheck();
    53265331
     
    53435348        JSValueRegs resultRegs = result.regs();
    53445349
    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);
    53465351
    53475352        m_jit.exceptionCheck();
     
    54505455
    54515456            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));
    54535458            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);
    54555460
    54565461            silentFill(savePlans);
     
    54815486
    54825487        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);
    54845489        m_jit.exceptionCheck();
    54855490    }
     
    55145519    MacroAssembler::Jump slowCase = m_jit.jump();
    55155520
    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));
    55175522
    55185523    unblessedBooleanResult(resultGPR, node);
     
    56135618        if (node->identifierNumber() != UINT32_MAX)
    56145619            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)));
    56165621    } 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));
    56185623
    56195624    cellResult(resultGPR, node);
     
    57595764        flushRegisters();
    57605765        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);
    57625767        m_jit.exceptionCheck();
    57635768        doubleResult(result.fpr(), node);
     
    57835788    GPRReg resultReg = result.gpr();
    57845789    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);
    57865791    m_jit.exceptionCheck();
    57875792    strictInt32Result(resultReg, node);
     
    58075812    flushRegisters();
    58085813    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);
    58105815    m_jit.exceptionCheck();
    58115816    doubleResult(result.fpr(), node);
     
    59245929    JSValueRegs resultRegs = result.regs();
    59255930    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);
    59275932    m_jit.exceptionCheck();
    59285933    jsValueResult(resultRegs, node);
     
    60636068
    60646069            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));
    60666071            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);
    60686073
    60696074            silentFill(savePlans);
     
    60866091    } else {
    60876092        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);
    60896094        m_jit.exceptionCheck();
    60906095    }
     
    61516156        JSValueRegs resultRegs = result.regs();
    61526157
    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);
    61546159
    61556160        m_jit.exceptionCheck();
     
    61696174        JSValueRegsFlushedCallResult result(this);
    61706175        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);
    61726177        m_jit.exceptionCheck();
    61736178
     
    63516356        JSValueRegs resultRegs = result.regs();
    63526357
    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);
    63546359
    63556360        m_jit.exceptionCheck();
     
    63696374        JSValueRegsFlushedCallResult result(this);
    63706375        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);
    63726377        m_jit.exceptionCheck();
    63736378
     
    64536458    }
    64546459
    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);
    64566461
    64576462    silentFillAllRegisters();
     
    66176622    flushRegisters();
    66186623    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);
    66206625    m_jit.exceptionCheck();
    66216626    doubleResult(result.fpr(), node);
     
    66426647        JSValueRegs resultRegs = result.regs();
    66436648
    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);
    66456650
    66466651        m_jit.exceptionCheck();
     
    66596664    JSValueRegsFlushedCallResult result(this);
    66606665    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);
    66626667    m_jit.exceptionCheck();
    66636668    jsValueResult(resultRegs, node);
     
    70567061        operation = operationArithTrunc;
    70577062    }
    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);
    70597064    m_jit.exceptionCheck();
    70607065    jsValueResult(resultRegs, node);
     
    70897094    flushRegisters();
    70907095    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);
    70927097    m_jit.exceptionCheck();
    70937098    doubleResult(result.fpr(), node);
     
    72177222        JSValueRegs resultRegs = result.regs();
    72187223
    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);
    72207225
    72217226        m_jit.exceptionCheck();
     
    72367241    JSValueRegsFlushedCallResult result(this);
    72377242    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);
    72397244    m_jit.exceptionCheck();
    72407245
     
    79737978    addSlowPathGenerator(
    79747979        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));
    79767981   
    79777982    blessedBooleanResult(leftTempGPR, node);
     
    81238128
    81248129    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);
    81268131    m_jit.exceptionCheck();
    81278132
     
    82248229    GPRFlushedCallResult result(this);
    82258230    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);
    82278232    m_jit.exceptionCheck();
    82288233
     
    82418246    GPRReg eqGPR = eq.gpr();
    82428247
    8243     m_jit.move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), eqGPR);
     8248    m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), eqGPR);
    82448249    m_jit.comparePtr(invert ? CCallHelpers::Equal : CCallHelpers::NotEqual, strGPR, eqGPR, eqGPR);
    82458250    unblessedBooleanResult(eqGPR, node);
     
    82588263        valueRegs, node->child1(), (~SpecCellCheck) | SpecString, m_jit.branchIfNotString(cellGPR));
    82598264
    8260     m_jit.move(TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), tempGPR);
     8265    m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), tempGPR);
    82618266    m_jit.comparePtr(invert ? CCallHelpers::Equal : CCallHelpers::NotEqual, cellGPR, tempGPR, tempGPR);
    82628267    auto done = m_jit.jump();
     
    82798284    speculateString(nodeUse, strGPR);
    82808285
    8281     branchPtr(CCallHelpers::Equal, strGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);
     8286    branchLinkableConstant(CCallHelpers::Equal, strGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken);
    82828287    jump(taken);
    82838288
     
    82968301    DFG_TYPE_CHECK(valueRegs, nodeUse, (~SpecCellCheck) | SpecString, m_jit.branchIfNotString(cellGPR));
    82978302
    8298     branchPtr(CCallHelpers::Equal, cellGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);
     8303    branchLinkableConstant(CCallHelpers::Equal, cellGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken);
    82998304    jump(taken, ForceJump);
    83008305
     
    83108315    GPRTemporary storage(this);
    83118316    GPRReg storageGPR = storage.gpr();
    8312     m_jit.move(TrustedImmPtr(node->storagePointer()), storageGPR);
     8317    m_jit.loadLinkableConstant(JITCompiler::LinkableConstant::nonCellPointer(m_graph, node->storagePointer()), storageGPR);
    83138318    storageResult(storageGPR, node);
    83148319}
     
    83578362   
    83588363    ASSERT(node->arrayMode().type() != Array::String);
    8359 
    83608364    auto typedArrayType = node->arrayMode().typedArrayType();
    83618365    ASSERT_UNUSED(typedArrayType, isTypedView(typedArrayType));
     
    83838387        slowPathCall(
    83848388            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));
    83868390    cellResult(resultGPR, node);
    83878391}
     
    84808484            slowPathCall(
    84818485                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));
    84838487    }
    84848488   
     
    85868590    GPRTemporary result(this);
    85878591    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);
    85908594    cellResult(resultGPR, node);
    85918595}
     
    87498753   
    87508754    m_jit.storePtr(scopeGPR, JITCompiler::Address(resultGPR, JSFunction::offsetOfScopeChain()));
    8751     m_jit.storePtr(TrustedImmPtr::weakPointer(m_graph, executable), JITCompiler::Address(resultGPR, JSFunction::offsetOfExecutableOrRareData()));
     8755    m_jit.storeLinkableConstant(JITCompiler::LinkableConstant(m_graph, executable), JITCompiler::Address(resultGPR, JSFunction::offsetOfExecutableOrRareData()));
    87528756    m_jit.mutatorFence(vm());
    87538757}
     
    87708774
    87718775        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));
    87738777        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));
    87758779        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));
    87778781        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));
    87798783        m_jit.exceptionCheck();
    87808784        cellResult(resultGPR, node);
     
    88128816        compileNewFunctionCommon<JSFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSFunction::allocationSize(0), executable);
    88138817           
    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)));
    88158819    }
    88168820
     
    88188822        compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable);
    88198823
    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)));
    88218825    }
    88228826
     
    88248828        compileNewFunctionCommon<JSAsyncFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncFunction::allocationSize(0), executable);
    88258829
    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)));
    88278831    }
    88288832
     
    88308834        compileNewFunctionCommon<JSAsyncGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncGeneratorFunction::allocationSize(0), executable);
    88318835       
    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)));
    88338837    }
    88348838   
     
    88448848
    88458849    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);
    88478851    m_jit.exceptionCheck();
    88488852
     
    88618865    unlock(GPRInfo::returnValueGPR);
    88628866
    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);
    88648868    m_jit.exceptionCheck();
    88658869
     
    88988902    m_jit.store32(argumentCountIncludingThis, JITCompiler::payloadFor(data->machineCount));
    88998903
    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);
    89018905    m_jit.exceptionCheck();
    89028906
     
    89979001#if USE(JSVALUE64)
    89989002        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)));
    90009004#else
    90019005        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);
    90039007#endif
    90049008        m_jit.exceptionCheck();
     
    90299033    // activation must be young.
    90309034    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
    90359037    // Must initialize all members to undefined or the TDZ empty value.
    90369038    for (unsigned i = 0; i < table->scopeSize(); ++i) {
     
    90469048    addSlowPathGenerator(
    90479049        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))));
    90499051#else
    90509052    addSlowPathGenerator(
    90519053        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));
    90539055#endif
    90549056
     
    91599161                    inlineCallFrame->calleeRecovery.virtualRegister()),
    91609162                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);
    91679165    } else
    91689166        m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), scratch1GPR);
     
    92629260    flushRegisters();
    92639261
    9264     JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
     9262    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    92659263   
    92669264    // We set up the arguments ourselves, because we have the whole register file and we can
     
    92799277    m_jit.setupArgument(
    92809278        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);
    92849280        });
    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        });
    92869285   
    92879286    appendCallSetResult(operationCreateScopedArguments, resultGPR);
     
    92979296    flushRegisters();
    92989297
    9299     JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
     9298    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    93009299   
    93019300    // We set up the arguments ourselves, because we have the whole register file and we can
     
    93089307    m_jit.setupArgument(
    93099308        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);
    93149310        });
    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        });
    93169315   
    93179316    appendCallSetResult(operationCreateClonedArguments, resultGPR);
     
    93279326    flushRegisters();
    93289327
    9329     JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
    9330 
    93319328    // We set up the arguments ourselves, because we have the whole register file and we can
    93329329    // set them up directly into the argument registers.
     
    93359332    m_jit.setupArgument(2, [&] (GPRReg destGPR) { emitGetLength(node->origin.semantic, destGPR); });
    93369333    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        });
    93389338
    93399339    appendCallSetResult(operationCreateArgumentsButterfly, resultGPR);
     
    94049404    GPRFlushedCallResult result(this);
    94059405    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);
    94079407    m_jit.exceptionCheck();
    94089408
     
    94589458        m_jit.add32(TrustedImm32(JSImmutableButterfly::offsetOfData()), scratch1GPR);
    94599459
    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);
    94619461        m_jit.store32(lengthGPR, MacroAssembler::Address(resultGPR, JSImmutableButterfly::offsetOfPublicLength()));
    94629462        m_jit.store32(lengthGPR, MacroAssembler::Address(resultGPR, JSImmutableButterfly::offsetOfVectorLength()));
     
    94989498        }
    94999499       
    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));
    95019501
    95029502        done.link(&m_jit);
     
    95089508        GPRFlushedCallResult result(this);
    95099509        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);
    95119511        m_jit.exceptionCheck();
    95129512        cellResult(resultGPR, node);
     
    95179517        GPRFlushedCallResult result(this);
    95189518        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);
    95209520        m_jit.exceptionCheck();
    95219521        cellResult(resultGPR, node);
     
    96549654
    96559655    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())),
    96579657        TrustedImmPtr(buffer), size_t(node->numChildren()));
    96589658    m_jit.exceptionCheck();
     
    98139813    GPRReg resultGPR = result.gpr();
    98149814
    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());
    98169816    m_jit.exceptionCheck();
    98179817
     
    99939993
    99949994        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));
    99969996    }
    99979997
     
    1021210212        flushRegisters();
    1021310213
    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);
    1021510215        m_jit.exceptionCheck();
    1021610216
     
    1022710227        switch (node->arrayMode().type()) {
    1022810228        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);
    1023010230            break;
    1023110231        case Array::Int32:
    1023210232        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);
    1023410234            break;
    1023510235        default:
     
    1030010300
    1030110301            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));
    1030310303
    1030410304            jsValueResult(resultRegs, node);
     
    1034610346        MacroAssembler::Jump fastPath = m_jit.branchPtr(MacroAssembler::NotEqual, bufferGPR, TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer())));
    1034710347
    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)));
    1034910349
    1035010350        base.use();
     
    1037110371
    1037210372            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));
    1037410374
    1037510375            jsValueResult(resultRegs, node);
     
    1041510415        MacroAssembler::Jump fastPath = m_jit.branchPtr(MacroAssembler::NotEqual, bufferGPR, TrustedImmPtr(static_cast<EncodedJSValue*>(scratchBuffer->dataBuffer())));
    1041610416
    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)));
    1041810418
    1041910419        base.use();
     
    1044810448
    1044910449            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));
    1045110451
    1045210452            jsValueResult(resultRegs, node);
     
    1049210492
    1049310493        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)));
    1049510495
    1049610496        base.use();
     
    1054710547void SpeculativeJIT::compileTypeOfIsObject(Node* node)
    1054810548{
    10549     JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    10550    
    1055110549    JSValueOperand value(this, node->child1());
    1055210550    JSValueRegs valueRegs = value.jsValueRegs();
     
    1058010578    addSlowPathGenerator(
    1058110579        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)),
    1058310581            valueRegs.payloadGPR()));
    1058410582   
     
    1059010588void SpeculativeJIT::compileIsCallable(Node* node, S_JITOperation_GC slowPathOperation)
    1059110589{
    10592     JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    10593    
    1059410590    JSValueOperand value(this, node->child1());
    1059510591    JSValueRegs valueRegs = value.jsValueRegs();
     
    1061710613    addSlowPathGenerator(
    1061810614        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)),
    1062010616            valueRegs.payloadGPR()));
    1062110617   
     
    1063310629    GPRReg resultGPR = result.gpr();
    1063410630
    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);
    1063610632    unblessedBooleanResult(resultGPR, node);
    1063710633}
     
    1063910635void SpeculativeJIT::compileTypeOf(Node* node)
    1064010636{
    10641     JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    10642    
    1064310637    JSValueOperand value(this, node->child1());
    1064410638    JSValueRegs valueRegs = value.jsValueRegs();
     
    1065210646        valueRegs, resultGPR,
    1065310647        [&] (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);
    1065510649            if (!fallsThrough)
    1065610650                done.append(m_jit.jump());
     
    1066310657    addSlowPathGenerator(
    1066410658        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)),
    1066610660            valueRegs.payloadGPR()));
    1066710661   
     
    1071210706    if (node->child1().useKind() == CellUse) {
    1071310707        SpeculateCellOperand cell(this, node->child1());
    10714         speculationCheck(BadConstantValue, JSValueSource::unboxedCell(cell.gpr()), node->child1(), m_jit.branchWeakPtr(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())));
    1071510709    } else {
    1071610710        ASSERT(!node->constant()->value().isCell() || !node->constant()->value());
     
    1098310977    switch (argumentCountIncludingThis) {
    1098410978    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]);
    1098610980        break;
    1098710981    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]);
    1098910983        break;
    1099010984    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]);
    1099210986        break;
    1099310987    default:
     
    1101311007        flushRegisters();
    1101411008        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()));
    1101611010        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)));
    1101811012
    1101911013        m_jit.storePtr(GPRInfo::callFrameRegister, &vm().topCallFrame);
     
    1115611150
    1115711151        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);
    1115911153        else {
    1116011154            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);
    1116211156        }
    1116311157        m_jit.exceptionCheck();
     
    1118611180        }
    1118711181        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);
    1118911183        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);
    1119111185        else {
    1119211186            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);
    1119411188        }
    1119511189        m_jit.exceptionCheck();
     
    1126211256        }
    1126311257        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);
    1126511259        else {
    1126611260            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);
    1126811262        }
    1126911263        m_jit.exceptionCheck();
     
    1131811312    slowCases.append(m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));
    1131911313
    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()));
    1132111315
    1132211316    cellResult(result.gpr(), node);
     
    1133211326    auto callToString = [&] (auto operation, GPRReg resultGPR, auto valueReg) {
    1133311327        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));
    1133511329        m_jit.exceptionCheck();
    1133611330        cellResult(resultGPR, node);
     
    1137711371    auto callToString = [&] (auto operation, GPRReg resultGPR, auto valueReg, GPRReg radixGPR) {
    1137811372        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);
    1138011374        m_jit.exceptionCheck();
    1138111375        cellResult(resultGPR, node);
     
    1147511469        GPRFlushedCallResult result(this);
    1147611470        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);
    1147811472        m_jit.exceptionCheck();
    1147911473        cellResult(resultGPR, node);
     
    1148611480    GPRFlushedCallResult result(this);
    1148711481    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);
    1148911483    m_jit.exceptionCheck();
    1149011484    cellResult(resultGPR, node);
     
    1160911603    addSlowPathGenerator(slowPathCall(
    1161011604        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));
    1161211606
    1161311607    cellResult(resultGPR, node);
     
    1163411628    emitAllocateJSObject<RegExpObject>(resultGPR, TrustedImmPtr(structure), butterfly, scratch1GPR, scratch2GPR, slowPath);
    1163511629
    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()));
    1163911631    m_jit.storeValue(lastIndexRegs, CCallHelpers::Address(resultGPR, RegExpObject::offsetOfLastIndex()));
    1164011632    m_jit.mutatorFence(vm());
    1164111633
    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));
    1164311635
    1164411636    cellResult(resultGPR, node);
     
    1256212554    m_jit.loadPtr(MacroAssembler::Address(value, JSString::offsetOfValue()), scratch);
    1256312555    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));
    1256512557   
    1256612558    addBranch(
     
    1280412796    if (!canDoBinarySwitch || totalLength > Options::maximumBinaryStringSwitchTotalLength()) {
    1280512797        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);
    1280712799        m_jit.exceptionCheck();
    1280812800        m_jit.farJump(string, JSSwitchPtrTag);
     
    1284112833    slowCases.link(&m_jit);
    1284212834    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);
    1284412836    silentFillAllRegisters();
    1284512837    m_jit.exceptionCheck();
     
    1298812980
    1298912981    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);
    1299112983    m_jit.exceptionCheck();
    1299212984
     
    1300612998
    1300712999    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);
    1300913001#else
    1301013002    // These JSValues may be JSUndefined OR JSFunction*.
     
    1301813010
    1301913011    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());
    1302113013#endif
    1302213014    m_jit.exceptionCheck();
     
    1303213024    GPRReg resultGPR = result.gpr();
    1303313025    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())));
    1303513027    m_jit.exceptionCheck();
    1303613028    cellResult(resultGPR, node);
     
    1304413036    JSValueRegsFlushedCallResult result(this);
    1304513037    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())));
    1304713039    m_jit.exceptionCheck();
    1304813040    jsValueResult(resultRegs, node);
     
    1307213064    JSValueRegsFlushedCallResult result(this);
    1307313065    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());
    1307513067    m_jit.exceptionCheck();
    1307613068    jsValueResult(resultRegs, node);
     
    1308613078
    1308713079    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());
    1308913081    m_jit.exceptionCheck();
    1309013082    noResult(node);
     
    1315213144
    1315313145    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);
    1315513147    m_jit.exceptionCheck();
    1315613148
     
    1332913321                flushRegisters();
    1333013322                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);
    1333213324                m_jit.exceptionCheck();
    1333313325                cellResult(result.gpr(), node);
     
    1335013342        flushRegisters();
    1335113343        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);
    1335313345        m_jit.exceptionCheck();
    1335413346        cellResult(result.gpr(), node);
     
    1337213364    flushRegisters();
    1337313365    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);
    1337513367    m_jit.exceptionCheck();
    1337613368    cellResult(result.gpr(), node);
     
    1339313385    callOperation(
    1339413386        operationRegExpExecNonGlobalOrSticky, resultRegs,
    13395         globalObjectGPR, TrustedImmPtr(node->cellOperand()), argumentGPR);
     13387        globalObjectGPR, JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), argumentGPR);
    1339613388    m_jit.exceptionCheck();
    1339713389
     
    1341313405    callOperation(
    1341413406        operationRegExpMatchFastGlobalString, resultRegs,
    13415         globalObjectGPR, TrustedImmPtr(node->cellOperand()), argumentGPR);
     13407        globalObjectGPR, JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), argumentGPR);
    1341613408    m_jit.exceptionCheck();
    1341713409
     
    1359713589
    1359813590        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);
    1360013592        m_jit.exceptionCheck();
    1360113593        break;
     
    1361413606
    1361513607        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);
    1361713609        m_jit.exceptionCheck();
    1361813610        break;
     
    1362613618
    1362713619        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);
    1362913621        m_jit.exceptionCheck();
    1363013622        break;
     
    1363713629
    1363813630        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);
    1364013632        m_jit.exceptionCheck();
    1364113633        break;
     
    1367813670
    1367913671        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);
    1368113673        m_jit.exceptionCheck();
    1368213674        break;
     
    1369513687
    1369613688        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);
    1369813690        m_jit.exceptionCheck();
    1369913691        break;
     
    1370713699
    1370813700        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);
    1371013702        m_jit.exceptionCheck();
    1371113703        break;
     
    1371813710
    1371913711        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);
    1372113713        m_jit.exceptionCheck();
    1372213714        break;
     
    1385013842        sentinel = vm().sentinelSetBucket();
    1385113843    }
    13852     m_jit.move(TrustedImmPtr::weakPointer(m_graph, sentinel), resultGPR);
     13844    m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, sentinel), resultGPR);
    1385313845    done.link(&m_jit);
    1385413846
     
    1391213904    JSValueRegs valueRegs = value.jsValueRegs();
    1391313905    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);
    1391513907    m_jit.exceptionCheck();
    1391613908    m_jit.breakpoint();
     
    1392413916    speculateString(node->child1(), messageGPR);
    1392513917    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());
    1392713919    m_jit.exceptionCheck();
    1392813920    m_jit.breakpoint();
     
    1401414006    JSValueRegsFlushedCallResult result(this);
    1401514007    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);
    1401714009    m_jit.exceptionCheck();
    1401814010    jsValueResult(resultRegs, node);
     
    1408714079
    1408814080        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);
    1409014082        doneCases.append(m_jit.jump());
    1409114083        operationCall.link(&m_jit);
    1409214084    }
    1409314085
    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);
    1409514087    m_jit.exceptionCheck();
    1409614088
     
    1413614128
    1413714129        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);
    1413914131        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);
    1414114133        m_jit.exceptionCheck();
    1414214134
     
    1425214244    flushRegisters();
    1425314245    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());
    1425514247    m_jit.exceptionCheck();
    1425614248
     
    1433314325        if (node->child1().useKind() == CellOrOtherUse) {
    1433414326            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);
    1433614328            doneCases.append(m_jit.jump());
    1433714329            notOther.link(&m_jit);
     
    1439114383        slowCases.link(&m_jit);
    1439214384        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());
    1439414386        silentFillAllRegisters();
    1439514387        m_jit.exceptionCheck();
     
    1440614398    GPRFlushedCallResult result(this);
    1440714399    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);
    1440914401    m_jit.exceptionCheck();
    1441014402    cellResult(resultGPR, node);
     
    1449514487    GPRFlushedCallResult result(this);
    1449614488    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);
    1449814490    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);
    1450014492    m_jit.exceptionCheck();
    1450114493
     
    1452414516        emitAllocateJSObject<JSArray>(resultGPR, TrustedImmPtr(structure), TrustedImmPtr(array->toButterfly()), scratch1GPR, scratch2GPR, slowCases);
    1452514517
    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)));
    1452714519
    1452814520        DFG_ASSERT(m_graph, node, indexingMode & IsArray, indexingMode);
     
    1456714559    m_jit.move(TrustedImmPtr(m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage))), structureGPR);
    1456814560    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);
    1457014562    m_jit.exceptionCheck();
    1457114563    cellResult(resultGPR, node);
     
    1459514587        callOperation(
    1459614588            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);
    1459814590        m_jit.exceptionCheck();
    1459914591
     
    1463014622    else
    1463114623        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));
    1463314625
    1463414626    jsValueResult(tempRegs, node);
     
    1468014672            addSlowPathGenerator(slowPathCall(slowButArrayBufferCases, this, operationNewArrayBuffer, resultGPR, TrustedImmPtr(&vm()), arrayStructure, scratch3GPR));
    1468114673
    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));
    1468314675
    1468414676            cellResult(resultGPR, node);
     
    1469514687        GPRFlushedCallResult result(this);
    1469614688        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);
    1469814690        m_jit.exceptionCheck();
    1469914691
     
    1471014702        GPRFlushedCallResult result(this);
    1471114703        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);
    1471314705        m_jit.exceptionCheck();
    1471414706
     
    1473714729
    1473814730        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);
    1474014732        m_jit.exceptionCheck();
    1474114733
     
    1475014742
    1475114743        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);
    1475314745        m_jit.exceptionCheck();
    1475414746
     
    1477514767        GPRFlushedCallResult result(this);
    1477614768        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);
    1477814770        m_jit.exceptionCheck();
    1477914771
     
    1479014782        GPRFlushedCallResult result(this);
    1479114783        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);
    1479314785        m_jit.exceptionCheck();
    1479414786
     
    1484214834    m_jit.mutatorFence(vm());
    1484314835
    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()));
    1484514837
    1484614838    cellResult(resultGPR, node);
     
    1484914841void SpeculativeJIT::compileCreatePromise(Node* node)
    1485014842{
    14851     JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
     14843    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    1485214844
    1485314845    SpeculateCellOperand callee(this, node->child1());
     
    1486714859
    1486814860    m_jit.move(TrustedImmPtr(m_graph.registerStructure(node->isInternalPromise() ? globalObject->internalPromiseStructure() : globalObject->promiseStructure())), structureGPR);
    14869     auto fastPromisePath = m_jit.branchPtr(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()));
    1487014862
    1487114863    MacroAssembler::JumpList slowCases;
     
    1487914871    m_jit.move(TrustedImmPtr(node->isInternalPromise() ? JSInternalPromise::info() : JSPromise::info()), scratch1GPR);
    1488014872    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);
    1488214874    slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::globalObjectOffset())));
    1488314875
     
    1489214884    m_jit.mutatorFence(vm());
    1489314885
    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));
    1489514887
    1489614888    cellResult(resultGPR, node);
     
    1490114893void SpeculativeJIT::compileCreateInternalFieldObject(Node* node, Operation operation)
    1490214894{
    14903     JSGlobalObject* globalObject = m_jit.globalObjectFor(node->origin.semantic);
     14895    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    1490414896
    1490514897    SpeculateCellOperand callee(this, node->child1());
     
    1492814920    m_jit.move(TrustedImmPtr(JSClass::info()), scratch1GPR);
    1492914921    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);
    1493114923    slowCases.append(m_jit.branchPtr(CCallHelpers::NotEqual, scratch1GPR, CCallHelpers::Address(structureGPR, Structure::globalObjectOffset())));
    1493214924
     
    1493914931    m_jit.mutatorFence(vm());
    1494014932
    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));
    1494214934
    1494314935    cellResult(resultGPR, node);
     
    1506315055    m_jit.moveValueRegs(argumentRegs, resultRegs);
    1506415056
    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));
    1506615058
    1506715059    jsValueResult(resultRegs, node, DataFormatJS, UseChildrenCalledExplicitly);
     
    1508715079    m_jit.moveValueRegs(argumentRegs, resultRegs);
    1508815080
    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));
    1509015082
    1509115083    jsValueResult(resultRegs, node, DataFormatJSCell, UseChildrenCalledExplicitly);
     
    1511715109    m_jit.moveValueRegs(argumentRegs, resultRegs);
    1511815110
    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));
    1512015112
    1512115113    jsValueResult(resultRegs, node, DataFormatJS);
     
    1515215144    slowCases.append(m_jit.branchIfNotNumber(argumentRegs, tempGPR));
    1515315145    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));
    1515515147
    1515615148    jsValueResult(resultRegs, node);
     
    1521915211    GPRFlushedCallResult result(this);
    1522015212    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);
    1522215214    m_jit.exceptionCheck();
    1522315215    cellResult(resultGPR, node);
     
    1524115233    GPRFlushedCallResult result(this);
    1524215234    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);
    1524415236    m_jit.exceptionCheck();
    1524515237    cellResult(resultGPR, node);
     
    1546015452        m_jit.emitLoadPrototype(vm(), objectGPR, resultRegs, slowCases);
    1546115453        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));
    1546315455
    1546415456        jsValueResult(resultRegs, node);
     
    1547715469        m_jit.emitLoadPrototype(vm(), valueGPR, resultRegs, slowCases);
    1547815470        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));
    1548015472
    1548115473        jsValueResult(resultRegs, node);
     
    1560415596    addSlowPathGenerator(makeUnique<CallArrayAllocatorWithVariableSizeSlowPathGenerator>(
    1560515597        slowCases, this, operationNewArrayWithSize, resultGPR,
    15606         TrustedImmPtr::weakPointer(m_graph, globalObject),
     15598        JITCompiler::LinkableConstant(m_graph, globalObject),
    1560715599        structure,
    1560815600        shouldConvertLargeSizeToArrayStorage ? m_graph.registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage)) : structure,
     
    1573715729    }
    1573815730
    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));
    1574015732}
    1574115733
     
    1586215854    if (JITCode::useDataIC(JITType::DFGJIT)) {
    1586315855        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,
    1586515857            CCallHelpers::CellValue(baseGPR), identifier.rawBits());
    1586615858    } else {
    1586715859        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,
    1586915861            CCallHelpers::CellValue(baseGPR), identifier.rawBits());
    1587015862    }
     
    1589515887
    1589615888        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);
    1589815890        m_jit.exceptionCheck();
    1589915891
     
    1591615908
    1591715909    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));
    1591915911
    1592015912    unblessedBooleanResult(resultGPR, node, UseChildrenCalledExplicitly);
     
    1595615948
    1595715949        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);
    1595915951        m_jit.exceptionCheck();
    1596015952
     
    1598015972
    1598115973            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);
    1598315975            silentFillAllRegisters();
    1598415976            m_jit.exceptionCheck();
     
    1602016012
    1602116013    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);
    1602316015    silentFillAllRegisters();
    1602416016
     
    1617316165    auto isNonEmptyString = m_jit.branchTest32(CCallHelpers::NonZero, allocatorGPR);
    1617416166
    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);
    1617616168
    1617716169    isNonEmptyString.link(&m_jit);
     
    1618116173    case 2:
    1618216174        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]));
    1618416176        break;
    1618516177    case 3:
    1618616178        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]));
    1618816180        break;
    1618916181    default:
     
    1619916191    switch (numOpGPRs) {
    1620016192    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]);
    1620216194        m_jit.exceptionCheck();
    1620316195        break;
    1620416196    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]);
    1620616198        m_jit.exceptionCheck();
    1620716199        break;
     
    1630616298        if (!recoverGenericCase.empty()) {
    1630716299            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));
    1630916301            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));
    1631116303        }
    1631216304
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r292697 r293009  
    123123            : m_value(value)
    124124        {
    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::weakPointer instead.");
     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.");
    126126        }
    127127
     
    143143            : m_value(bitwise_cast<void*>(value))
    144144        {
    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));
    151145        }
    152146
     
    981975    }
    982976
    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);
    986980        return appendCallWithCallFrameRollbackOnExceptionSetResult(operation, result);
    987981    }
     
    11571151    {
    11581152        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);
    11591159    }
    11601160   
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r292929 r293009  
    216216        slowPath = slowPathCall(
    217217            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()),
    219219            CCallHelpers::CellValue(basePayloadGPR),
    220220            identifier.rawBits());
     
    222222        slowPath = slowPathCall(
    223223            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());
    225225    }
    226226
     
    252252        slowPath = slowPathCall(
    253253            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()),
    255255            CCallHelpers::CellValue(basePayloadGPR),
    256256            CCallHelpers::CellValue(thisPayloadGPR),
     
    262262        slowPath = slowPathCall(
    263263            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());
    265265    }
    266266
     
    290290        GPRTemporary remoteGlobalObject(this);
    291291
     292        GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
     293        GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr();
     294
    292295        if (!isKnownCell(operand.node()))
    293296            notCell = m_jit.branchIfNotCell(arg.jsValueRegs());
     
    302305
    303306        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);
    307308        m_jit.loadPtr(JITCompiler::Address(argPayloadGPR, JSCell::structureIDOffset()), resultPayloadGPR);
    308309        m_jit.loadPtr(JITCompiler::Address(resultPayloadGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    358359        GPRTemporary remoteGlobalObject(this);
    359360
     361        GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
     362        GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr();
     363
    360364        if (!isKnownCell(operand.node()))
    361365            notCell = m_jit.branchIfNotCell(arg.jsValueRegs());
     
    366370            invert ? taken : notTaken);
    367371   
    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);
    371373        m_jit.loadPtr(JITCompiler::Address(argPayloadGPR, JSCell::structureIDOffset()), resultGPR);
    372374        m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    422424       
    423425        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);
    425427        m_jit.exceptionCheck();
    426428        silentFillAllRegisters();
     
    431433
    432434        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);
    434436        m_jit.exceptionCheck();
    435437        silentFillAllRegisters();
     
    470472       
    471473        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);
    473475        m_jit.exceptionCheck();
    474476        silentFillAllRegisters();
     
    481483
    482484        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);
    484486        silentFillAllRegisters();
    485487        m_jit.exceptionCheck();
     
    634636            JITCompiler::Jump done = m_jit.jump();
    635637            slowCase.link(&m_jit);
    636             callOperation(operationThrowStackOverflowForVarargs, TrustedImmPtr::weakPointer(m_graph, globalObject));
     638            callOperation(operationThrowStackOverflowForVarargs, JITCompiler::LinkableConstant(m_graph, globalObject));
    637639            m_jit.exceptionCheck();
    638640            m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow);
     
    666668            // Right now, arguments is in argumentsTagGPR/argumentsPayloadGPR and the register file is
    667669            // 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);
    669671            m_jit.exceptionCheck();
    670672           
     
    676678            m_jit.addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 6 * sizeof(void*)))), scratchGPR1, JITCompiler::stackPointerRegister);
    677679           
    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);
    679681            m_jit.exceptionCheck();
    680682            m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister);
     
    817819        m_jit.subPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister);
    818820        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);
    820822        prepareForExternalCall();
    821823        m_jit.appendCall(operationCallEval);
     
    826828        m_jit.addPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister);
    827829        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);
    830832        m_jit.emitVirtualCallWithoutMovingGlobalObject(vm(), GPRInfo::regT2, CallMode::Regular);
    831833        ASSERT(info->callMode() == CallMode::Regular);
     
    933935    }
    934936
    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);
    936939    info->emitSlowPath(vm(), m_jit);
    937940
     
    15031506        m_jit.loadPtr(MacroAssembler::Address(valuePayloadGPR, JSCell::structureIDOffset()), structureGPR);
    15041507        speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse,
    1505             m_jit.branchPtr(
     1508            m_jit.branchLinkableConstant(
    15061509                MacroAssembler::Equal,
    15071510                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))));
    15091512
    15101513        isNotMasqueradesAsUndefined.link(&m_jit);
     
    16281631        m_jit.loadPtr(MacroAssembler::Address(valuePayloadGPR, JSCell::structureIDOffset()), scratchGPR);
    16291632        speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse,
    1630             m_jit.branchPtr(
     1633            m_jit.branchLinkableConstant(
    16311634                MacroAssembler::Equal,
    16321635                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))));
    16341637
    16351638        isNotMasqueradesAsUndefined.link(&m_jit);
     
    18011804            else
    18021805                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);
    18041807            if (canUseFlush == CanUseFlush::No)
    18051808                silentFillAllRegisters();
     
    18451848                slowPath = slowPathCall(
    18461849                    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);
    18481851            } else {
    18491852                slowPath = slowPathCall(
    18501853                    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);
    18521855            }
    18531856
     
    19461949            slowPathCall(
    19471950                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));
    19491952
    19501953        jsValueResult(resultRegs, node);
     
    20122015            slowPathCall(
    20132016                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));
    20152018
    20162019        jsValueResult(resultRegs, node);
     
    20692072            slowPathCall(
    20702073                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));
    20722075
    20732076        jsValueResult(resultRegs, node);
     
    26562659        flushRegisters();
    26572660        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);
    26592662        m_jit.exceptionCheck();
    26602663
     
    27572760                slowPathCall(
    27582761                    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));
    27602763           
    27612764            jsValueResult(valueTagGPR, valuePayloadGPR, node);
     
    27922795                slowPathCall(
    27932796                    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));
    27952798           
    27962799            jsValueResult(valueTagGPR, valuePayloadGPR, node);
     
    28302833                slowPathCall(
    28312834                    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));
    28332836
    28342837            jsValueResult(valueTagGPR, valuePayloadGPR, node);
     
    29872990        if (!(m_state.forNode(node->child1()).m_type & SpecBytecodeNumber)) {
    29882991            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);
    29902993            m_jit.exceptionCheck();
    29912994        } else {
     
    30013004            notNumber.link(&m_jit);
    30023005            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);
    30043007            silentFillAllRegisters();
    30053008            m_jit.exceptionCheck();
     
    35103513        GPRTemporary localGlobalObject(this);
    35113514        GPRTemporary remoteGlobalObject(this);
     3515
     3516        GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
     3517        GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr();
    35123518
    35133519        JITCompiler::Jump isCell = m_jit.branchIfCell(value.jsValueRegs());
     
    35303536           
    35313537            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);
    35353539            m_jit.loadPtr(JITCompiler::Address(value.payloadGPR(), JSCell::structureIDOffset()), result.gpr());
    35363540            m_jit.loadPtr(JITCompiler::Address(result.gpr(), Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    35963600        GPRFlushedCallResult result(this);
    35973601        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);
    35993603        booleanResult(resultGPR, node);
    36003604        break;
     
    36393643        GPRFlushedCallResult result(this);
    36403644        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);
    36423646        m_jit.exceptionCheck();
    36433647        strictInt32Result(resultGPR, node);
     
    36703674        GPRReg resultGPR = result.gpr();
    36713675        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);
    36733677        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);
    36753679        m_jit.exceptionCheck();
    36763680        cellResult(resultGPR, node);
     
    39313935            keyRegs = JSValueRegs(tempGPR, keyRegs.payloadGPR());
    39323936        }
    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);
    39343938        silentFillAllRegisters();
    39353939        m_jit.exceptionCheck();
     
    42194223void SpeculativeJIT::compileArithRandom(Node* node)
    42204224{
    4221     JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
    4222 
    42234225    flushRegisters();
    42244226
    42254227    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)));
    42274229    // operationRandom does not raise any exception.
    42284230    doubleResult(result.fpr(), node);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r292929 r293009  
    182182            slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), appropriateOptimizingGetByIdFunction(type),
    183183            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());
    185185    } else {
    186186        slowPath = slowPathCall(
    187187            slowCases, this, appropriateOptimizingGetByIdFunction(type),
    188188            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());
    190190    }
    191191   
     
    222222            slowCases, this, gen.stubInfo(), stubInfoGPR, CCallHelpers::Address(stubInfoGPR, StructureStubInfo::offsetOfSlowOperation()), operationGetByIdWithThisOptimize,
    223223            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());
    225225    } else {
    226226        slowPath = slowPathCall(
    227227            slowCases, this, operationGetByIdWithThisOptimize,
    228228            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());
    230230    }
    231231   
     
    264264        GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
    265265        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);
    267267        m_jit.emitLoadStructure(vm(), argGPR, resultGPR);
    268268        m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    306306        GPRTemporary remoteGlobalObject(this);
    307307
     308        GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
     309        GPRReg remoteGlobalObjectGPR = remoteGlobalObject.gpr();
     310
    308311        JITCompiler::Jump notCell;
    309312        if (!isKnownCell(operand.node()))
     
    314317            JITCompiler::TrustedImm32(MasqueradesAsUndefined), notTaken);
    315318
    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);
    319320        m_jit.emitLoadStructure(vm(), argGPR, resultGPR);
    320321        m_jit.loadPtr(JITCompiler::Address(resultGPR, Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    459460       
    460461        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);
    462463        silentFillAllRegisters();
    463464        m_jit.exceptionCheck();
     
    510511        jump(invert ? taken : notTaken, ForceJump);
    511512
    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));
    513514        branchTest32(invert ? JITCompiler::Zero : JITCompiler::NonZero, resultGPR, taken);
    514515    }
     
    548549       
    549550        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);
    551552        silentFillAllRegisters();
    552553        m_jit.exceptionCheck();
     
    604605    m_jit.move(TrustedImm64(0), resultGPR);
    605606
    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));
    607608
    608609    done.link(&m_jit);
     
    698699    GPRReg calleeGPR = InvalidGPRReg;
    699700    GPRReg callLinkInfoGPR = InvalidGPRReg;
     701    GPRReg globalObjectGPR = InvalidGPRReg;
    700702    CallFrameShuffleData shuffleData;
    701703   
     
    744746            JITCompiler::Jump done = m_jit.jump();
    745747            slowCase.link(&m_jit);
    746             callOperation(operationThrowStackOverflowForVarargs, TrustedImmPtr::weakPointer(m_graph, globalObject));
     748            callOperation(operationThrowStackOverflowForVarargs, JITCompiler::LinkableConstant(m_graph, globalObject));
    747749            m_jit.exceptionCheck();
    748750            m_jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow);
     
    773775           
    774776            // 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);
    776778            m_jit.exceptionCheck();
    777779           
     
    783785            m_jit.addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 5 * sizeof(void*)))), scratchGPR1, JITCompiler::stackPointerRegister);
    784786           
    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);
    786788            m_jit.exceptionCheck();
    787789            m_jit.addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, JITCompiler::stackPointerRegister);
     
    830832            calleeGPR = callee.gpr();
    831833
    832             // callLinkInfoGPR must be non callee-save register. Otherwise, tail-call preparation will fill it
     834            // callLinkInfoGPR/globalObjectGPR must be non callee-save register. Otherwise, tail-call preparation will fill it
    833835            // with saved callee-save. Also, it should not be the same to calleeGPR and regT0 since both will
    834836            // be used later differently.
     
    836838            // 1. We do not want to keep the register locked in the following sequence of the Call.
    837839            // 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                }
    841853            }
    842854            if (!isDirect)
     
    893905        // 2. This must be the last register allocation from DFG register bank, so it is OK (otherwise, callee.use() is wrong).
    894906        if (callLinkInfo->isDataIC()) {
    895             GPRTemporary callLinkInfoTemp(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0));
     907            GPRTemporary callLinkInfoTemp(this, JITCompiler::selectScratchGPR(calleeGPR, GPRInfo::regT0, GPRInfo::regT3));
    896908            callLinkInfoGPR = callLinkInfoTemp.gpr();
    897909        }
     
    944956        m_jit.subPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister);
    945957        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);
    947959        prepareForExternalCall();
    948960        m_jit.appendCall(operationCallEval);
     
    953965        m_jit.addPtr(TrustedImm32(requiredBytes), JITCompiler::stackPointerRegister);
    954966        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);
    957969        m_jit.emitVirtualCallWithoutMovingGlobalObject(vm(), GPRInfo::regT2, CallMode::Regular);
    958970        ASSERT(callLinkInfo->callMode() == CallMode::Regular);
     
    10151027   
    10161028    CCallHelpers::JumpList slowCases;
     1029    std::optional<CCallHelpers::Jump> done;
    10171030    if (isTail) {
    10181031        slowCases = callLinkInfo->emitTailCallFastPath(m_jit, calleeGPR, callLinkInfoGPR, scopedLambda<void()>([&]{
     
    10251038            }
    10261039        }));
    1027     } else
     1040    } else {
    10281041        slowCases = callLinkInfo->emitFastPath(m_jit, calleeGPR, callLinkInfoGPR);
    1029     JITCompiler::Jump done = m_jit.jump();
     1042        done = m_jit.jump();
     1043    }
    10301044
    10311045    slowCases.link(&m_jit);
     
    10331047
    10341048    if (node->op() == TailCall) {
     1049        m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, globalObject), globalObjectGPR);
     1050        shuffleData.registers[GPRInfo::regT3] = ValueRecovery::inGPR(globalObjectGPR, DataFormatJS);
    10351051        CallFrameShuffler callFrameShuffler(m_jit, shuffleData);
    10361052        callFrameShuffler.setCalleeJSValueRegs(JSValueRegs(GPRInfo::regT0));
     
    10381054    } else {
    10391055        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
    10401057        if (isTail)
    10411058            m_jit.emitRestoreCalleeSaves(); // This needs to happen after we moved calleeGPR to regT0
    10421059    }
    10431060
    1044     m_jit.move(TrustedImmPtr::weakPointer(m_graph, globalObject), GPRInfo::regT3); // JSGlobalObject needs to be in regT3
    10451061    callLinkInfo->emitSlowPath(vm(), m_jit);
    10461062
    1047     done.link(&m_jit);
     1063    if (done)
     1064        done->link(&m_jit);
    10481065    auto doneLocation = m_jit.label();
    10491066
     
    19271944    GPRReg resultGPR = result.gpr();
    19281945
    1929     m_jit.move(TrustedImmPtr::weakPointer(m_graph, node->cellOperand()->cell()), resultGPR);
     1946    m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, node->cellOperand()->cell()), resultGPR);
    19301947    m_jit.compare64(MacroAssembler::Equal, valueGPR, resultGPR, resultGPR);
    19311948    unblessedBooleanResult(resultGPR, node);
     
    19681985        m_jit.emitLoadStructure(vm(), valueGPR, structureGPR);
    19691986        speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse,
    1970             m_jit.branchPtr(
     1987            m_jit.branchLinkableConstant(
    19711988                MacroAssembler::Equal,
    19721989                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))));
    19741991
    19751992        isNotMasqueradesAsUndefined.link(&m_jit);
     
    21232140        m_jit.emitLoadStructure(vm(), valueGPR, structureGPR);
    21242141        speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse,
    2125             m_jit.branchPtr(
     2142            m_jit.branchLinkableConstant(
    21262143                MacroAssembler::Equal,
    21272144                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))));
    21292146
    21302147        isNotMasqueradesAsUndefined.link(&m_jit);
     
    21922209                skipStringCase = m_jit.branchIfNotString(valueGPR);
    21932210
    2194             branchPtr(MacroAssembler::Equal, valueGPR, TrustedImmPtr::weakPointer(m_graph, jsEmptyString(vm())), notTaken);
     2211            branchLinkableConstant(MacroAssembler::Equal, valueGPR, JITCompiler::LinkableConstant(m_graph, jsEmptyString(vm())), notTaken);
    21952212            jump(taken, ForceJump);
    21962213
     
    22162233            branchTest8(MacroAssembler::Zero, MacroAssembler::Address(valueGPR, JSCell::typeInfoFlagsOffset()), TrustedImm32(MasqueradesAsUndefined), taken);
    22172234            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);
    22202236            branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp1GPR, Structure::globalObjectOffset()), temp2GPR, taken);
    22212237            jump(notTaken, ForceJump);
     
    24152431            else
    24162432                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);
    24182434            if (canUseFlush == CanUseFlush::No)
    24192435                silentFillAllRegisters();
     
    24712487            slowPath = slowPathICCall(
    24722488                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);
    24742490        } else {
    24752491            slowPath = slowPathCall(
    24762492                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);
    24782494        }
    24792495
     
    25502566                slowPathCall(
    25512567                    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));
    25532569        }
    25542570
     
    26422658                slowPathCall(
    26432659                    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));
    26452661            jsValueResult(resultRegs.gpr(), node);
    26462662        }
     
    27002716            slowPathCall(
    27012717                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));
    27032719
    27042720        jsValueResult(resultReg, node);
     
    28062822        ptrdiff_t offset = JSGlobalObject::regExpGlobalDataOffset() + RegExpGlobalData::offsetOfCachedResult();
    28072823
    2808         m_jit.storePtr(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()));
    28092825        m_jit.storePtr(argumentGPR, JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfLastInput()));
    28102826        m_jit.store32(yarrRegisters.returnRegister, JITCompiler::Address(globalObjectGPR, offset + RegExpCachedResult::offsetOfResult() + OBJECT_OFFSETOF(MatchResult, start)));
     
    35313547        if (!storageEdge) {
    35323548            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));
    35343550                switch (node->op()) {
    35353551                case AtomicsAdd:
     
    37403756            GPRFlushedCallResult result(this);
    37413757            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);
    37433759            m_jit.exceptionCheck();
    37443760            jsValueResult(resultGPR, node);
     
    38823898            addSlowPathGenerator(
    38833899                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));
    38853901           
    38863902            // We can't know for sure that the result is an int because of the slow paths. :-/
     
    39153931            addSlowPathGenerator(
    39163932                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));
    39183934
    39193935            jsValueResult(valueGPR, node);
     
    40414057        if (!(m_state.forNode(node->child1()).m_type & SpecBytecodeNumber)) {
    40424058            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);
    40444060            m_jit.exceptionCheck();
    40454061        } else {
     
    40504066            notNumber.link(&m_jit);
    40514067            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);
    40534069            silentFillAllRegisters();
    40544070            m_jit.exceptionCheck();
     
    45404556
    45414557        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);
    45434559        m_jit.exceptionCheck();
    45444560
     
    46784694            GPRReg localGlobalObjectGPR = localGlobalObject.gpr();
    46794695            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);
    46814697            m_jit.emitLoadStructure(vm(), value.gpr(), result.gpr());
    46824698            m_jit.loadPtr(JITCompiler::Address(result.gpr(), Structure::globalObjectOffset()), remoteGlobalObjectGPR);
     
    48834899            slowPath.link(&m_jit);
    48844900            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));
    48864902            silentFillAllRegisters();
    48874903            m_jit.exceptionCheck();
     
    49284944        slowPath.link(&m_jit);
    49294945        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));
    49314947        silentFillAllRegisters();
    49324948        m_jit.exceptionCheck();
     
    50765092            silentSpillAllRegisters(indexGPR);
    50775093            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);
    50795095            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);
    50815097            silentFillAllRegisters();
    50825098            m_jit.exceptionCheck();
     
    50865102        notPresentInTable.link(&m_jit);
    50875103        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);
    50895105        else
    5090             m_jit.move(TrustedImmPtr::weakPointer(m_graph, vm().sentinelSetBucket()), resultGPR);
     5106            m_jit.loadLinkableConstant(JITCompiler::LinkableConstant(m_graph, vm().sentinelSetBucket()), resultGPR);
    50915107        done.link(&m_jit);
    50925108        cellResult(resultGPR, node);
     
    53915407        slowPath.link(&m_jit);
    53925408        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);
    53945410        silentFillAllRegisters();
    53955411        m_jit.exceptionCheck();
  • trunk/Source/JavaScriptCore/dfg/DFGThunks.cpp

    r292447 r293009  
    168168    jit.restoreCalleeSavesFromEntryFrameCalleeSavesBuffer(vm.topEntryFrame);
    169169    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
    170174
    171175    jit.farJump(GPRInfo::regT1, GPRInfo::callFrameRegister);
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp

    r292447 r293009  
    4545
    4646namespace 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 }
    5547
    5648AssemblyHelpers::Jump AssemblyHelpers::branchIfFastTypedArray(GPRReg baseGPR)
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r292457 r293009  
    15461546#endif
    15471547
    1548     JSGlobalObject* globalObjectFor(CodeOrigin codeOrigin)
    1549     {
    1550         return codeBlock()->globalObjectFor(codeOrigin);
    1551     }
    1552    
    1553     ExecutableBase* executableFor(CodeBlock*, const CodeOrigin&);
    1554    
    15551548    CodeBlock* baselineCodeBlockFor(const CodeOrigin& codeOrigin)
    15561549    {
  • trunk/Source/JavaScriptCore/jit/CCallHelpers.h

    r292445 r293009  
    7070    };
    7171
     72    // Base class for constant materializers.
     73    // It offers DerivedClass::materialize and poke functions.
     74    class ConstantMaterializer { };
     75
    7276    // The most general helper for setting arguments that fit in a GPR, if you can compute each
    7377    // argument without using any argument registers. You usually want one of the setupArguments*()
     
    366370    {
    367371        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);
    369376    }
    370377
     
    645652    {
    646653        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...);
    647675    }
    648676
  • trunk/Source/JavaScriptCore/jit/GPRInfo.h

    r292080 r293009  
    421421public:
    422422    typedef GPRReg RegisterType;
    423     static constexpr unsigned numberOfRegisters = 11;
     423    static constexpr unsigned numberOfRegisters = 10;
    424424    static constexpr unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS;
    425425
     
    428428    static constexpr GPRReg numberTagRegister = X86Registers::r14;
    429429    static constexpr GPRReg notCellMaskRegister = X86Registers::r15;
     430    static constexpr GPRReg constantsRegister = X86Registers::r13;
    430431
    431432    // Temporary registers.
     
    451452#if !OS(WINDOWS)
    452453    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
    456457#else
    457458    static constexpr GPRReg regCS1 = X86Registers::esi;
    458459    static constexpr GPRReg regCS2 = X86Registers::edi;
    459460    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
    463464#endif
    464465
     
    498499        ASSERT(index < numberOfRegisters);
    499500#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 };
    501502#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 };
    503504#endif
    504505        return registerForIndex[index];
     
    635636    static constexpr GPRReg numberTagRegister = ARM64Registers::x27;
    636637    static constexpr GPRReg notCellMaskRegister = ARM64Registers::x28;
     638    static constexpr GPRReg constantsRegister = ARM64Registers::x26;
    637639    static constexpr GPRReg dataTempRegister = MacroAssembler::dataTempRegister;
    638640    static constexpr GPRReg memoryTempRegister = MacroAssembler::memoryTempRegister;
     
    661663    static constexpr GPRReg regCS5 = ARM64Registers::x24; // Used by FTL only
    662664    static constexpr GPRReg regCS6 = ARM64Registers::x25;
    663     static constexpr GPRReg regCS7 = ARM64Registers::x26;
     665    static constexpr GPRReg regCS7 = ARM64Registers::x26; // constants
    664666    static constexpr GPRReg regCS8 = ARM64Registers::x27; // numberTag
    665667    static constexpr GPRReg regCS9 = ARM64Registers::x28; // notCellMask
     
    778780    static constexpr GPRReg nonPreservedNonReturnGPR = regT2;
    779781    static constexpr GPRReg regCS0 = MIPSRegisters::s0;
    780     static constexpr GPRReg regCS1 = MIPSRegisters::s1;
     782    static constexpr GPRReg regCS1 = MIPSRegisters::s1; // constants
    781783
    782784    static GPRReg toRegister(unsigned index)
     
    833835    static constexpr GPRReg numberTagRegister = RISCV64Registers::x25;
    834836    static constexpr GPRReg notCellMaskRegister = RISCV64Registers::x26;
     837    static constexpr GPRReg constantsRegister = RISCV64Registers::x24;
    835838
    836839    static constexpr GPRReg regT0 = RISCV64Registers::x10;
     
    855858    static constexpr GPRReg regCS5 = RISCV64Registers::x22;
    856859    static constexpr GPRReg regCS6 = RISCV64Registers::x23;
    857     static constexpr GPRReg regCS7 = RISCV64Registers::x24;
     860    static constexpr GPRReg regCS7 = RISCV64Registers::x24; // constants
    858861    static constexpr GPRReg regCS8 = RISCV64Registers::x25; // numberTag
    859862    static constexpr GPRReg regCS9 = RISCV64Registers::x26; // notCellMask
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r292767 r293009  
    238238
    239239#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
    241245            m_consistencyCheckCalls.append(nearCall());
     246        }
    242247#endif
    243248
     
    651656    loadPtr(addressFor(CallFrameSlot::codeBlock), regT0);
    652657    loadPtr(Address(regT0, CodeBlock::offsetOfMetadataTable()), s_metadataGPR);
    653     loadPtr(Address(regT0, CodeBlock::offsetOfBaselineJITData()), s_constantsGPR);
     658    loadPtr(Address(regT0, CodeBlock::offsetOfJITData()), s_constantsGPR);
    654659}
    655660
     
    684689    jit.loadPtr(addressFor(CallFrameSlot::codeBlock), expectedConstantsGPR);
    685690    jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOfMetadataTable()), expectedMetadataGPR);
    686     jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOfBaselineJITData()), expectedConstantsGPR);
     691    jit.loadPtr(Address(expectedConstantsGPR, CodeBlock::offsetOfJITData()), expectedConstantsGPR);
    687692
    688693    auto stackPointerOK = jit.branchPtr(Equal, expectedStackPointerGPR, stackPointerRegister);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r292445 r293009  
    10161016    {
    10171017        loadPtr(addressFor(CallFrameSlot::codeBlock), regT0);
    1018         loadPtr(Address(regT0, CodeBlock::offsetOfBaselineJITData()), s_constantsGPR);
     1018        loadPtr(Address(regT0, CodeBlock::offsetOfJITData()), s_constantsGPR);
    10191019    }
    10201020
     
    10371037    callOperationNoExceptionCheck(operationTryOSREnterAtCatchAndValueProfile, TrustedImmPtr(&vm()), m_bytecodeIndex.asBits());
    10381038    auto skipOSREntry = branchTestPtr(Zero, returnValueGPR);
     1039    emitPutToCallFrameHeader(returnValueGPR2, CallFrameSlot::codeBlock);
    10391040    emitRestoreCalleeSaves();
    10401041    farJump(returnValueGPR, ExceptionHandlerPtrTag);
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r292929 r293009  
    20852085}
    20862086
    2087 JSC_DEFINE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, char*, (VM* vmPointer, uint32_t bytecodeIndexBits))
     2087JSC_DEFINE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, SlowPathReturnType, (VM* vmPointer, uint32_t bytecodeIndexBits))
    20882088{
    20892089    VM& vm = *vmPointer;
     
    20952095    CodeBlock* optimizedReplacement = codeBlock->replacement();
    20962096    if (UNLIKELY(!optimizedReplacement))
    2097         return nullptr;
     2097        return encodeResult(nullptr, nullptr);
    20982098
    20992099    switch (optimizedReplacement->jitType()) {
     
    21012101    case JITType::FTLJIT: {
    21022102        MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, codeBlock, optimizedReplacement, bytecodeIndex);
    2103         return entry.executableAddress<char*>();
     2103        return encodeResult(entry.executableAddress<char*>(), optimizedReplacement);
    21042104    }
    21052105    default:
     
    21142114    });
    21152115
    2116     return nullptr;
     2116    return encodeResult(nullptr, nullptr);
    21172117}
    21182118
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r292372 r293009  
    261261#if ENABLE(DFG_JIT)
    262262JSC_DECLARE_JIT_OPERATION(operationOptimize, SlowPathReturnType, (VM*, uint32_t));
    263 JSC_DECLARE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, char*, (VM*, uint32_t));
     263JSC_DECLARE_JIT_OPERATION(operationTryOSREnterAtCatchAndValueProfile, SlowPathReturnType, (VM*, uint32_t));
    264264#endif
    265265JSC_DECLARE_JIT_OPERATION(operationPutGetterById, void, (JSGlobalObject*, JSCell*, UniquedStringImpl*, int32_t options, JSCell*));
  • trunk/Source/JavaScriptCore/jit/RegisterSet.cpp

    r291937 r293009  
    201201#if !OS(WINDOWS)
    202202    result.set(GPRInfo::regCS1);
    203     result.set(GPRInfo::regCS2);
     203    static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister);
    204204    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
    205205    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);
    211212    static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister);
    212213    static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister);
     214    result.set(GPRInfo::regCS4);
    213215    result.set(GPRInfo::regCS5);
    214216    result.set(GPRInfo::regCS6);
     
    219221#elif CPU(ARM64) || CPU(RISCV64)
    220222    result.set(GPRInfo::regCS6);
    221     result.set(GPRInfo::regCS7);
     223    static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister);
    222224    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
    223225    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
     226    result.set(GPRInfo::regCS7);
    224227    result.set(GPRInfo::regCS8);
    225228    result.set(GPRInfo::regCS9);
     
    237240    result.set(GPRInfo::regCS0);
    238241    result.set(GPRInfo::regCS1);
    239     result.set(GPRInfo::regCS2);
    240242#if !OS(WINDOWS)
     243    static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister);
    241244    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
    242245    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);
    248253    static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister);
    249254    static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister);
     255    result.set(GPRInfo::regCS4);
    250256    result.set(GPRInfo::regCS5);
    251257    result.set(GPRInfo::regCS6);
     
    255261    result.set(GPRInfo::regCS1);
    256262#elif CPU(ARM64) || CPU(RISCV64)
     263    static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister);
    257264    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
    258265    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
     266    result.set(GPRInfo::regCS7);
    259267    result.set(GPRInfo::regCS8);
    260268    result.set(GPRInfo::regCS9);
     
    272280    result.set(GPRInfo::regCS0);
    273281    result.set(GPRInfo::regCS1);
    274     result.set(GPRInfo::regCS2);
     282    static_assert(GPRInfo::regCS2 == GPRInfo::constantsRegister);
    275283    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister);
    276284    static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister);
     285    result.set(GPRInfo::regCS2);
    277286    result.set(GPRInfo::regCS3);
    278287    result.set(GPRInfo::regCS4);
     
    286295    result.set(GPRInfo::regCS5);
    287296    result.set(GPRInfo::regCS6);
    288     result.set(GPRInfo::regCS7);
     297    static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister);
    289298    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
    290299    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
     300    result.set(GPRInfo::regCS7);
    291301    result.set(GPRInfo::regCS8);
    292302    result.set(GPRInfo::regCS9);
     
    307317    result.set(GPRInfo::regCS5);
    308318    result.set(GPRInfo::regCS6);
    309     result.set(GPRInfo::regCS7);
     319    static_assert(GPRInfo::regCS7 == GPRInfo::constantsRegister);
    310320    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister);
    311321    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister);
     322    result.set(GPRInfo::regCS7);
    312323    result.set(GPRInfo::regCS8);
    313324    result.set(GPRInfo::regCS9);
  • trunk/Source/JavaScriptCore/llint/LLIntData.h

    r290768 r293009  
    396396#if CPU(X86_64) && !OS(WINDOWS)
    397397    static constexpr GPRReg metadataTableGPR = GPRInfo::regCS1;
    398     static constexpr GPRReg pbGPR = GPRInfo::regCS2;
     398    static constexpr GPRReg pbGPR = GPRInfo::constantsRegister;
    399399#elif CPU(X86_64) && OS(WINDOWS)
    400400    static constexpr GPRReg metadataTableGPR = GPRInfo::regCS3;
    401     static constexpr GPRReg pbGPR = GPRInfo::regCS4;
     401    static constexpr GPRReg pbGPR = GPRInfo::constantsRegister;
    402402#elif CPU(ARM64) || CPU(RISCV64)
    403403    static constexpr GPRReg metadataTableGPR = GPRInfo::regCS6;
    404     static constexpr GPRReg pbGPR = GPRInfo::regCS7;
     404    static constexpr GPRReg pbGPR = GPRInfo::constantsRegister;
    405405#elif CPU(MIPS) || CPU(ARM_THUMB2)
    406406    static constexpr GPRReg metadataTableGPR = GPRInfo::regCS0;
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r292372 r293009  
    25712571        # Baseline uses LLInt's PB register for its JIT constant pool.
    25722572        loadp CodeBlock[cfr], PB
    2573         loadp CodeBlock::m_baselineJITData[PB], PB
     2573        loadp CodeBlock::m_jitData[PB], PB
    25742574    end
    25752575
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r292929 r293009  
    925925    static ptrdiff_t regExpGlobalDataOffset() { return OBJECT_OFFSETOF(JSGlobalObject, m_regExpGlobalData); }
    926926
     927    static ptrdiff_t offsetOfGlobalThis() { return OBJECT_OFFSETOF(JSGlobalObject, m_globalThis); }
    927928    static ptrdiff_t offsetOfVM() { return OBJECT_OFFSETOF(JSGlobalObject, m_vm); }
    928929    static ptrdiff_t offsetOfGlobalLexicalEnvironment() { return OBJECT_OFFSETOF(JSGlobalObject, m_globalLexicalEnvironment); }
Note: See TracChangeset for help on using the changeset viewer.