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

Changeset 271240 in webkit


Ignore:
Timestamp:
Jan 7, 2021, 9:33:24 AM (6 years ago)
Author:
mark.lam@apple.com
Message:

The scratch register should be different from the target register when calling validateUntaggedPtr.
https://bugs.webkit.org/show_bug.cgi?id=220397
rdar://72771069

Reviewed by Yusuke Suzuki.

  • assembler/MacroAssemblerARM64E.h:

(JSC::MacroAssemblerARM64E::validateUntaggedPtr):

  • Added an ASSERT to enforce this invariant.
  • jit/ThunkGenerators.cpp:

(JSC::emitPointerValidation):

  • emitPointerValidation() was reusing the target register as the scratch register. This is a hold over from the previous way of doing the validation (which had a bug). With the validation bug fixed, this register reuse is no longer allowed.
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r271230 r271240  
     12021-01-07  Mark Lam  <mark.lam@apple.com>
     2
     3        The scratch register should be different from the target register when calling validateUntaggedPtr.
     4        https://bugs.webkit.org/show_bug.cgi?id=220397
     5        rdar://72771069
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * assembler/MacroAssemblerARM64E.h:
     10        (JSC::MacroAssemblerARM64E::validateUntaggedPtr):
     11        - Added an ASSERT to enforce this invariant.
     12        * jit/ThunkGenerators.cpp:
     13        (JSC::emitPointerValidation):
     14        - emitPointerValidation() was reusing the target register as the scratch register.
     15          This is a hold over from the previous way of doing the validation (which had a
     16          bug).  With the validation bug fixed, this register reuse is no longer allowed.
     17
    1182021-01-07  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64E.h

    r270988 r271240  
    8888
    8989        DisallowMacroScratchRegisterUsage disallowScope(*this);
     90        ASSERT(target != scratch);
    9091        rshift64(target, TrustedImm32(8), scratch);
    9192        and64(TrustedImm64(0xff000000000000), scratch, scratch);
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r270764 r271240  
    5252        jit.pushToSave(pointerGPR);
    5353        jit.untagPtr(tag, pointerGPR);
    54         jit.validateUntaggedPtr(pointerGPR, pointerGPR);
     54        jit.validateUntaggedPtr(pointerGPR);
    5555        jit.popToRestore(pointerGPR);
    5656    }
Note: See TracChangeset for help on using the changeset viewer.