Changeset 224539 in webkit


Ignore:
Timestamp:
Nov 7, 2017 11:33:22 AM (6 years ago)
Author:
mark.lam@apple.com
Message:

AccessCase::generateImpl() should exclude the result register when restoring registers after a call.
https://bugs.webkit.org/show_bug.cgi?id=179355
<rdar://problem/35263053>

Reviewed by Saam Barati.

JSTests:

  • stress/regress-179355.js: Added.

Source/JavaScriptCore:

In the Transition case in AccessCase::generateImpl(), we were restoring registers
using restoreLiveRegistersFromStackForCall() without excluding the scratchGPR
where we previously stashed the reallocated butterfly. If the generated code is
under heavy register pressure, scratchGPR could have been from the set of preserved
registers, and hence, would be restored by restoreLiveRegistersFromStackForCall().
As a result, the restoration would trash the butterfly result we stored there.
This patch fixes the issue by excluding the scratchGPR in the restoration.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r224487 r224539  
     12017-11-07  Mark Lam  <mark.lam@apple.com>
     2
     3        AccessCase::generateImpl() should exclude the result register when restoring registers after a call.
     4        https://bugs.webkit.org/show_bug.cgi?id=179355
     5        <rdar://problem/35263053>
     6
     7        Reviewed by Saam Barati.
     8
     9        * stress/regress-179355.js: Added.
     10
    1112017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r224491 r224539  
     12017-11-07  Mark Lam  <mark.lam@apple.com>
     2
     3        AccessCase::generateImpl() should exclude the result register when restoring registers after a call.
     4        https://bugs.webkit.org/show_bug.cgi?id=179355
     5        <rdar://problem/35263053>
     6
     7        Reviewed by Saam Barati.
     8
     9        In the Transition case in AccessCase::generateImpl(), we were restoring registers
     10        using restoreLiveRegistersFromStackForCall() without excluding the scratchGPR
     11        where we previously stashed the reallocated butterfly.  If the generated code is
     12        under heavy register pressure, scratchGPR could have been from the set of preserved
     13        registers, and hence, would be restored by restoreLiveRegistersFromStackForCall().
     14        As a result, the restoration would trash the butterfly result we stored there.
     15        This patch fixes the issue by excluding the scratchGPR in the restoration.
     16
     17        * bytecode/AccessCase.cpp:
     18        (JSC::AccessCase::generateImpl):
     19
    1202017-11-06  Robin Morisset  <rmorisset@apple.com>
    221
  • trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp

    r223715 r224539  
    10431043               
    10441044                noException.link(&jit);
    1045                 state.restoreLiveRegistersFromStackForCall(spillState);
     1045                RegisterSet resultRegisterToExclude;
     1046                resultRegisterToExclude.set(scratchGPR);
     1047                state.restoreLiveRegistersFromStackForCall(spillState, resultRegisterToExclude);
    10461048            }
    10471049        }
Note: See TracChangeset for help on using the changeset viewer.