Changeset 273217 in webkit


Ignore:
Timestamp:
Feb 21, 2021 4:35:49 AM (3 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Remove vm.topCallFrame storing in Baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=222162

Reviewed by Mark Lam.

This patch removes vm.topCallFrame storing in the Baseline JIT for ports that can USE(BUILTIN_FRAME_ADDRESS).
Also refactored some CommonSlowPath functions so that they can start using builtin_frame_address later
instead of requiring that CallFrame be passed in.

  • jit/JITInlines.h:

(JSC::JIT::updateTopCallFrame):

  • runtime/CommonSlowPaths.cpp:

(JSC::iteratorOpenTryFastImpl):
(JSC::JSC_DEFINE_COMMON_SLOW_PATH):
(JSC::iteratorNextTryFastImpl):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r273203 r273217  
     12021-02-21  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Remove vm.topCallFrame storing in Baseline JIT
     4        https://bugs.webkit.org/show_bug.cgi?id=222162
     5
     6        Reviewed by Mark Lam.
     7
     8        This patch removes vm.topCallFrame storing in the Baseline JIT for ports that can USE(BUILTIN_FRAME_ADDRESS).
     9        Also refactored some CommonSlowPath functions so that they can start using __builtin_frame_address later
     10        instead of requiring that CallFrame be passed in.
     11
     12        * jit/JITInlines.h:
     13        (JSC::JIT::updateTopCallFrame):
     14        * runtime/CommonSlowPaths.cpp:
     15        (JSC::iteratorOpenTryFastImpl):
     16        (JSC::JSC_DEFINE_COMMON_SLOW_PATH):
     17        (JSC::iteratorNextTryFastImpl):
     18
    1192021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
    220
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r270711 r273217  
    110110    uint32_t locationBits = CallSiteIndex(m_bytecodeIndex.offset()).bits();
    111111    store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCountIncludingThis));
    112    
    113     // FIXME: It's not clear that this is needed. JITOperations tend to update the top call frame on
    114     // the C++ side.
    115     // https://bugs.webkit.org/show_bug.cgi?id=155693
    116     storePtr(callFrameRegister, &m_vm->topCallFrame);
     112    prepareCallOperation(*m_vm);
    117113}
    118114
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

    r272638 r273217  
    853853
    854854template<OpcodeSize width>
    855 ALWAYS_INLINE SlowPathReturnType iteratorOpenTryFastImpl(CallFrame* callFrame, const Instruction* pc)
    856 {
    857     // Don't set PC; we can't throw and it's relatively slow.
    858     BEGIN_NO_SET_PC();
    859 
     855ALWAYS_INLINE SlowPathReturnType iteratorOpenTryFastImpl(VM& vm, JSGlobalObject* globalObject, CodeBlock* codeBlock, CallFrame* callFrame, const Instruction* pc)
     856{
    860857    auto bytecode = pc->asKnownWidth<OpIteratorOpen, width>();
    861858    auto& metadata = bytecode.metadata(codeBlock);
     
    882879JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_narrow)
    883880{
    884     return iteratorOpenTryFastImpl<Narrow>(callFrame, pc);
     881    // Don't set PC; we can't throw and it's relatively slow.
     882    BEGIN_NO_SET_PC();
     883    return iteratorOpenTryFastImpl<Narrow>(vm, globalObject, codeBlock, callFrame, pc);
    885884}
    886885
    887886JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_wide16)
    888887{
    889     return iteratorOpenTryFastImpl<Wide16>(callFrame, pc);
     888    // Don't set PC; we can't throw and it's relatively slow.
     889    BEGIN_NO_SET_PC();
     890    return iteratorOpenTryFastImpl<Wide16>(vm, globalObject, codeBlock, callFrame, pc);
    890891}
    891892
    892893JSC_DEFINE_COMMON_SLOW_PATH(iterator_open_try_fast_wide32)
    893894{
    894     return iteratorOpenTryFastImpl<Wide32>(callFrame, pc);
     895    // Don't set PC; we can't throw and it's relatively slow.
     896    BEGIN_NO_SET_PC();
     897    return iteratorOpenTryFastImpl<Wide32>(vm, globalObject, codeBlock, callFrame, pc);
    895898}
    896899
    897900template<OpcodeSize width>
    898 ALWAYS_INLINE SlowPathReturnType iteratorNextTryFastImpl(CallFrame* callFrame, const Instruction* pc)
    899 {
    900     BEGIN();
    901 
     901ALWAYS_INLINE SlowPathReturnType iteratorNextTryFastImpl(VM& vm, JSGlobalObject* globalObject, CodeBlock* codeBlock, CallFrame* callFrame, ThrowScope& throwScope, const Instruction* pc)
     902{
    902903    auto bytecode = pc->asKnownWidth<OpIteratorNext, width>();
    903904    auto& metadata = bytecode.metadata(codeBlock);
     
    939940JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_narrow)
    940941{
    941     return iteratorNextTryFastImpl<Narrow>(callFrame, pc);
     942    BEGIN();
     943    return iteratorNextTryFastImpl<Narrow>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
    942944}
    943945
    944946JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_wide16)
    945947{
    946     return iteratorNextTryFastImpl<Wide16>(callFrame, pc);
     948    BEGIN();
     949    return iteratorNextTryFastImpl<Wide16>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
    947950}
    948951
    949952JSC_DEFINE_COMMON_SLOW_PATH(iterator_next_try_fast_wide32)
    950953{
    951     return iteratorNextTryFastImpl<Wide32>(callFrame, pc);
     954    BEGIN();
     955    return iteratorNextTryFastImpl<Wide32>(vm, globalObject, codeBlock, callFrame, throwScope, pc);
    952956}
    953957
Note: See TracChangeset for help on using the changeset viewer.