Changeset 270988 in webkit


Ignore:
Timestamp:
Dec 18, 2020, 1:42:13 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

Fix MacroAssemblerARM64E::validateUntaggedPtr() to account for TBI.
https://bugs.webkit.org/show_bug.cgi?id=220021
<rdar://problem/72474809>

Reviewed by Saam Barati.

  • assembler/AbstractMacroAssembler.h:
  • assembler/DisallowMacroScratchRegisterUsage.h:
  • templatized the DisallowMacroScratchRegisterUsage class so that we can #include it in MacroAssembler implementations.
  • assembler/MacroAssemblerARM64E.h:

(JSC::MacroAssemblerARM64E::validateUntaggedPtr):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r270981 r270988  
     12020-12-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix MacroAssemblerARM64E::validateUntaggedPtr() to account for TBI.
     4        https://bugs.webkit.org/show_bug.cgi?id=220021
     5        <rdar://problem/72474809>
     6
     7        Reviewed by Saam Barati.
     8
     9        * assembler/AbstractMacroAssembler.h:
     10        * assembler/DisallowMacroScratchRegisterUsage.h:
     11        - templatized the DisallowMacroScratchRegisterUsage class so that we can #include
     12          it in MacroAssembler implementations.
     13        * assembler/MacroAssemblerARM64E.h:
     14        (JSC::MacroAssemblerARM64E::validateUntaggedPtr):
     15
    1162020-12-17  Mark Lam  <mark.lam@apple.com>
    217
  • trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r270686 r270988  
    4747
    4848class AllowMacroScratchRegisterUsage;
    49 class DisallowMacroScratchRegisterUsage;
    5049class LinkBuffer;
    5150class Watchpoint;
     51
     52template<typename T> class DisallowMacroScratchRegisterUsage;
     53
    5254namespace DFG {
    5355struct OSRExit;
     
    11081110    friend class AllowMacroScratchRegisterUsage;
    11091111    friend class AllowMacroScratchRegisterUsageIf;
    1110     friend class DisallowMacroScratchRegisterUsage;
     1112    template<typename T> friend class DisallowMacroScratchRegisterUsage;
    11111113    unsigned m_tempRegistersValidBits;
    11121114    bool m_allowScratchRegister { true };
  • trunk/Source/JavaScriptCore/assembler/DisallowMacroScratchRegisterUsage.h

    r231317 r270988  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828#if ENABLE(ASSEMBLER)
    2929
    30 #include "MacroAssembler.h"
    31 
    3230namespace JSC {
    3331
     32template<typename MacroAssembler>
    3433class DisallowMacroScratchRegisterUsage {
    3534public:
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64E.h

    r270888 r270988  
    2828#if ENABLE(ASSEMBLER) && CPU(ARM64E)
    2929
     30#include "DisallowMacroScratchRegisterUsage.h"
     31
    3032// We need to include this before MacroAssemblerARM64.h because MacroAssemblerARM64
    3133// will be defined in terms of ARM64EAssembler for ARM64E.
     
    8486        if (scratch == InvalidGPR)
    8587            scratch = getCachedDataTempRegisterIDAndInvalidate();
    86         load8(Address(target), scratch);
     88
     89        DisallowMacroScratchRegisterUsage disallowScope(*this);
     90        rshift64(target, TrustedImm32(8), scratch);
     91        and64(TrustedImm64(0xff000000000000), scratch, scratch);
     92        or64(target, scratch, scratch);
     93        load8(Address(scratch), scratch);
    8794    }
    8895
Note: See TracChangeset for help on using the changeset viewer.