⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286769 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 12:47:07 AM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Introduce BaselineCallLinkInfo and OptimizingCallLinkInfo to shrink sizeof(BaselineCallLinkInfo)
https://bugs.webkit.org/show_bug.cgi?id=233985

Reviewed by Mark Lam.

This patch introduces BaselineCallLinkInfo and OptimizingCallLinkInfo to shrink sizeof(BaselineCallLinkInfo).
BaselineCallLinkInfo is included in metadata, and allocated for LLInt and Baseline. So shrinking it can make
metadata small for LLInt and Baseline, which exists for all live functions.

We also reorder OpIteratorOpen::Metadata and OpIteratorNext::Metadata to shrink sizes.

sizeof(BaselineCallLinkInfo) becomes 88, while the old sizeof(CallLinkInfo) was 120.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/BytecodeList.rb:
  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::setMonomorphicCallee):
(JSC::CallLinkInfo::emitFastPathImpl):
(JSC::OptimizingCallLinkInfo::emitFastPath):
(JSC::OptimizingCallLinkInfo::emitTailCallFastPath):
(JSC::OptimizingCallLinkInfo::emitSlowPath):
(JSC::CallLinkInfo::emitDataICSlowPath):
(JSC::OptimizingCallLinkInfo::slowPathStart):
(JSC::OptimizingCallLinkInfo::fastPathStart):
(JSC::OptimizingCallLinkInfo::emitDirectFastPath):
(JSC::OptimizingCallLinkInfo::emitDirectTailCallFastPath):
(JSC::OptimizingCallLinkInfo::initializeDirectCall):
(JSC::OptimizingCallLinkInfo::setDirectCallTarget):
(JSC::BaselineCallLinkInfo::initialize):
(JSC::CallLinkInfo::slowPathStart): Deleted.
(JSC::CallLinkInfo::fastPathStart): Deleted.
(JSC::CallLinkInfo::emitFastPath): Deleted.
(JSC::CallLinkInfo::emitTailCallFastPath): Deleted.
(JSC::CallLinkInfo::emitSlowPath): Deleted.
(JSC::CallLinkInfo::initializeDataIC): Deleted.
(JSC::CallLinkInfo::emitDirectFastPath): Deleted.
(JSC::CallLinkInfo::emitDirectTailCallFastPath): Deleted.
(JSC::CallLinkInfo::initializeDirectCall): Deleted.
(JSC::CallLinkInfo::setDirectCallTarget): Deleted.

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::type const):
(JSC::CallLinkInfo::CallLinkInfo):
(JSC::CallLinkInfo::calleeGPR const):
(JSC::CallLinkInfo::callLinkInfoGPR const):
(JSC::CallLinkInfo::setCallLinkInfoGPR):
(JSC::CallLinkInfo::setUpCall): Deleted.
(JSC::CallLinkInfo::setCodeLocations): Deleted.
(JSC::CallLinkInfo::calleeGPR): Deleted.

  • bytecode/CallLinkStatus.cpp:

(JSC::CallLinkStatus::computeFor):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setupWithUnlinkedBaselineCode):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::getICStatusMap):
(JSC::CodeBlock::jettison):

  • bytecode/GetterSetterAccessCase.h:
  • bytecode/PolymorphicAccess.h:
  • bytecode/Repatch.cpp:

(JSC::revertCall):
(JSC::linkDirectCall):

  • bytecode/Repatch.h:
  • dfg/DFGCommonData.h:

(JSC::DFG::CommonData::addCallLinkInfo):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::addJSCall):
(JSC::DFG::JITCompiler::addJSDirectCall):
(JSC::DFG::JITCompiler::JSCallRecord::JSCallRecord):
(JSC::DFG::JITCompiler::JSDirectCallRecord::JSDirectCallRecord):

  • dfg/DFGOperations.cpp:

(JSC::DFG::JSC_DEFINE_JIT_OPERATION):

  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • jit/CallFrameShuffleData.cpp:

(JSC::CallFrameShuffleData::createForBaselineOrLLIntTailCall):

  • jit/GCAwareJITStubRoutine.cpp:

(JSC::MarkingGCAwareJITStubRoutine::MarkingGCAwareJITStubRoutine):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
(JSC::createICJITStubRoutine):

  • jit/GCAwareJITStubRoutine.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileTailCall):
(JSC::JIT::compileOpCall):
(): Deleted.

  • wasm/js/JSWebAssemblyCodeBlock.h:
  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJS):

  • wasm/js/WasmToJS.h:
