Changeset 157609 in webkit
- Timestamp:
- Oct 17, 2013, 4:00:25 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
jit/ThunkGenerators.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r157607 r157609 1 2013-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 1 18 2013-10-17 Alex Christensen <achristensen@webkit.org> 2 19 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r157480 r157609 57 57 } 58 58 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. 59 61 MacroAssemblerCodeRef throwExceptionFromCallSlowPathGenerator(VM* vm) 60 62 { 61 63 CCallHelpers jit(vm); 62 64 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. 70 67 jit.preserveReturnAddressAfterCall(GPRInfo::nonPreservedNonReturnGPR); 68 69 // The CallFrame register points to the (failed) callee frame, so we need to pop back one frame. 71 70 jit.loadPtr( 72 71 CCallHelpers::Address( … … 74 73 static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::CallerFrame), 75 74 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(); 82 77 jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(lookupExceptionHandler)), GPRInfo::nonArgGPR0); 83 78 emitPointerValidation(jit, GPRInfo::nonArgGPR0); … … 101 96 static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ReturnPC)); 102 97 jit.storePtr(GPRInfo::callFrameRegister, &vm->topCallFrame); 103 #if USE(JSVALUE64)104 jit.poke64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);105 #else106 jit.poke(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);107 #endif108 98 jit.setupArgumentsExecState(); 109 99 jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(slowPathFunction)), GPRInfo::nonArgGPR0); … … 137 127 // save the return address to the call frame while we make a C++ function call 138 128 // 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. 143 131 144 132 CCallHelpers jit(vm);
Note:
See TracChangeset
for help on using the changeset viewer.