Changeset 215596 in webkit


Ignore:
Timestamp:
Apr 20, 2017 5:30:44 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

virtualThunkFor() needs to materialize its of tagMaskRegister for tail calls.
https://bugs.webkit.org/show_bug.cgi?id=171079
<rdar://problem/31684756>

Reviewed by Saam Barati.

JSTests:

  • stress/regress-171079.js: Added.

Source/JavaScriptCore:

This is needed because tail calls would restore callee saved registers (and
therefore, potentially clobber the tag registers) before jumping to the thunk.

  • jit/ThunkGenerators.cpp:

(JSC::virtualThunkFor):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r215565 r215596  
     12017-04-20  Mark Lam  <mark.lam@apple.com>
     2
     3        virtualThunkFor() needs to materialize its of tagMaskRegister for tail calls.
     4        https://bugs.webkit.org/show_bug.cgi?id=171079
     5        <rdar://problem/31684756>
     6
     7        Reviewed by Saam Barati.
     8
     9        * stress/regress-171079.js: Added.
     10
    1112017-04-15  Filip Pizlo  <fpizlo@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r215595 r215596  
     12017-04-20  Mark Lam  <mark.lam@apple.com>
     2
     3        virtualThunkFor() needs to materialize its of tagMaskRegister for tail calls.
     4        https://bugs.webkit.org/show_bug.cgi?id=171079
     5        <rdar://problem/31684756>
     6
     7        Reviewed by Saam Barati.
     8
     9        This is needed because tail calls would restore callee saved registers (and
     10        therefore, potentially clobber the tag registers) before jumping to the thunk.
     11
     12        * jit/ThunkGenerators.cpp:
     13        (JSC::virtualThunkFor):
     14
    1152017-04-20  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r214645 r215596  
    181181   
    182182#if USE(JSVALUE64)
     183    GPRReg tagMaskRegister = GPRInfo::tagMaskRegister;
     184    if (callLinkInfo.isTailCall()) {
     185        // Tail calls could have clobbered the GPRInfo::tagMaskRegister because they
     186        // restore callee saved registers before getthing here. So, let's materialize
     187        // the TagMask in a temp register and use the temp instead.
     188        tagMaskRegister = GPRInfo::regT4;
     189        jit.move(CCallHelpers::TrustedImm64(TagMask), tagMaskRegister);
     190    }
    183191    slowCase.append(
    184         jit.branchTest64(
    185             CCallHelpers::NonZero, GPRInfo::regT0, GPRInfo::tagMaskRegister));
     192        jit.branchTest64(CCallHelpers::NonZero, GPRInfo::regT0, tagMaskRegister));
    186193#else
    187194    slowCase.append(
Note: See TracChangeset for help on using the changeset viewer.