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

Changeset 244348 in webkit


Ignore:
Timestamp:
Apr 16, 2019, 11:32:19 AM (7 years ago)
Author:
Kocsen Chung
Message:

Apply patch. rdar://problem/49836497

Location:
tags/Safari-607.2.4.1/Source
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r240426 r244348  
    10781078                5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; };
    10791079                5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; };
    1080                 5E158AC350BC4EC7877DC0F4 /* ObjectPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D0CC9E1CBC149AB8F403434 /* ObjectPrototypeInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10811080                623A37EC1B87A7C000754209 /* RegisterMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 623A37EB1B87A7BD00754209 /* RegisterMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10821081                627673241B680C1E00FD9F2E /* CallMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 627673221B680C1E00FD9F2E /* CallMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    33323331                526AC4B51E977C5D003500E1 /* WasmCodeBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmCodeBlock.h; sourceTree = "<group>"; };
    33333332                527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeType.cpp; sourceTree = "<group>"; };
     3333                528D8EBC226156FD00E75699 /* CPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CPU.cpp; sourceTree = "<group>"; };
    33343334                52B310FA1974AE610080857C /* FunctionHasExecutedCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionHasExecutedCache.h; sourceTree = "<group>"; };
    33353335                52B310FC1974AE870080857C /* FunctionHasExecutedCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionHasExecutedCache.cpp; sourceTree = "<group>"; };
     
    36513651                6AD2CB4C19B9140100065719 /* DebuggerEvalEnabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerEvalEnabler.h; sourceTree = "<group>"; };
    36523652                6BA93C9590484C5BAD9316EA /* JSScriptFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptFetcher.h; sourceTree = "<group>"; };
    3653                 6D0CC9E1CBC149AB8F403434 /* ObjectPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectPrototypeInlines.h; sourceTree = "<group>"; };
    36543653                70113D491A8DB093003848C4 /* IteratorOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IteratorOperations.cpp; sourceTree = "<group>"; };
    36553654                70113D4A1A8DB093003848C4 /* IteratorOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorOperations.h; sourceTree = "<group>"; };
     
    76117610                                86E116B00FE75AC800B512BC /* CodeLocation.h */,
    76127611                                0F30D7BF1D95D62F0053089D /* CPU.h */,
     7612                                528D8EBC226156FD00E75699 /* CPU.cpp */,
    76137613                                0F37308E1C0CD68500052BFA /* DisallowMacroScratchRegisterUsage.h */,
    76147614                                0FF4275615914A20004CB9FF /* LinkBuffer.cpp */,
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/Sources.txt

    r240375 r244348  
    4343
    4444assembler/AbstractMacroAssembler.cpp
     45assembler/CPU.cpp
    4546assembler/LinkBuffer.cpp
    4647assembler/MacroAssembler.cpp
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/assembler/CPU.h

    r237173 r244348  
    2727
    2828#include "Options.h"
     29#include <wtf/NumberOfCores.h>
    2930
    3031namespace JSC {
     
    132133}
    133134
     135#if (CPU(X86) || CPU(X86_64)) && OS(DARWIN)
     136bool isKernTCSMAvailable();
     137bool enableKernTCSM();
     138int kernTCSMAwareNumberOfProcessorCores();
     139#else
     140ALWAYS_INLINE bool isKernTCSMAvailable() { return false; }
     141ALWAYS_INLINE bool enableKernTCSM() { return false; }
     142ALWAYS_INLINE int kernTCSMAwareNumberOfProcessorCores() { return WTF::numberOfProcessorCores(); }
     143#endif
     144
    134145} // namespace JSC
    135146
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/heap/MachineStackMarker.h

    r231158 r244348  
    4949
    5050    // Only needs to be called by clients that can use the same heap from multiple threads.
    51     void addCurrentThread() { m_threadGroup->addCurrentThread(); }
     51    bool addCurrentThread() { return m_threadGroup->addCurrentThread() == ThreadGroupAddResult::NewlyAdded; }
    5252
    5353    WordLock& getLock() { return m_threadGroup->getLock(); }
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/runtime/JSLock.cpp

    r237042 r244348  
    148148    m_vm->setStackPointerAtVMEntry(p);
    149149
    150     m_vm->heap.machineThreads().addCurrentThread();
     150    if (m_vm->heap.machineThreads().addCurrentThread()) {
     151        if (isKernTCSMAvailable())
     152            enableKernTCSM();
     153    }
     154
    151155#if ENABLE(WEBASSEMBLY)
    152156    Wasm::startTrackingCurrentThread();
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/runtime/Options.cpp

    r240400 r244348  
    2828
    2929#include "AssemblerCommon.h"
     30#include "CPU.h"
    3031#include "LLIntCommon.h"
    3132#include "MinimumReservedZoneSize.h"
     
    205206static unsigned computeNumberOfWorkerThreads(int maxNumberOfWorkerThreads, int minimum = 1)
    206207{
    207     int cpusToUse = std::min(WTF::numberOfProcessorCores(), maxNumberOfWorkerThreads);
     208    int cpusToUse = std::min(kernTCSMAwareNumberOfProcessorCores(), maxNumberOfWorkerThreads);
    208209
    209210    // Be paranoid, it is the OS we're dealing with, after all.
     
    214215static int32_t computePriorityDeltaOfWorkerThreads(int32_t twoCorePriorityDelta, int32_t multiCorePriorityDelta)
    215216{
    216     if (WTF::numberOfProcessorCores() <= 2)
     217    if (kernTCSMAwareNumberOfProcessorCores() <= 2)
    217218        return twoCorePriorityDelta;
    218219
  • tags/Safari-607.2.4.1/Source/JavaScriptCore/wasm/WasmWorklist.cpp

    r233123 r244348  
    2929#if ENABLE(WEBASSEMBLY)
    3030
     31#include "CPU.h"
    3132#include "WasmPlan.h"
    32 
    33 #include <wtf/NumberOfCores.h>
    3433
    3534namespace JSC { namespace Wasm {
     
    208207    , m_planEnqueued(AutomaticThreadCondition::create())
    209208{
    210     unsigned numberOfCompilationThreads = Options::useConcurrentJIT() ? WTF::numberOfProcessorCores() : 1;
     209    unsigned numberOfCompilationThreads = Options::useConcurrentJIT() ? kernTCSMAwareNumberOfProcessorCores() : 1;
    211210    m_threads.reserveCapacity(numberOfCompilationThreads);
    212211    LockHolder locker(*m_lock);
  • tags/Safari-607.2.4.1/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in

    r241184 r244348  
    172172        "machdep.cpu.brand_string"
    173173        "security.mac.sandbox.sentinel"
     174        "kern.tcsm_enable"
     175        "kern.tcsm_available"
    174176        "vm.footprint_suspend")
    175177    (sysctl-name-regex #"^hw.(active|avail)cpu")
     
    181183    (sysctl-name-regex #"^net.routetable")
    182184)
     185
     186(allow sysctl-write
     187    (sysctl-name
     188        "kern.tcsm_enable"))
    183189
    184190(deny iokit-get-properties)
Note: See TracChangeset for help on using the changeset viewer.