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

Changeset 157609 in webkit


Ignore:
Timestamp:
Oct 17, 2013, 4:00:25 PM (13 years ago)
Author:
ggaren@apple.com
Message:

Eliminate uses of JITSTACKFRAME_ARGS_INDEX as scratch area for thunks
https://bugs.webkit.org/show_bug.cgi?id=122973

Reviewed by Michael Saboff.

  • jit/ThunkGenerators.cpp:

(JSC::throwExceptionFromCallSlowPathGenerator): This was all dead code,
so I removed it.

The code acted as if it needed to pass an argument to
lookupExceptionHandler, and as if it passed that argument to itself
through JITStackFrame. However, lookupExceptionHandler does not take
an argument (other than the default ExecState argument), and the code
did not initialize the thing that it thought it passed to itself!

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r157607 r157609  
     12013-10-17  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Eliminate uses of JITSTACKFRAME_ARGS_INDEX as scratch area for thunks
     4        https://bugs.webkit.org/show_bug.cgi?id=122973
     5
     6        Reviewed by Michael Saboff.
     7
     8        * jit/ThunkGenerators.cpp:
     9        (JSC::throwExceptionFromCallSlowPathGenerator): This was all dead code,
     10        so I removed it.
     11
     12        The code acted as if it needed to pass an argument to
     13        lookupExceptionHandler, and as if it passed that argument to itself
     14        through JITStackFrame. However, lookupExceptionHandler does not take
     15        an argument (other than the default ExecState argument), and the code
     16        did not initialize the thing that it thought it passed to itself!
     17
    1182013-10-17  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r157480 r157609  
    5757}
    5858
     59// We will jump here if the JIT code tries to make a call, but the
     60// linking helper (C++ code) decides to throw an exception instead.
    5961MacroAssemblerCodeRef throwExceptionFromCallSlowPathGenerator(VM* vm)
    6062{
    6163    CCallHelpers jit(vm);
    6264   
    63     // We will jump to here if the JIT code thinks it's making a call, but the
    64     // linking helper (C++ code) decided to throw an exception instead. We will
    65     // have saved the callReturnIndex in the first arguments of JITStackFrame.
    66     // Note that the return address will be on the stack at this point, so we
    67     // need to remove it and drop it on the floor, since we don't care about it.
    68     // Finally note that the call frame register points at the callee frame, so
    69     // we need to pop it.
     65    // The call pushed a return address, so we need to pop it back off to re-align the stack,
     66    // even though we won't use it.
    7067    jit.preserveReturnAddressAfterCall(GPRInfo::nonPreservedNonReturnGPR);
     68
     69    // The CallFrame register points to the (failed) callee frame, so we need to pop back one frame.
    7170    jit.loadPtr(
    7271        CCallHelpers::Address(
     
    7473            static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::CallerFrame),
    7574        GPRInfo::callFrameRegister);
    76 #if USE(JSVALUE64)
    77     jit.peek64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
    78 #else
    79     jit.peek(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
    80 #endif
    81     jit.setupArgumentsWithExecState(GPRInfo::nonPreservedNonReturnGPR);
     75
     76    jit.setupArgumentsExecState();
    8277    jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(lookupExceptionHandler)), GPRInfo::nonArgGPR0);
    8378    emitPointerValidation(jit, GPRInfo::nonArgGPR0);
     
    10196            static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ReturnPC));
    10297    jit.storePtr(GPRInfo::callFrameRegister, &vm->topCallFrame);
    103 #if USE(JSVALUE64)
    104     jit.poke64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
    105 #else
    106     jit.poke(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
    107 #endif
    10898    jit.setupArgumentsExecState();
    10999    jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(slowPathFunction)), GPRInfo::nonArgGPR0);
     
    137127    // save the return address to the call frame while we make a C++ function call
    138128    // to perform linking and lazy compilation if necessary. We expect the callee
    139     // to be in nonArgGPR0/nonArgGPR1 (payload/tag), the call frame to have already
    140     // been adjusted, nonPreservedNonReturnGPR holds the exception handler index,
    141     // and all other registers to be available for use. We use JITStackFrame::args
    142     // to save important information across calls.
     129    // to be in nonArgGPR0/nonArgGPR1 (payload/tag), the CallFrame to have already
     130    // been adjusted, and all other registers to be available for use.
    143131   
    144132    CCallHelpers jit(vm);
Note: See TracChangeset for help on using the changeset viewer.