Location:
trunk/Source/JavaScriptCore
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r286703 r286769  
     12021-12-09  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Introduce BaselineCallLinkInfo and OptimizingCallLinkInfo to shrink sizeof(BaselineCallLinkInfo)
     4        https://bugs.webkit.org/show_bug.cgi?id=233985
     5
     6        Reviewed by Mark Lam.
     7
     8        This patch introduces BaselineCallLinkInfo and OptimizingCallLinkInfo to shrink sizeof(BaselineCallLinkInfo).
     9        BaselineCallLinkInfo is included in metadata, and allocated for LLInt and Baseline. So shrinking it can make
     10        metadata small for LLInt and Baseline, which exists for all live functions.
     11
     12        We also reorder OpIteratorOpen::Metadata and OpIteratorNext::Metadata to shrink sizes.
     13
     14        sizeof(BaselineCallLinkInfo) becomes 88, while the old sizeof(CallLinkInfo) was 120.
     15
     16        * bytecode/AccessCase.cpp:
     17        (JSC::AccessCase::generateImpl):
     18        * bytecode/BytecodeList.rb:
     19        * bytecode/CallLinkInfo.cpp:
     20        (JSC::CallLinkInfo::setMonomorphicCallee):
     21        (JSC::CallLinkInfo::emitFastPathImpl):
     22        (JSC::OptimizingCallLinkInfo::emitFastPath):
     23        (JSC::OptimizingCallLinkInfo::emitTailCallFastPath):
     24        (JSC::OptimizingCallLinkInfo::emitSlowPath):
     25        (JSC::CallLinkInfo::emitDataICSlowPath):
     26        (JSC::OptimizingCallLinkInfo::slowPathStart):
     27        (JSC::OptimizingCallLinkInfo::fastPathStart):
     28        (JSC::OptimizingCallLinkInfo::emitDirectFastPath):
     29        (JSC::OptimizingCallLinkInfo::emitDirectTailCallFastPath):
     30        (JSC::OptimizingCallLinkInfo::initializeDirectCall):
     31        (JSC::OptimizingCallLinkInfo::setDirectCallTarget):
     32        (JSC::BaselineCallLinkInfo::initialize):
     33        (JSC::CallLinkInfo::slowPathStart): Deleted.
     34        (JSC::CallLinkInfo::fastPathStart): Deleted.
     35        (JSC::CallLinkInfo::emitFastPath): Deleted.
     36        (JSC::CallLinkInfo::emitTailCallFastPath): Deleted.
     37        (JSC::CallLinkInfo::emitSlowPath): Deleted.
     38        (JSC::CallLinkInfo::initializeDataIC): Deleted.
     39        (JSC::CallLinkInfo::emitDirectFastPath): Deleted.
     40        (JSC::CallLinkInfo::emitDirectTailCallFastPath): Deleted.
     41        (JSC::CallLinkInfo::initializeDirectCall): Deleted.
     42        (JSC::CallLinkInfo::setDirectCallTarget): Deleted.
     43        * bytecode/CallLinkInfo.h:
     44        (JSC::CallLinkInfo::type const):
     45        (JSC::CallLinkInfo::CallLinkInfo):
     46        (JSC::CallLinkInfo::calleeGPR const):
     47        (JSC::CallLinkInfo::callLinkInfoGPR const):
     48        (JSC::CallLinkInfo::setCallLinkInfoGPR):
     49        (JSC::CallLinkInfo::setUpCall): Deleted.
     50        (JSC::CallLinkInfo::setCodeLocations): Deleted.
     51        (JSC::CallLinkInfo::calleeGPR): Deleted.
     52        * bytecode/CallLinkStatus.cpp:
     53        (JSC::CallLinkStatus::computeFor):
     54        * bytecode/CodeBlock.cpp:
     55        (JSC::CodeBlock::finishCreation):
     56        (JSC::CodeBlock::setupWithUnlinkedBaselineCode):
     57        (JSC::CodeBlock::finalizeUnconditionally):
     58        (JSC::CodeBlock::getICStatusMap):
     59        (JSC::CodeBlock::jettison):
     60        * bytecode/GetterSetterAccessCase.h:
     61        * bytecode/PolymorphicAccess.h:
     62        * bytecode/Repatch.cpp:
     63        (JSC::revertCall):
     64        (JSC::linkDirectCall):
     65        * bytecode/Repatch.h:
     66        * dfg/DFGCommonData.h:
     67        (JSC::DFG::CommonData::addCallLinkInfo):
     68        * dfg/DFGJITCompiler.cpp:
     69        (JSC::DFG::JITCompiler::link):
     70        * dfg/DFGJITCompiler.h:
     71        (JSC::DFG::JITCompiler::addJSCall):
     72        (JSC::DFG::JITCompiler::addJSDirectCall):
     73        (JSC::DFG::JITCompiler::JSCallRecord::JSCallRecord):
     74        (JSC::DFG::JITCompiler::JSDirectCallRecord::JSDirectCallRecord):
     75        * dfg/DFGOperations.cpp:
     76        (JSC::DFG::JSC_DEFINE_JIT_OPERATION):
     77        * dfg/DFGOperations.h:
     78        * dfg/DFGSpeculativeJIT32_64.cpp:
     79        (JSC::DFG::SpeculativeJIT::emitCall):
     80        * dfg/DFGSpeculativeJIT64.cpp:
     81        (JSC::DFG::SpeculativeJIT::emitCall):
     82        * ftl/FTLLowerDFGToB3.cpp:
     83        (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
     84        * jit/CallFrameShuffleData.cpp:
     85        (JSC::CallFrameShuffleData::createForBaselineOrLLIntTailCall):
     86        * jit/GCAwareJITStubRoutine.cpp:
     87        (JSC::MarkingGCAwareJITStubRoutine::MarkingGCAwareJITStubRoutine):
     88        (JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
     89        (JSC::createICJITStubRoutine):
     90        * jit/GCAwareJITStubRoutine.h:
     91        * jit/JITCall.cpp:
     92        (JSC::JIT::compileCallEvalSlowCase):
     93        (JSC::JIT::compileTailCall):
     94        (JSC::JIT::compileOpCall):
     95        (): Deleted.
     96        * wasm/js/JSWebAssemblyCodeBlock.h:
     97        * wasm/js/WasmToJS.cpp:
     98        (JSC::Wasm::wasmToJS):
     99        * wasm/js/WasmToJS.h:
     100
    11012021-12-08  Asumu Takikawa  <asumu@igalia.com>
    2102
  • trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp

    r286667 r286769  
    19981998
    19991999            RELEASE_ASSERT(!access.callLinkInfo());
    2000             CallLinkInfo* callLinkInfo = state.m_callLinkInfos.add(stubInfo.codeOrigin);
     2000            auto* callLinkInfo = state.m_callLinkInfos.add(stubInfo.codeOrigin);
    20012001            access.m_callLinkInfo = callLinkInfo;
    20022002
  • trunk/Source/JavaScriptCore/bytecode/BytecodeList.rb

    r286635 r286769  
    2727    :BasicBlockLocation,
    2828    :BoundLabel,
    29     :CallLinkInfo,
     29    :BaselineCallLinkInfo,
    3030    :DebugHookType,
    3131    :ECMAMode,
     
    843843    },
    844844    metadata: {
    845         callLinkInfo: CallLinkInfo,
     845        callLinkInfo: BaselineCallLinkInfo,
    846846        arrayProfile: ArrayProfile,
    847847        profile: ValueProfile,
     
    856856    },
    857857    metadata: {
    858         callLinkInfo: CallLinkInfo,
     858        callLinkInfo: BaselineCallLinkInfo,
    859859        arrayProfile: ArrayProfile,
    860860        profile: ValueProfile,
     
    870870    },
    871871    metadata: {
    872         callLinkInfo: CallLinkInfo,
     872        callLinkInfo: BaselineCallLinkInfo,
    873873        arrayProfile: ArrayProfile,
    874874        profile: ValueProfile,
     
    885885    },
    886886    metadata: {
    887         callLinkInfo: CallLinkInfo,
     887        callLinkInfo: BaselineCallLinkInfo,
    888888        arrayProfile: ArrayProfile,
    889889        profile: ValueProfile,
     
    907907    },
    908908    metadata: {
    909         callLinkInfo: CallLinkInfo,
     909        callLinkInfo: BaselineCallLinkInfo,
    910910        arrayProfile: ArrayProfile,
    911911        profile: ValueProfile,
     
    929929    },
    930930    metadata: {
    931         callLinkInfo: CallLinkInfo,
     931        callLinkInfo: BaselineCallLinkInfo,
    932932        arrayProfile: ArrayProfile,
    933933        profile: ValueProfile,
     
    942942    },
    943943    metadata: {
    944         callLinkInfo: CallLinkInfo,
     944        callLinkInfo: BaselineCallLinkInfo,
    945945        arrayProfile: ArrayProfile,
    946946        profile: ValueProfile,
     
    957957    },
    958958    metadata: {
    959         callLinkInfo: CallLinkInfo,
     959        callLinkInfo: BaselineCallLinkInfo,
    960960        arrayProfile: ArrayProfile,
    961961        profile: ValueProfile,
     
    12581258    },
    12591259    metadata: {
    1260         iterationMetadata: IterationModeMetadata,
    12611260        iterableProfile: ValueProfile,
    1262         callLinkInfo: CallLinkInfo,
    1263         arrayProfile: ArrayProfile,
     1261        callLinkInfo: BaselineCallLinkInfo,
    12641262        iteratorProfile: ValueProfile,
    12651263        modeMetadata: GetByIdModeMetadata,
    12661264        nextProfile: ValueProfile,
     1265        arrayProfile: ArrayProfile,
     1266        iterationMetadata: IterationModeMetadata,
    12671267    },
    12681268    checkpoints: {
     
    12821282    },
    12831283    metadata: {
    1284         iterationMetadata: IterationModeMetadata,
    1285         iterableProfile: ArrayProfile,
    1286         callLinkInfo: CallLinkInfo,
    1287         arrayProfile: ArrayProfile,
     1284        callLinkInfo: BaselineCallLinkInfo,
    12881285        nextResultProfile: ValueProfile,
    12891286        doneModeMetadata: GetByIdModeMetadata,
     
    12911288        valueModeMetadata: GetByIdModeMetadata,
    12921289        valueProfile: ValueProfile,
     1290        arrayProfile: ArrayProfile,
     1291        iterableProfile: ArrayProfile,
     1292        iterationMetadata: IterationModeMetadata,
    12931293    },
    12941294    tmps: {
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp

    r285795 r286769  
    103103}
    104104
    105 CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::slowPathStart()
    106 {
    107     RELEASE_ASSERT(!isDataIC());
    108     return u.codeIC.m_slowPathStart;
    109 }
    110 
    111105CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::doneLocation()
    112106{
     
    125119    else {
    126120#if ENABLE(JIT)
    127         MacroAssembler::repatchNearCall(u.codeIC.m_callLocation, CodeLocationLabel<JSEntryPtrTag>(codePtr));
     121        MacroAssembler::repatchNearCall(static_cast<OptimizingCallLinkInfo*>(this)->m_callLocation, CodeLocationLabel<JSEntryPtrTag>(codePtr));
    128122        MacroAssembler::repatchPointer(u.codeIC.m_calleeLocation, callee);
    129123#else
     
    214208    RELEASE_ASSERT(value);
    215209    m_maxArgumentCountIncludingThis = value;
    216 }
    217 
    218 CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::fastPathStart()
    219 {
    220     RELEASE_ASSERT(isDirect() && isTailCall());
    221     return CodeLocationDataLabelPtr<JSInternalPtrTag>(u.codeIC.m_fastPathStart);
    222210}
    223211
     
    293281}
    294282
    295 #if ENABLE(JIT)
     283void CallLinkInfo::setSlowPathCallDestination(MacroAssemblerCodePtr<JSEntryPtrTag> codePtr)
     284{
     285    m_slowPathCallDestination = codePtr;
     286}
     287
     288void CallLinkInfo::revertCallToStub()
     289{
     290    RELEASE_ASSERT(stub());
     291    // The start of our JIT code is now a jump to the polymorphic stub. Rewrite the first instruction
     292    // to be what we need for non stub ICs.
     293
     294    // this runs into some branch compaction crap I'd like to avoid for now. Essentially, the branch
     295    // doesn't know if it can be compacted or not. So we end up with 28 bytes of machine code, for
     296    // what in all likelihood fits in 24. So we just splat out the first instruction. Long term, we
     297    // need something cleaner. But this works on arm64 for now.
     298
     299    if (isDataIC()) {
     300        m_calleeOrCodeBlock.clear();
     301        u.dataIC.m_monomorphicCallDestination = nullptr;
     302    } else {
     303#if ENABLE(JIT)
     304        CCallHelpers::revertJumpReplacementToBranchPtrWithPatch(
     305            CCallHelpers::startOfBranchPtrWithPatchOnRegister(u.codeIC.m_calleeLocation), calleeGPR(), nullptr);
     306#else
     307        RELEASE_ASSERT_NOT_REACHED();
     308#endif
     309    }
     310}
     311
     312void BaselineCallLinkInfo::initialize(VM& vm, CallType callType, BytecodeIndex bytecodeIndex, CallFrameShuffleData* frameShuffleData)
     313{
     314    UNUSED_PARAM(frameShuffleData);
     315    m_type = static_cast<unsigned>(Type::Baseline);
     316    ASSERT(Type::Baseline == type());
     317    m_codeOrigin = CodeOrigin(bytecodeIndex);
     318    m_callType = callType;
     319#if ENABLE(JIT)
     320    if (frameShuffleData) {
     321        // FIXME: It'd be nice if this were a refcounted data structure.
     322        m_frameShuffleData = makeUnique<CallFrameShuffleData>(*frameShuffleData);
     323    }
     324#endif
     325    setUsesDataICs(UseDataIC::Yes);
     326    setSlowPathCallDestination(vm.getCTILinkCall().code());
     327    // If JIT is disabled, we should not support dynamically generated call IC.
     328    if (!Options::useJIT())
     329        disallowStubs();
     330}
     331
     332#if ENABLE(JIT)
     333
    296334void CallLinkInfo::setFrameShuffleData(const CallFrameShuffleData& shuffleData)
    297335{
     
    337375        RELEASE_ASSERT(callLinkInfo);
    338376        jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
    339             callLinkInfo->u.codeIC.m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
     377            static_cast<OptimizingCallLinkInfo*>(callLinkInfo)->m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
    340378            callLinkInfo->u.codeIC.m_calleeLocation = linkBuffer.locationOf<JSInternalPtrTag>(calleeCheck);
    341379        });
     
    345383}
    346384
    347 CCallHelpers::JumpList CallLinkInfo::emitFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR, UseDataIC useDataIC)
     385MacroAssembler::JumpList CallLinkInfo::emitDataICFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR)
     386{
     387    RELEASE_ASSERT(callLinkInfoGPR != InvalidGPRReg);
     388    return emitFastPathImpl(nullptr, jit, calleeGPR, callLinkInfoGPR, UseDataIC::Yes, false, nullptr);
     389}
     390
     391MacroAssembler::JumpList CallLinkInfo::emitTailCallDataICFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR, ScopedLambda<void()>&& prepareForTailCall)
     392{
     393    RELEASE_ASSERT(callLinkInfoGPR != InvalidGPRReg);
     394    return emitFastPathImpl(nullptr, jit, calleeGPR, callLinkInfoGPR, UseDataIC::Yes, true, WTFMove(prepareForTailCall));
     395}
     396
     397void CallLinkInfo::setStub(Ref<PolymorphicCallStubRoutine>&& newStub)
     398{
     399    clearStub();
     400    m_stub = WTFMove(newStub);
     401
     402    m_calleeOrCodeBlock.clear();
     403
     404    if (isDataIC()) {
     405        *bitwise_cast<uintptr_t*>(m_calleeOrCodeBlock.slot()) = polymorphicCalleeMask;
     406        u.dataIC.m_monomorphicCallDestination = m_stub->code().code().retagged<JSEntryPtrTag>();
     407    } else {
     408        MacroAssembler::replaceWithJump(
     409            MacroAssembler::startOfBranchPtrWithPatchOnRegister(u.codeIC.m_calleeLocation),
     410            CodeLocationLabel<JITStubRoutinePtrTag>(m_stub->code().code()));
     411    }
     412}
     413
     414void CallLinkInfo::emitDataICSlowPath(VM&, CCallHelpers& jit, GPRReg callLinkInfoGPR)
     415{
     416    jit.move(callLinkInfoGPR, GPRInfo::regT2);
     417    jit.call(CCallHelpers::Address(GPRInfo::regT2, offsetOfSlowPathCallDestination()), JSEntryPtrTag);
     418}
     419
     420CCallHelpers::JumpList OptimizingCallLinkInfo::emitFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR, UseDataIC useDataIC)
    348421{
    349422    RELEASE_ASSERT(!isTailCall());
     
    353426        RELEASE_ASSERT(callLinkInfoGPR != GPRReg::InvalidGPRReg);
    354427        jit.move(CCallHelpers::TrustedImmPtr(this), callLinkInfoGPR);
    355         u.dataIC.m_callLinkInfoGPR = callLinkInfoGPR;
     428        setCallLinkInfoGPR(callLinkInfoGPR);
    356429    }
    357430
     
    359432}
    360433
    361 MacroAssembler::JumpList CallLinkInfo::emitTailCallFastPath(CCallHelpers& jit, GPRReg calleeGPR, ScopedLambda<void()>&& prepareForTailCall)
     434MacroAssembler::JumpList OptimizingCallLinkInfo::emitTailCallFastPath(CCallHelpers& jit, GPRReg calleeGPR, ScopedLambda<void()>&& prepareForTailCall)
    362435{
    363436    RELEASE_ASSERT(isTailCall());
     
    365438    return emitFastPathImpl(this, jit, calleeGPR, InvalidGPRReg, UseDataIC::No, isTailCall(), WTFMove(prepareForTailCall));
    366439}
    367 
    368 MacroAssembler::JumpList CallLinkInfo::emitDataICFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR)
    369 {
    370     RELEASE_ASSERT(callLinkInfoGPR != InvalidGPRReg);
    371     return emitFastPathImpl(nullptr, jit, calleeGPR, callLinkInfoGPR, UseDataIC::Yes, false, nullptr);
    372 }
    373 
    374 MacroAssembler::JumpList CallLinkInfo::emitTailCallDataICFastPath(CCallHelpers& jit, GPRReg calleeGPR, GPRReg callLinkInfoGPR, ScopedLambda<void()>&& prepareForTailCall)
    375 {
    376     RELEASE_ASSERT(callLinkInfoGPR != InvalidGPRReg);
    377     return emitFastPathImpl(nullptr, jit, calleeGPR, callLinkInfoGPR, UseDataIC::Yes, true, WTFMove(prepareForTailCall));
    378 }
    379 
    380 void CallLinkInfo::emitSlowPath(VM& vm, CCallHelpers& jit)
     440void OptimizingCallLinkInfo::emitSlowPath(VM& vm, CCallHelpers& jit)
    381441{
    382442    setSlowPathCallDestination(vm.getCTILinkCall().code());
     
    385445}
    386446
    387 void CallLinkInfo::emitDataICSlowPath(VM&, CCallHelpers& jit, GPRReg callLinkInfoGPR)
    388 {
    389     jit.move(callLinkInfoGPR, GPRInfo::regT2);
    390     jit.call(CCallHelpers::Address(GPRInfo::regT2, offsetOfSlowPathCallDestination()), JSEntryPtrTag);
    391 }
    392 #endif
    393 
    394 void CallLinkInfo::initializeDataIC(VM& vm, CallType callType, BytecodeIndex bytecodeIndex, CallFrameShuffleData* frameShuffleData)
    395 {
    396     UNUSED_PARAM(frameShuffleData);
    397     m_codeOrigin = CodeOrigin(bytecodeIndex);
    398     m_callType = callType;
    399 #if ENABLE(JIT)
    400     GPRReg calleeGPR = GPRInfo::regT0;
    401     GPRReg callLinkInfoGPR = GPRInfo::regT2;
    402     m_calleeGPR = calleeGPR;
    403     if (frameShuffleData) {
    404         // FIXME: It'd be nice if this were a refcounted data structure.
    405         m_frameShuffleData = makeUnique<CallFrameShuffleData>(*frameShuffleData);
    406     }
    407     u.dataIC.m_callLinkInfoGPR = callLinkInfoGPR;
    408 #endif
    409     setUsesDataICs(UseDataIC::Yes);
    410     setSlowPathCallDestination(vm.getCTILinkCall().code());
    411     // If JIT is disabled, we should not support dynamically generated call IC.
    412     if (!Options::useJIT())
    413         disallowStubs();
    414 }
    415 
    416 #if ENABLE(JIT)
    417 void CallLinkInfo::emitDirectFastPath(CCallHelpers& jit)
     447CodeLocationLabel<JSInternalPtrTag> OptimizingCallLinkInfo::slowPathStart()
     448{
     449    RELEASE_ASSERT(!isDataIC());
     450    return m_slowPathStart;
     451}
     452
     453CodeLocationLabel<JSInternalPtrTag> OptimizingCallLinkInfo::fastPathStart()
     454{
     455    RELEASE_ASSERT(isDirect() && isTailCall());
     456    return CodeLocationDataLabelPtr<JSInternalPtrTag>(m_fastPathStart);
     457}
     458
     459void OptimizingCallLinkInfo::emitDirectFastPath(CCallHelpers& jit)
    418460{
    419461    RELEASE_ASSERT(!isTailCall());
     
    423465    auto call = jit.nearCall();
    424466    jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
    425         u.codeIC.m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
     467        m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
    426468    });
    427469    jit.addLateLinkTask([this] (LinkBuffer&) {
     
    430472}
    431473
    432 void CallLinkInfo::emitDirectTailCallFastPath(CCallHelpers& jit, ScopedLambda<void()>&& prepareForTailCall)
     474void OptimizingCallLinkInfo::emitDirectTailCallFastPath(CCallHelpers& jit, ScopedLambda<void()>&& prepareForTailCall)
    433475{
    434476    RELEASE_ASSERT(isTailCall());
     
    438480    auto fastPathStart = jit.label();
    439481    jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
    440         u.codeIC.m_fastPathStart = linkBuffer.locationOf<JSInternalPtrTag>(fastPathStart);
     482        m_fastPathStart = linkBuffer.locationOf<JSInternalPtrTag>(fastPathStart);
    441483    });
    442484
     
    448490    auto call = jit.nearTailCall();
    449491    jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
    450         u.codeIC.m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
     492        m_callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
    451493    });
    452494    jit.addLateLinkTask([this] (LinkBuffer&) {
     
    455497}
    456498
    457 void CallLinkInfo::initializeDirectCall()
    458 {
    459     RELEASE_ASSERT(isDirect());
    460     ASSERT(u.codeIC.m_callLocation);
     499void OptimizingCallLinkInfo::initializeDirectCall()
     500{
     501    RELEASE_ASSERT(isDirect());
     502    ASSERT(m_callLocation);
    461503    if (isTailCall()) {
    462504        RELEASE_ASSERT(fastPathStart());
     
    468510        }), "initialize direct call");
    469511    } else
    470         MacroAssembler::repatchNearCall(u.codeIC.m_callLocation, slowPathStart());
    471 }
    472 
    473 void CallLinkInfo::setDirectCallTarget(CodeLocationLabel<JSEntryPtrTag> target)
     512        MacroAssembler::repatchNearCall(m_callLocation, slowPathStart());
     513}
     514
     515void OptimizingCallLinkInfo::setDirectCallTarget(CodeLocationLabel<JSEntryPtrTag> target)
    474516{
    475517    RELEASE_ASSERT(isDirect());
     
    484526    }
    485527
    486     MacroAssembler::repatchNearCall(u.codeIC.m_callLocation, target);
    487 }
    488 #endif
    489 
    490 void CallLinkInfo::setSlowPathCallDestination(MacroAssemblerCodePtr<JSEntryPtrTag> codePtr)
    491 {
    492     m_slowPathCallDestination = codePtr;
    493 }
    494 
    495 void CallLinkInfo::revertCallToStub()
    496 {
    497     RELEASE_ASSERT(stub());
    498     // The start of our JIT code is now a jump to the polymorphic stub. Rewrite the first instruction
    499     // to be what we need for non stub ICs.
    500 
    501     // this runs into some branch compaction crap I'd like to avoid for now. Essentially, the branch
    502     // doesn't know if it can be compacted or not. So we end up with 28 bytes of machine code, for
    503     // what in all likelihood fits in 24. So we just splat out the first instruction. Long term, we
    504     // need something cleaner. But this works on arm64 for now.
    505 
    506     if (isDataIC()) {
    507         m_calleeOrCodeBlock.clear();
    508         u.dataIC.m_monomorphicCallDestination = nullptr;
    509     } else {
    510 #if ENABLE(JIT)
    511         CCallHelpers::revertJumpReplacementToBranchPtrWithPatch(
    512             CCallHelpers::startOfBranchPtrWithPatchOnRegister(u.codeIC.m_calleeLocation), calleeGPR(), nullptr);
    513 #else
    514         RELEASE_ASSERT_NOT_REACHED();
    515 #endif
    516     }
    517 }
    518 
    519 #if ENABLE(JIT)
    520 void CallLinkInfo::setStub(Ref<PolymorphicCallStubRoutine>&& newStub)
    521 {
    522     clearStub();
    523     m_stub = WTFMove(newStub);
    524 
    525     m_calleeOrCodeBlock.clear();
    526 
    527     if (isDataIC()) {
    528         *bitwise_cast<uintptr_t*>(m_calleeOrCodeBlock.slot()) = polymorphicCalleeMask;
    529         u.dataIC.m_monomorphicCallDestination = m_stub->code().code().retagged<JSEntryPtrTag>();
    530     } else {
    531         MacroAssembler::replaceWithJump(
    532             MacroAssembler::startOfBranchPtrWithPatchOnRegister(u.codeIC.m_calleeLocation),
    533             CodeLocationLabel<JITStubRoutinePtrTag>(m_stub->code().code()));
    534     }
    535 }
     528    MacroAssembler::repatchNearCall(m_callLocation, target);
     529}
     530
    536531#endif
    537532
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h

    r285795 r286769  
    4848struct UnlinkedCallLinkInfo;
    4949
     50#if ENABLE(JIT)
     51namespace BaselineCallRegisters {
     52constexpr JSValueRegs calleeJSR { JSRInfo::jsRegT10 };
     53constexpr GPRReg calleeGPR { GPRInfo::regT0 };
     54constexpr GPRReg callLinkInfoGPR { GPRInfo::regT2 };
     55}
     56#endif
     57
    5058class CallLinkInfo : public PackedRawSentinelNode<CallLinkInfo> {
    5159public:
    5260    friend class LLIntOffsetsExtractor;
     61
     62    enum class Type : uint8_t {
     63        Baseline,
     64        Optimizing,
     65    };
    5366
    5467    enum CallType : uint8_t {
     
    8093            return false;
    8194        }
    82     }
    83 
    84     CallLinkInfo(CodeOrigin codeOrigin)
    85         : m_codeOrigin(codeOrigin)
    86         , m_hasSeenShouldRepatch(false)
    87         , m_hasSeenClosure(false)
    88         , m_clearedByGC(false)
    89         , m_clearedByVirtual(false)
    90         , m_allowStubs(true)
    91         , m_clearedByJettison(false)
    92         , m_callType(None)
    93         , m_useDataIC(static_cast<unsigned>(UseDataIC::Yes))
    94     {
    95     }
    96 
    97     CallLinkInfo()
    98         : CallLinkInfo(CodeOrigin { })
    99     {
    10095    }
    10196
     
    184179    void unlink(VM&);
    185180
    186 #if ENABLE(JIT)
    187     void setUpCall(CallType callType, GPRReg calleeGPR)
    188     {
    189         m_callType = callType;
    190         m_calleeGPR = calleeGPR;
    191     }
    192 
    193     GPRReg calleeGPR() const { return m_calleeGPR; }
    194 #endif
    195 
    196     void initializeDataIC(VM&, CallType, BytecodeIndex, CallFrameShuffleData*);
    197    
    198181    enum class UseDataIC : uint8_t {
    199182        Yes,
     
    202185
    203186#if ENABLE(JIT)
    204 private:
     187protected:
    205188    static MacroAssembler::JumpList emitFastPathImpl(CallLinkInfo*, CCallHelpers&, GPRReg calleeGPR, GPRReg callLinkInfoGPR, UseDataIC, bool isTailCall, ScopedLambda<void()>&& prepareForTailCall) WARN_UNUSED_RETURN;
    206189public:
    207190    static MacroAssembler::JumpList emitDataICFastPath(CCallHelpers&, GPRReg calleeGPR, GPRReg callLinkInfoGPR) WARN_UNUSED_RETURN;
    208191    static MacroAssembler::JumpList emitTailCallDataICFastPath(CCallHelpers&, GPRReg calleeGPR, GPRReg callLinkInfoGPR, ScopedLambda<void()>&& prepareForTailCall) WARN_UNUSED_RETURN;
    209     MacroAssembler::JumpList emitFastPath(CCallHelpers&, GPRReg calleeGPR, GPRReg callLinkInfoGPR, UseDataIC) WARN_UNUSED_RETURN;
    210     MacroAssembler::JumpList emitTailCallFastPath(CCallHelpers&, GPRReg calleeGPR, ScopedLambda<void()>&& prepareForTailCall) WARN_UNUSED_RETURN;
    211     void emitDirectFastPath(CCallHelpers&);
    212     void emitDirectTailCallFastPath(CCallHelpers&, ScopedLambda<void()>&& prepareForTailCall);
    213     void emitSlowPath(VM&, CCallHelpers&);
    214192    static void emitDataICSlowPath(VM&, CCallHelpers&, GPRReg callLinkInfoGPR);
    215 
    216     void initializeDirectCall();
    217     void setDirectCallTarget(CodeLocationLabel<JSEntryPtrTag>);
    218193#endif
    219194
     
    223198    void setUsesDataICs(UseDataIC useDataIC) { m_useDataIC = static_cast<unsigned>(useDataIC); }
    224199
    225     void setCodeLocations(
    226         CodeLocationLabel<JSInternalPtrTag> slowPathStart,
    227         CodeLocationLabel<JSInternalPtrTag> doneLocation)
    228     {
    229         if (!isDataIC())
    230             u.codeIC.m_slowPathStart = slowPathStart;
    231         m_doneLocation = doneLocation;
    232     }
    233 
    234 
    235200    bool allowStubs() const { return m_allowStubs; }
    236201
     
    240205    }
    241206
    242     CodeLocationLabel<JSInternalPtrTag> slowPathStart();
    243207    CodeLocationLabel<JSInternalPtrTag> doneLocation();
    244208
     
    372336
    373337#if ENABLE(JIT)
    374     GPRReg calleeGPR()
    375     {
    376         return m_calleeGPR;
    377     }
     338    GPRReg calleeGPR() const;
     339    GPRReg callLinkInfoGPR() const;
    378340#endif
    379341
     
    419381#endif
    420382
    421 private:
    422 
    423     CodeLocationLabel<JSInternalPtrTag> fastPathStart();
     383    Type type() const { return static_cast<Type>(m_type); }
     384
     385protected:
     386    CallLinkInfo(Type type, CodeOrigin codeOrigin)
     387        : m_codeOrigin(codeOrigin)
     388        , m_hasSeenShouldRepatch(false)
     389        , m_hasSeenClosure(false)
     390        , m_clearedByGC(false)
     391        , m_clearedByVirtual(false)
     392        , m_allowStubs(true)
     393        , m_clearedByJettison(false)
     394        , m_callType(None)
     395        , m_useDataIC(static_cast<unsigned>(UseDataIC::Yes))
     396        , m_type(static_cast<unsigned>(type))
     397    {
     398        ASSERT(type == this->type());
     399    }
     400
     401    CallLinkInfo(Type type)
     402        : CallLinkInfo(type, CodeOrigin { })
     403    {
     404    }
     405
     406#if ENABLE(JIT)
     407    void setCallLinkInfoGPR(GPRReg);
     408#endif
    424409
    425410    uint32_t m_maxArgumentCountIncludingThis { 0 }; // For varargs: the profiled maximum number of arguments. For direct: the number of stack slots allocated for arguments.
     
    427412    MacroAssemblerCodePtr<JSEntryPtrTag> m_slowPathCallDestination;
    428413    union UnionType {
    429         UnionType()
    430 #if ENABLE(JIT)
    431             : dataIC { nullptr, InvalidGPRReg }
    432 #else
     414        UnionType()
    433415            : dataIC { nullptr }
    434 #endif
    435416        { }
     417
    436418        struct DataIC {
    437419            MacroAssemblerCodePtr<JSEntryPtrTag> m_monomorphicCallDestination;
    438 #if ENABLE(JIT)
    439             GPRReg m_callLinkInfoGPR;
    440 #endif
    441420        } dataIC;
    442421
    443422        struct {
    444             CodeLocationNearCall<JSInternalPtrTag> m_callLocation;
    445423            CodeLocationDataLabelPtr<JSInternalPtrTag> m_calleeLocation;
    446             CodeLocationLabel<JSInternalPtrTag> m_slowPathStart;
    447             CodeLocationLabel<JSInternalPtrTag> m_fastPathStart;
    448424        } codeIC;
    449425    } u;
     
    464440    unsigned m_callType : 4; // CallType
    465441    unsigned m_useDataIC : 1; // UseDataIC
     442    unsigned m_type : 1; // Type
    466443#if ENABLE(JIT)
    467444    GPRReg m_calleeGPR { InvalidGPRReg };
     445    GPRReg m_callLinkInfoGPR { InvalidGPRReg };
    468446#endif
    469447    uint32_t m_slowPathCount { 0 };
     448};
     449
     450class BaselineCallLinkInfo final : public CallLinkInfo {
     451public:
     452    BaselineCallLinkInfo()
     453        : CallLinkInfo(Type::Baseline)
     454    {
     455    }
     456
     457    void initialize(VM&, CallType, BytecodeIndex, CallFrameShuffleData*);
     458
     459    void setCodeLocations(CodeLocationLabel<JSInternalPtrTag> doneLocation)
     460    {
     461        m_doneLocation = doneLocation;
     462    }
     463
     464#if ENABLE(JIT)
     465    static constexpr GPRReg calleeGPR() { return BaselineCallRegisters::calleeGPR; }
     466    static constexpr GPRReg callLinkInfoGPR() { return BaselineCallRegisters::callLinkInfoGPR; }
     467    void setCallLinkInfoGPR(GPRReg callLinkInfoGPR) { RELEASE_ASSERT(callLinkInfoGPR == BaselineCallRegisters::callLinkInfoGPR); }
     468#endif
    470469};
    471470
     
    480479};
    481480
     481#if ENABLE(JIT)
     482
     483class OptimizingCallLinkInfo final : public CallLinkInfo {
     484public:
     485    friend class CallLinkInfo;
     486
     487    OptimizingCallLinkInfo(CodeOrigin codeOrigin)
     488        : CallLinkInfo(Type::Optimizing, codeOrigin)
     489    {
     490    }
     491
     492    void setUpCall(CallType callType, GPRReg calleeGPR)
     493    {
     494        m_callType = callType;
     495        m_calleeGPR = calleeGPR;
     496    }
     497
     498    void setCodeLocations(
     499        CodeLocationLabel<JSInternalPtrTag> slowPathStart,
     500        CodeLocationLabel<JSInternalPtrTag> doneLocation)
     501    {
     502        if (!isDataIC())
     503            m_slowPathStart = slowPathStart;
     504        m_doneLocation = doneLocation;
     505    }
     506
     507    CodeLocationLabel<JSInternalPtrTag> fastPathStart();
     508    CodeLocationLabel<JSInternalPtrTag> slowPathStart();
     509
     510    GPRReg calleeGPR() const { return m_calleeGPR; }
     511    GPRReg callLinkInfoGPR() const { return m_callLinkInfoGPR; }
     512    void setCallLinkInfoGPR(GPRReg callLinkInfoGPR) { m_callLinkInfoGPR = callLinkInfoGPR; }
     513
     514    void emitDirectFastPath(CCallHelpers&);
     515    void emitDirectTailCallFastPath(CCallHelpers&, ScopedLambda<void()>&& prepareForTailCall);
     516    void initializeDirectCall();
     517    void setDirectCallTarget(CodeLocationLabel<JSEntryPtrTag>);
     518    void emitSlowPath(VM&, CCallHelpers&);
     519
     520    MacroAssembler::JumpList emitFastPath(CCallHelpers&, GPRReg calleeGPR, GPRReg callLinkInfoGPR, UseDataIC) WARN_UNUSED_RETURN;
     521    MacroAssembler::JumpList emitTailCallFastPath(CCallHelpers&, GPRReg calleeGPR, ScopedLambda<void()>&& prepareForTailCall) WARN_UNUSED_RETURN;
     522
     523private:
     524    CodeLocationNearCall<JSInternalPtrTag> m_callLocation;
     525    CodeLocationLabel<JSInternalPtrTag> m_slowPathStart;
     526    CodeLocationLabel<JSInternalPtrTag> m_fastPathStart;
     527};
     528
     529inline GPRReg CallLinkInfo::calleeGPR() const
     530{
     531    switch (type()) {
     532    case Type::Baseline:
     533        return static_cast<const BaselineCallLinkInfo*>(this)->calleeGPR();
     534    case Type::Optimizing:
     535        return static_cast<const OptimizingCallLinkInfo*>(this)->calleeGPR();
     536    }
     537    return InvalidGPRReg;
     538}
     539
     540inline GPRReg CallLinkInfo::callLinkInfoGPR() const
     541{
     542    switch (type()) {
     543    case Type::Baseline:
     544        return static_cast<const BaselineCallLinkInfo*>(this)->callLinkInfoGPR();
     545    case Type::Optimizing:
     546        return static_cast<const OptimizingCallLinkInfo*>(this)->callLinkInfoGPR();
     547    }
     548    return InvalidGPRReg;
     549}
     550
     551inline void CallLinkInfo::setCallLinkInfoGPR(GPRReg callLinkInfoGPR)
     552{
     553    switch (type()) {
     554    case Type::Baseline:
     555        return static_cast<BaselineCallLinkInfo*>(this)->setCallLinkInfoGPR(callLinkInfoGPR);
     556    case Type::Optimizing:
     557        return static_cast<OptimizingCallLinkInfo*>(this)->setCallLinkInfoGPR(callLinkInfoGPR);
     558    }
     559}
     560
     561#endif
     562
    482563} // namespace JSC
  • trunk/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp

    r285795 r286769  
    325325                return CallLinkStatus();
    326326           
    327             if (CallLinkStatusInternal::verbose)
    328                 dataLog("Have CallLinkInfo with CodeOrigin = ", status.callLinkInfo->codeOrigin(), "\n");
     327            dataLogLnIf(CallLinkStatusInternal::verbose, "Have CallLinkInfo with CodeOrigin = ", codeOrigin, "\n");
    329328            CallLinkStatus result;
    330329            {
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r286635 r286769  
    446446        if constexpr (decltype(bytecode)::opcodeID == op_tail_call) {
    447447            CallFrameShuffleData shuffleData = CallFrameShuffleData::createForBaselineOrLLIntTailCall(bytecode, numParameters());
    448             metadata.m_callLinkInfo.initializeDataIC(vm, CallLinkInfo::callTypeFor(decltype(bytecode)::opcodeID), instruction.index(), &shuffleData);
     448            metadata.m_callLinkInfo.initialize(vm, CallLinkInfo::callTypeFor(decltype(bytecode)::opcodeID), instruction.index(), &shuffleData);
    449449            return;
    450450        }
    451451#endif
    452         metadata.m_callLinkInfo.initializeDataIC(vm, CallLinkInfo::callTypeFor(decltype(bytecode)::opcodeID), instruction.index(), nullptr);
     452        metadata.m_callLinkInfo.initialize(vm, CallLinkInfo::callTypeFor(decltype(bytecode)::opcodeID), instruction.index(), nullptr);
    453453    };
    454454
     
    793793            CallLinkInfo* callLinkInfo = getCallLinkInfoForBytecodeIndex(locker, unlinkedCallLinkInfo.bytecodeIndex);
    794794            ASSERT(callLinkInfo);
    795             callLinkInfo->setCodeLocations({ }, unlinkedCallLinkInfo.doneLocation);
     795            static_cast<BaselineCallLinkInfo*>(callLinkInfo)->setCodeLocations(unlinkedCallLinkInfo.doneLocation);
    796796        }
    797797
     
    16261626        finalizeLLIntInlineCaches();
    16271627        // If the CodeBlock is DFG or FTL, CallLinkInfo in metadata is not related.
    1628         forEachLLIntOrBaselineCallLinkInfo([&](CallLinkInfo& callLinkInfo) {
     1628        forEachLLIntOrBaselineCallLinkInfo([&](BaselineCallLinkInfo& callLinkInfo) {
    16291629            callLinkInfo.visitWeak(vm);
    16301630        });
     
    16941694{
    16951695    if (JITCode::couldBeInterpreted(jitType())) {
    1696         forEachLLIntOrBaselineCallLinkInfo([&](CallLinkInfo& callLinkInfo) {
     1696        forEachLLIntOrBaselineCallLinkInfo([&](BaselineCallLinkInfo& callLinkInfo) {
    16971697            result.add(callLinkInfo.codeOrigin(), ICStatus()).iterator->value.callLinkInfo = &callLinkInfo;
    16981698        });
     
    23252325#endif
    23262326        } else {
    2327             forEachLLIntOrBaselineCallLinkInfo([&](CallLinkInfo& callLinkInfo) {
     2327            forEachLLIntOrBaselineCallLinkInfo([&](BaselineCallLinkInfo& callLinkInfo) {
    23282328                callLinkInfo.setClearedByJettison();
    23292329            });
  • trunk/Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h

    r282664 r286769  
    4545    // while we are executing GCAwareJITStubRoutine. It is not possible that GetterSetterAccessCase is alive while
    4646    // GCAwareJITStubRoutine is destroyed.
    47     CallLinkInfo* callLinkInfo() const { return m_callLinkInfo; }
     47    OptimizingCallLinkInfo* callLinkInfo() const { return m_callLinkInfo; }
    4848    JSObject* customSlotBase() const { return m_customSlotBase.get(); }
    4949    std::optional<DOMAttributeAnnotation> domAttribute() const { return m_domAttribute; }
     
    7676
    7777    WriteBarrier<JSObject> m_customSlotBase;
    78     CallLinkInfo* m_callLinkInfo { nullptr };
     78    OptimizingCallLinkInfo* m_callLinkInfo { nullptr };
    7979    FunctionPtr<CustomAccessorPtrTag> m_customAccessor;
    8080    std::optional<DOMAttributeAnnotation> m_domAttribute;
  • trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h

    r283954 r286769  
    225225    std::unique_ptr<WatchpointsOnStructureStubInfo> watchpoints;
    226226    Vector<StructureID> weakStructures;
    227     Bag<CallLinkInfo> m_callLinkInfos;
     227    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
    228228    bool m_doesJSGetterSetterCalls : 1;
    229229    bool m_doesCalls : 1;
  • trunk/Source/JavaScriptCore/bytecode/Repatch.cpp

    r286095 r286769  
    143143        callLinkInfo.clearCodeBlock();
    144144        if (!callLinkInfo.clearedByJettison())
    145             callLinkInfo.initializeDirectCall();
     145            static_cast<OptimizingCallLinkInfo&>(callLinkInfo).initializeDirectCall();
    146146#endif
    147147    } else {
     
    15511551
    15521552void linkDirectCall(
    1553     CallFrame* callFrame, CallLinkInfo& callLinkInfo, CodeBlock* calleeCodeBlock,
     1553    CallFrame* callFrame, OptimizingCallLinkInfo& callLinkInfo, CodeBlock* calleeCodeBlock,
    15541554    MacroAssemblerCodePtr<JSEntryPtrTag> codePtr)
    15551555{
  • trunk/Source/JavaScriptCore/bytecode/Repatch.h

    r286347 r286769  
    3333
    3434class CallLinkInfo;
     35class OptimizingCallLinkInfo;
    3536class StructureStubInfo;
    3637
     
    7273void repatchInstanceOf(JSGlobalObject*, CodeBlock*, JSValue, JSValue prototype, StructureStubInfo&, bool wasFound);
    7374void linkMonomorphicCall(VM&, CallFrame*, CallLinkInfo&, CodeBlock*, JSObject* callee, MacroAssemblerCodePtr<JSEntryPtrTag>);
    74 void linkDirectCall(CallFrame*, CallLinkInfo&, CodeBlock*, MacroAssemblerCodePtr<JSEntryPtrTag>);
     75void linkDirectCall(CallFrame*, OptimizingCallLinkInfo&, CodeBlock*, MacroAssemblerCodePtr<JSEntryPtrTag>);
    7576void linkSlowFor(CallFrame*, CallLinkInfo&);
    7677void unlinkCall(VM&, CallLinkInfo&);
  • trunk/Source/JavaScriptCore/dfg/DFGCommonData.h

    r285651 r286769  
    112112    void clearWatchpoints();
    113113
    114     CallLinkInfo* addCallLinkInfo(CodeOrigin codeOrigin)
     114    OptimizingCallLinkInfo* addCallLinkInfo(CodeOrigin codeOrigin)
    115115    {
    116116        return m_callLinkInfos.add(codeOrigin);
     
    132132    Vector<JumpReplacement> m_jumpReplacements;
    133133    Bag<StructureStubInfo> m_stubInfos;
    134     Bag<CallLinkInfo> m_callLinkInfos;
     134    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
    135135    Yarr::YarrBoyerMoyerData m_boyerMooreData;
    136136   
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r283139 r286769  
    261261
    262262    for (auto& record : m_jsCalls) {
    263         CallLinkInfo& info = *record.info;
     263        auto& info = *record.info;
    264264        info.setCodeLocations(
    265265            linkBuffer.locationOf<JSInternalPtrTag>(record.slowPathStart),
     
    268268   
    269269    for (auto& record : m_jsDirectCalls) {
    270         CallLinkInfo& info = *record.info;
     270        auto& info = *record.info;
    271271        info.setCodeLocations(
    272272            linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath),
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r286345 r286769  
    235235    }
    236236
    237     void addJSCall(Label slowPathStart, Label doneLocation, CallLinkInfo* info)
     237    void addJSCall(Label slowPathStart, Label doneLocation, OptimizingCallLinkInfo* info)
    238238    {
    239239        m_jsCalls.append(JSCallRecord(slowPathStart, doneLocation, info));
    240240    }
    241241   
    242     void addJSDirectCall(Label slowPath, CallLinkInfo* info)
     242    void addJSDirectCall(Label slowPath, OptimizingCallLinkInfo* info)
    243243    {
    244244        m_jsDirectCalls.append(JSDirectCallRecord(slowPath, info));
     
    339339
    340340    struct JSCallRecord {
    341         JSCallRecord(Label slowPathStart, Label doneLocation, CallLinkInfo* info)
     341        JSCallRecord(Label slowPathStart, Label doneLocation, OptimizingCallLinkInfo* info)
    342342            : slowPathStart(slowPathStart)
    343343            , doneLocation(doneLocation)
     
    348348        Label slowPathStart;
    349349        Label doneLocation;
    350         CallLinkInfo* info;
     350        OptimizingCallLinkInfo* info;
    351351    };
    352352   
    353353    struct JSDirectCallRecord {
    354         JSDirectCallRecord(Label slowPath, CallLinkInfo* info)
     354        JSDirectCallRecord(Label slowPath, OptimizingCallLinkInfo* info)
    355355            : slowPath(slowPath)
    356356            , info(info)
     
    359359       
    360360        Label slowPath;
    361         CallLinkInfo* info;
     361        OptimizingCallLinkInfo* info;
    362362    };
    363363   
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r285687 r286769  
    36803680}
    36813681
    3682 JSC_DEFINE_JIT_OPERATION(operationLinkDirectCall, void, (CallLinkInfo* callLinkInfo, JSFunction* callee))
     3682JSC_DEFINE_JIT_OPERATION(operationLinkDirectCall, void, (OptimizingCallLinkInfo* callLinkInfo, JSFunction* callee))
    36833683{
    36843684    JSGlobalObject* globalObject = callee->globalObject();
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r285530 r286769  
    3636class DateInstance;
    3737class JSBigInt;
     38class JSPropertyNameEnumerator;
     39class OptimizingCallLinkInfo;
    3840struct UnlinkedStringJumpTable;
    39 class JSPropertyNameEnumerator;
    4041
    4142namespace DFG {
     
    315316JSC_DECLARE_JIT_OPERATION(operationNewObjectWithButterflyWithIndexingHeaderAndVectorLength, JSCell*, (VM*, Structure*, unsigned length, Butterfly*));
    316317
    317 JSC_DECLARE_JIT_OPERATION(operationLinkDirectCall, void, (CallLinkInfo*, JSFunction*));
     318JSC_DECLARE_JIT_OPERATION(operationLinkDirectCall, void, (OptimizingCallLinkInfo*, JSFunction*));
    318319
    319320JSC_DECLARE_JIT_OPERATION(operationDateGetFullYear, EncodedJSValue, (VM*, DateInstance*));
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r285795 r286769  
    787787    CallSiteIndex callSite = m_jit.recordCallSiteAndGenerateExceptionHandlingOSRExitIfNeeded(dynamicOrigin, m_stream->size());
    788788   
    789     CallLinkInfo* info = m_jit.jitCode()->common.addCallLinkInfo(node->origin.semantic);
     789    auto* info = m_jit.jitCode()->common.addCallLinkInfo(node->origin.semantic);
    790790    info->setUpCall(callType, calleePayloadGPR);
    791791   
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r286345 r286769  
    891891    };
    892892   
    893     CallLinkInfo* callLinkInfo = m_jit.jitCode()->common.addCallLinkInfo(m_currentNode->origin.semantic);
     893    auto* callLinkInfo = m_jit.jitCode()->common.addCallLinkInfo(m_currentNode->origin.semantic);
    894894    callLinkInfo->setUpCall(callType, calleeGPR);
    895895
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r286667 r286769  
    1026610266                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
    1026710267
    10268                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(nodeSemanticOrigin);
     10268                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(nodeSemanticOrigin);
    1026910269                callLinkInfo->setUpCall(
    1027010270                    nodeOp == Construct ? CallLinkInfo::Construct : CallLinkInfo::Call, GPRInfo::regT0);
     
    1040010400                    shuffleData.setupCalleeSaveRegisters(jit.codeBlock());
    1040110401                   
    10402                     CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
     10402                    auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
    1040310403                    callLinkInfo->setUpCall(CallLinkInfo::DirectTailCall, InvalidGPRReg);
    1040410404                   
     
    1043210432                }
    1043310433               
    10434                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
     10434                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
    1043510435                callLinkInfo->setUpCall(
    1043610436                    isConstruct ? CallLinkInfo::DirectConstruct : CallLinkInfo::DirectCall, InvalidGPRReg);
     
    1056010560                shuffleData.setupCalleeSaveRegisters(jit.codeBlock());
    1056110561
    10562                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(codeOrigin);
     10562                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(codeOrigin);
    1056310563                callLinkInfo->setUpCall(CallLinkInfo::TailCall, GPRInfo::regT0);
    1056410564
     
    1076510765                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
    1076610766
    10767                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
     10767                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
    1076810768
    1076910769                RegisterSet usedRegisters = RegisterSet::allRegisters();
     
    1104911049                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
    1105011050
    11051                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
     11051                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
    1105211052
    1105311053                unsigned argIndex = 1;
     
    1129111291                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
    1129211292               
    11293                 CallLinkInfo* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
     11293                auto* callLinkInfo = state->jitCode->common.addCallLinkInfo(semanticNodeOrigin);
    1129411294                callLinkInfo->setUpCall(CallLinkInfo::Call, GPRInfo::regT0);
    1129511295               
  • trunk/Source/JavaScriptCore/jit/CallFrameShuffleData.cpp

    r285795 r286769  
    8686CallFrameShuffleData CallFrameShuffleData::createForBaselineOrLLIntTailCall(const OpTailCall& bytecode, unsigned numParameters)
    8787{
    88 #if USE(JSVALUE64)
    89     constexpr JSValueRegs calleeJSR { GPRInfo::regT0 };
    90 #elif USE(JSVALUE32_64)
    91     constexpr JSValueRegs calleeJSR { GPRInfo::regT1, GPRInfo::regT0 };
    92 #endif
    9388    CallFrameShuffleData shuffleData;
    9489    shuffleData.numPassedArgs = bytecode.m_argc;
     
    106101    }
    107102#if USE(JSVALUE64)
    108     shuffleData.callee = ValueRecovery::inGPR(calleeJSR.payloadGPR(), DataFormatJS);
     103    shuffleData.callee = ValueRecovery::inGPR(BaselineCallRegisters::calleeJSR.payloadGPR(), DataFormatJS);
    109104#elif USE(JSVALUE32_64)
    110     shuffleData.callee = ValueRecovery::inPair(calleeJSR.tagGPR(), calleeJSR.payloadGPR());
     105    shuffleData.callee = ValueRecovery::inPair(BaselineCallRegisters::calleeJSR.tagGPR(), BaselineCallRegisters::calleeJSR.payloadGPR());
    111106#endif
    112107    shuffleData.setupCalleeSaveRegisters(&RegisterAtOffsetList::llintBaselineCalleeSaveRegisters());
  • trunk/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp

    r286345 r286769  
    106106MarkingGCAwareJITStubRoutine::MarkingGCAwareJITStubRoutine(
    107107    const MacroAssemblerCodeRef<JITStubRoutinePtrTag>& code, VM& vm, FixedVector<RefPtr<AccessCase>>&& cases, FixedVector<StructureID>&& weakStructures, const JSCell* owner,
    108     const Vector<JSCell*>& cells, Bag<CallLinkInfo>&& callLinkInfos)
     108    const Vector<JSCell*>& cells, Bag<OptimizingCallLinkInfo>&& callLinkInfos)
    109109    : PolymorphicAccessJITStubRoutine(code, vm, WTFMove(cases), WTFMove(weakStructures))
    110110    , m_cells(cells.size())
     
    136136
    137137GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler(
    138     const MacroAssemblerCodeRef<JITStubRoutinePtrTag>& code, VM& vm, FixedVector<RefPtr<AccessCase>>&& cases, FixedVector<StructureID>&& weakStructures, const JSCell* owner, const Vector<JSCell*>& cells, Bag<CallLinkInfo>&& callLinkInfos,
     138    const MacroAssemblerCodeRef<JITStubRoutinePtrTag>& code, VM& vm, FixedVector<RefPtr<AccessCase>>&& cases, FixedVector<StructureID>&& weakStructures, const JSCell* owner, const Vector<JSCell*>& cells, Bag<OptimizingCallLinkInfo>&& callLinkInfos,
    139139    CodeBlock* codeBlockForExceptionHandlers, DisposableCallSiteIndex exceptionHandlerCallSiteIndex)
    140140    : MarkingGCAwareJITStubRoutine(code, vm, WTFMove(cases), WTFMove(weakStructures), owner, cells, WTFMove(callLinkInfos))
     
    190190    bool makesCalls,
    191191    const Vector<JSCell*>& cells,
    192     Bag<CallLinkInfo>&& callLinkInfos,
     192    Bag<OptimizingCallLinkInfo>&& callLinkInfos,
    193193    CodeBlock* codeBlockForExceptionHandlers,
    194194    DisposableCallSiteIndex exceptionHandlerCallSiteIndex)
  • trunk/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h

    r278656 r286769  
    4343class CallLinkInfo;
    4444class JITStubRoutineSet;
     45class OptimizingCallLinkInfo;
    4546
    4647// Use this stub routine if you know that your code might be on stack when
     
    125126
    126127    MarkingGCAwareJITStubRoutine(
    127         const MacroAssemblerCodeRef<JITStubRoutinePtrTag>&, VM&, FixedVector<RefPtr<AccessCase>>&&, FixedVector<StructureID>&&, const JSCell* owner, const Vector<JSCell*>&, Bag<CallLinkInfo>&&);
     128        const MacroAssemblerCodeRef<JITStubRoutinePtrTag>&, VM&, FixedVector<RefPtr<AccessCase>>&&, FixedVector<StructureID>&&, const JSCell* owner, const Vector<JSCell*>&, Bag<OptimizingCallLinkInfo>&&);
    128129    ~MarkingGCAwareJITStubRoutine() override;
    129130   
     
    135136private:
    136137    FixedVector<WriteBarrier<JSCell>> m_cells;
    137     Bag<CallLinkInfo> m_callLinkInfos;
     138    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
    138139};
    139140
     
    146147    using Base = MarkingGCAwareJITStubRoutine;
    147148
    148     GCAwareJITStubRoutineWithExceptionHandler(const MacroAssemblerCodeRef<JITStubRoutinePtrTag>&, VM&, FixedVector<RefPtr<AccessCase>>&&, FixedVector<StructureID>&&, const JSCell* owner, const Vector<JSCell*>&, Bag<CallLinkInfo>&&, CodeBlock*, DisposableCallSiteIndex);
     149    GCAwareJITStubRoutineWithExceptionHandler(const MacroAssemblerCodeRef<JITStubRoutinePtrTag>&, VM&, FixedVector<RefPtr<AccessCase>>&&, FixedVector<StructureID>&&, const JSCell* owner, const Vector<JSCell*>&, Bag<OptimizingCallLinkInfo>&&, CodeBlock*, DisposableCallSiteIndex);
    149150    ~GCAwareJITStubRoutineWithExceptionHandler() final;
    150151
     
    182183Ref<PolymorphicAccessJITStubRoutine> createICJITStubRoutine(
    183184    const MacroAssemblerCodeRef<JITStubRoutinePtrTag>&, FixedVector<RefPtr<AccessCase>>&& cases, FixedVector<StructureID>&& weakStructures, VM&, const JSCell* owner, bool makesCalls,
    184     const Vector<JSCell*>&, Bag<CallLinkInfo>&& callLinkInfos,
     185    const Vector<JSCell*>&, Bag<OptimizingCallLinkInfo>&& callLinkInfos,
    185186    CodeBlock* codeBlockForExceptionHandlers, DisposableCallSiteIndex exceptionHandlingCallSiteIndex);
    186187
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r286424 r286769  
    4343namespace JSC {
    4444
    45 namespace {
    46     constexpr JSValueRegs calleeJSR = JSRInfo::jsRegT10;
    47 }
    48 
    4945void JIT::emit_op_ret(const Instruction* currentInstruction)
    5046{
     
    201197    addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister);
    202198
    203     loadValue(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), calleeJSR);
     199    static_assert(noOverlap(BaselineCallRegisters::calleeJSR, BaselineCallRegisters::callLinkInfoGPR, regT3));
     200    loadValue(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), BaselineCallRegisters::calleeJSR);
    204201    loadGlobalObject(regT3);
    205     constexpr GPRReg callLinkInfoGPR = regT2;
    206     materializePointerIntoMetadata(bytecode, OpCallEval::Metadata::offsetOfCallLinkInfo(), callLinkInfoGPR);
    207     emitVirtualCallWithoutMovingGlobalObject(*m_vm, callLinkInfoGPR, CallMode::Regular);
     202    materializePointerIntoMetadata(bytecode, OpCallEval::Metadata::offsetOfCallLinkInfo(), BaselineCallRegisters::callLinkInfoGPR);
     203    emitVirtualCallWithoutMovingGlobalObject(*m_vm, BaselineCallRegisters::callLinkInfoGPR, CallMode::Regular);
    208204    resetSP();
    209205}
     
    218214bool JIT::compileTailCall(const OpTailCall& bytecode, UnlinkedCallLinkInfo*, unsigned callLinkInfoIndex)
    219215{
    220     constexpr GPRReg callLinkInfoGPR = regT2;
    221     materializePointerIntoMetadata(bytecode, OpTailCall::Metadata::offsetOfCallLinkInfo(), callLinkInfoGPR);
    222     JumpList slowPaths = CallLinkInfo::emitTailCallDataICFastPath(*this, calleeJSR.payloadGPR(), callLinkInfoGPR, scopedLambda<void()>([&]{
     216    materializePointerIntoMetadata(bytecode, OpTailCall::Metadata::offsetOfCallLinkInfo(), BaselineCallRegisters::callLinkInfoGPR);
     217    JumpList slowPaths = CallLinkInfo::emitTailCallDataICFastPath(*this, BaselineCallRegisters::calleeJSR.payloadGPR(), BaselineCallRegisters::callLinkInfoGPR, scopedLambda<void()>([&] {
    223218        CallFrameShuffleData shuffleData = CallFrameShuffleData::createForBaselineOrLLIntTailCall(bytecode, m_unlinkedCodeBlock->numParameters());
    224219        CallFrameShuffler shuffler { *this, shuffleData };
    225         shuffler.lockGPR(callLinkInfoGPR);
     220        shuffler.lockGPR(BaselineCallRegisters::callLinkInfoGPR);
    226221        shuffler.prepareForTailCall();
    227222    }));
     
    268263    store32(TrustedImm32(locationBits), Address(callFrameRegister, CallFrameSlot::argumentCountIncludingThis * static_cast<int>(sizeof(Register)) + TagOffset));
    269264
    270     emitGetVirtualRegister(callee, calleeJSR);
    271     storeValue(calleeJSR, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC)));
     265    emitGetVirtualRegister(callee, BaselineCallRegisters::calleeJSR);
     266    storeValue(BaselineCallRegisters::calleeJSR, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC)));
    272267
    273268    if (compileCallEval(bytecode))
     
    277272    // We need this on JSVALUE32_64 only as on JSVALUE64 a pointer comparison in the DataIC fast
    278273    // path catches this.
    279     addSlowCase(branchIfNotCell(calleeJSR));
     274    addSlowCase(branchIfNotCell(BaselineCallRegisters::calleeJSR));
    280275#endif
    281276
     
    283278        return;
    284279
    285     constexpr GPRReg callLinkInfoGPR = regT2;
    286     materializePointerIntoMetadata(bytecode, Op::Metadata::offsetOfCallLinkInfo(), callLinkInfoGPR);
     280    materializePointerIntoMetadata(bytecode, Op::Metadata::offsetOfCallLinkInfo(), BaselineCallRegisters::callLinkInfoGPR);
    287281    if (opcodeID == op_tail_call_varargs || opcodeID == op_tail_call_forward_arguments) {
    288         auto slowPaths = CallLinkInfo::emitTailCallDataICFastPath(*this, calleeJSR.payloadGPR(), callLinkInfoGPR, scopedLambda<void()>([&]{
     282        auto slowPaths = CallLinkInfo::emitTailCallDataICFastPath(*this, BaselineCallRegisters::calleeJSR.payloadGPR(), BaselineCallRegisters::callLinkInfoGPR, scopedLambda<void()>([&] {
    289283            emitRestoreCalleeSaves();
    290             prepareForTailCallSlow(callLinkInfoGPR);
     284            prepareForTailCallSlow(BaselineCallRegisters::callLinkInfoGPR);
    291285        }));
    292286        addSlowCase(slowPaths);
     
    296290    }
    297291
    298     auto slowPaths = CallLinkInfo::emitDataICFastPath(*this, calleeJSR.payloadGPR(), callLinkInfoGPR);
     292    auto slowPaths = CallLinkInfo::emitDataICFastPath(*this, BaselineCallRegisters::calleeJSR.payloadGPR(), BaselineCallRegisters::callLinkInfoGPR);
    299293    auto doneLocation = label();
    300294    addSlowCase(slowPaths);
  • trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlock.h

    r273138 r286769  
    9191    Ref<Wasm::CodeBlock> m_codeBlock;
    9292    Vector<MacroAssemblerCodeRef<WasmEntryPtrTag>> m_wasmToJSExitStubs;
    93     Bag<CallLinkInfo> m_callLinkInfos;
     93    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
    9494    String m_errorMessage;
    9595};
  • trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp

    r284935 r286769  
    5252}
    5353
    54 Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM& vm, Bag<CallLinkInfo>& callLinkInfos, SignatureIndex signatureIndex, unsigned importIndex)
     54Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM& vm, Bag<OptimizingCallLinkInfo>& callLinkInfos, SignatureIndex signatureIndex, unsigned importIndex)
    5555{
    5656    // FIXME: This function doesn't properly abstract away the calling convention.
     
    262262    // FIXME Tail call if the wasm return type is void and no registers were spilled. https://bugs.webkit.org/show_bug.cgi?id=165488
    263263
    264     CallLinkInfo* callLinkInfo = callLinkInfos.add(CodeOrigin());
     264    auto* callLinkInfo = callLinkInfos.add(CodeOrigin());
    265265    callLinkInfo->setUpCall(CallLinkInfo::Call, importJSCellGPRReg);
    266266    auto slowPath = callLinkInfo->emitFastPath(jit, importJSCellGPRReg, InvalidGPRReg, CallLinkInfo::UseDataIC::No);
  • trunk/Source/JavaScriptCore/wasm/js/WasmToJS.h

    r271594 r286769  
    4343class Instance;
    4444
    45 Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM&, Bag<CallLinkInfo>& callLinkInfos, SignatureIndex, unsigned importIndex);
     45Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM&, Bag<OptimizingCallLinkInfo>& callLinkInfos, SignatureIndex, unsigned importIndex);
    4646
    4747void emitThrowWasmToJSException(CCallHelpers&, GPRReg wasmInstance, Wasm::ExceptionType);
Note: See TracChangeset for help on using the changeset viewer.