Modified: trunk/Source/_javascript_Core/ChangeLog (157608 => 157609)
--- trunk/Source/_javascript_Core/ChangeLog 2013-10-17 22:47:02 UTC (rev 157608)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-10-17 23:00:25 UTC (rev 157609)
@@ -1,3 +1,20 @@
+2013-10-17 Geoffrey Garen <[email protected]>
+
+ 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!
+
2013-10-17 Alex Christensen <[email protected]>
Run _javascript_Core tests again on Windows.
Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (157608 => 157609)
--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp 2013-10-17 22:47:02 UTC (rev 157608)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp 2013-10-17 23:00:25 UTC (rev 157609)
@@ -56,29 +56,24 @@
#endif
}
+// We will jump here if the JIT code tries to make a call, but the
+// linking helper (C++ code) decides to throw an exception instead.
MacroAssemblerCodeRef throwExceptionFromCallSlowPathGenerator(VM* vm)
{
CCallHelpers jit(vm);
- // We will jump to here if the JIT code thinks it's making a call, but the
- // linking helper (C++ code) decided to throw an exception instead. We will
- // have saved the callReturnIndex in the first arguments of JITStackFrame.
- // Note that the return address will be on the stack at this point, so we
- // need to remove it and drop it on the floor, since we don't care about it.
- // Finally note that the call frame register points at the callee frame, so
- // we need to pop it.
+ // The call pushed a return address, so we need to pop it back off to re-align the stack,
+ // even though we won't use it.
jit.preserveReturnAddressAfterCall(GPRInfo::nonPreservedNonReturnGPR);
+
+ // The CallFrame register points to the (failed) callee frame, so we need to pop back one frame.
jit.loadPtr(
CCallHelpers::Address(
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::CallerFrame),
GPRInfo::callFrameRegister);
-#if USE(JSVALUE64)
- jit.peek64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
-#else
- jit.peek(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
-#endif
- jit.setupArgumentsWithExecState(GPRInfo::nonPreservedNonReturnGPR);
+
+ jit.setupArgumentsExecState();
jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(lookupExceptionHandler)), GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::nonArgGPR0);
jit.call(GPRInfo::nonArgGPR0);
@@ -100,11 +95,6 @@
GPRInfo::callFrameRegister,
static_cast<ptrdiff_t>(sizeof(Register)) * JSStack::ReturnPC));
jit.storePtr(GPRInfo::callFrameRegister, &vm->topCallFrame);
-#if USE(JSVALUE64)
- jit.poke64(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
-#else
- jit.poke(GPRInfo::nonPreservedNonReturnGPR, JITSTACKFRAME_ARGS_INDEX);
-#endif
jit.setupArgumentsExecState();
jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(slowPathFunction)), GPRInfo::nonArgGPR0);
emitPointerValidation(jit, GPRInfo::nonArgGPR0);
@@ -136,10 +126,8 @@
// The return address is on the stack or in the link register. We will hence
// save the return address to the call frame while we make a C++ function call
// to perform linking and lazy compilation if necessary. We expect the callee
- // to be in nonArgGPR0/nonArgGPR1 (payload/tag), the call frame to have already
- // been adjusted, nonPreservedNonReturnGPR holds the exception handler index,
- // and all other registers to be available for use. We use JITStackFrame::args
- // to save important information across calls.
+ // to be in nonArgGPR0/nonArgGPR1 (payload/tag), the CallFrame to have already
+ // been adjusted, and all other registers to be available for use.
CCallHelpers jit(vm);