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

Changeset 249184 in webkit


Ignore:
Timestamp:
Aug 27, 2019, 4:48:54 PM (7 years ago)
Author:
msaboff@apple.com
Message:

Update PACCage changes for builds without Gigacage, but with signed pointers
https://bugs.webkit.org/show_bug.cgi?id=201202

Reviewed by Saam Barati.

Factored out the untagging of pointers and added that to both the Gigacage enabled
and disabled code paths. Did this for the LLInt as well as the JITs.

  • JavaScriptCore.xcodeproj/project.pbxproj: Added arm64e.rb to offlineasm file list.
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::cageTypedArrayStorage):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::caged):

  • llint/LowLevelInterpreter64.asm:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r249175 r249184  
     12019-08-27  Michael Saboff  <msaboff@apple.com>
     2
     3        Update PACCage changes for builds without Gigacage, but with signed pointers
     4        https://bugs.webkit.org/show_bug.cgi?id=201202
     5
     6        Reviewed by Saam Barati.
     7
     8        Factored out the untagging of pointers and added that to both the Gigacage enabled
     9        and disabled code paths.  Did this for the LLInt as well as the JITs.
     10
     11        * JavaScriptCore.xcodeproj/project.pbxproj: Added arm64e.rb to offlineasm file list.
     12        * dfg/DFGSpeculativeJIT.cpp:
     13        (JSC::DFG::SpeculativeJIT::cageTypedArrayStorage):
     14        * ftl/FTLLowerDFGToB3.cpp:
     15        (JSC::FTL::DFG::LowerDFGToB3::caged):
     16        * llint/LowLevelInterpreter64.asm:
     17
    1182019-08-27  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r249075 r249184  
    38623862                65B8392C1BACA92A0044E824 /* CachedRecovery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedRecovery.h; sourceTree = "<group>"; };
    38633863                65B8392D1BACA9D30044E824 /* CachedRecovery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedRecovery.cpp; sourceTree = "<group>"; };
     3864                65B898AD23146E9B00476358 /* arm64e.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = arm64e.rb; sourceTree = "<group>"; };
    38643865                65C02FBB0637462A003E7EE6 /* Protect.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Protect.h; sourceTree = "<group>"; tabWidth = 8; };
    38653866                65C6BEDF21128C3B006849C3 /* YarrDisassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrDisassembler.cpp; path = yarr/YarrDisassembler.cpp; sourceTree = "<group>"; };
     
    86578658                                FEF3475520362B1C00B7C0EF /* arm.rb */,
    86588659                                FEF3476220362B2200B7C0EF /* arm64.rb */,
     8660                                65B898AD23146E9B00476358 /* arm64e.rb */,
    86598661                                FEF3475920362B1D00B7C0EF /* asm.rb */,
    86608662                                FEF3475820362B1D00B7C0EF /* ast.rb */,
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r249175 r249184  
    67856785void SpeculativeJIT::cageTypedArrayStorage(GPRReg baseReg, GPRReg storageReg)
    67866786{
     6787    auto untagArrayPtr = [&]() {
    67876788#if CPU(ARM64E)
    6788     m_jit.untagArrayPtr(MacroAssembler::Address(baseReg, JSArrayBufferView::offsetOfLength()), storageReg);
     6789        m_jit.untagArrayPtr(MacroAssembler::Address(baseReg, JSArrayBufferView::offsetOfLength()), storageReg);
    67896790#else
    6790     UNUSED_PARAM(baseReg);
    6791     UNUSED_PARAM(storageReg);
     6791        UNUSED_PARAM(baseReg);
     6792        UNUSED_PARAM(storageReg);
    67926793#endif
     6794    };
    67936795
    67946796#if GIGACAGE_ENABLED
    67956797    UNUSED_PARAM(baseReg);
    6796     if (!Gigacage::shouldBeEnabled())
    6797         return;
     6798    if (!Gigacage::shouldBeEnabled()) {
     6799        untagArrayPtr();
     6800        return;
     6801    }
    67986802   
    67996803    if (Gigacage::canPrimitiveGigacageBeDisabled()) {
     
    68016805        if (vm.primitiveGigacageEnabled().isStillValid())
    68026806            m_jit.graph().watchpoints().addLazily(vm.primitiveGigacageEnabled());
    6803         else
     6807        else {
     6808            untagArrayPtr();
    68046809            return;
     6810        }
    68056811    }
    68066812   
    68076813    m_jit.cageWithoutUntagging(Gigacage::Primitive, storageReg);
    68086814#endif
     6815    untagArrayPtr();
    68096816}
    68106817
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r249175 r249184  
    1419114191    LValue caged(Gigacage::Kind kind, LValue ptr, LValue base)
    1419214192    {
     14193        auto doUntagArrayPtr = [&](LValue taggedPtr) {
     14194#if CPU(ARM64E)
     14195            if (kind == Gigacage::Primitive) {
     14196                LValue size = m_out.load32(base, m_heaps.JSArrayBufferView_length);
     14197                return untagArrayPtr(taggedPtr, size);
     14198            }
     14199            return ptr;
     14200#else
     14201            UNUSED_PARAM(taggedPtr);
     14202            return ptr;
     14203#endif
     14204        };
     14205
    1419314206#if GIGACAGE_ENABLED
    1419414207        if (!Gigacage::isEnabled(kind))
    14195             return ptr;
     14208            return doUntagArrayPtr(ptr);
    1419614209       
    1419714210        if (kind == Gigacage::Primitive && Gigacage::canPrimitiveGigacageBeDisabled()) {
     
    1419914212                m_graph.watchpoints().addLazily(vm().primitiveGigacageEnabled());
    1420014213            else
    14201                 return ptr;
     14214                return doUntagArrayPtr(ptr);
    1420214215        }
    1420314216       
     
    1421814231            });
    1421914232
    14220             LValue size = m_out.load32(base, m_heaps.JSArrayBufferView_length);
    14221             result = untagArrayPtr(merge, size);
     14233            result = doUntagArrayPtr(merge);
    1422214234        }
    1422314235#endif // CPU(ARM64E)
     
    1423914251        UNUSED_PARAM(kind);
    1424014252        UNUSED_PARAM(base);
    14241         return ptr;
     14253        return doUntagArrayPtr(ptr);
    1424214254    }
    1424314255   
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r248829 r249184  
    445445            const numberOfPACBits = constexpr MacroAssembler::numberOfPACBits
    446446            bfiq scratch2, 0, 64 - numberOfPACBits, ptr
    447             untagArrayPtr length, ptr
    448447        end
     448    end
     449    if ARM64E
     450        untagArrayPtr length, ptr
    449451    end
    450452end
Note: See TracChangeset for help on using the changeset viewer.