Changeset 261593 in webkit


Ignore:
Timestamp:
May 12, 2020 5:51:21 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

Cherry-pick r261549. rdar://problem/63156073

2020-05-12 Mark Lam <mark.lam@apple.com>

Wasm::enableFastMemory() was called too late.
https://bugs.webkit.org/show_bug.cgi?id=211773

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

If Wasm fast memory is to be enabled, we should just do it in initializeThreading()
just like for all the other signal handlers that need to be initialized for JSC.
This simplifies its initialization and ensures that it is done in a timely manner
before Configs are frozen.

  • jsc.cpp: (jscmain):
  • runtime/InitializeThreading.cpp: (JSC::initializeThreading):

Source/WebKit:

Previously, we were calling Wasm::enableFastMemory() in WebProcess::initializeWebProcess().
By then, it is too late because the JSC::Config and WTF::Config have already been
frozen. There is nothing special about Wasm::enableFastMemory() that it needs to
be called this late. This patch moves it into JSC::initializeThreading() where
it belongs.

This change also make the initialization of Wasm fast memory consistent with how
we have always done it for the jsc shell i.e. it is initialized at the end of
JSC::initializeThreading().

  • WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
Location:
branches/safari-609-branch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch

  • branches/safari-609-branch/Source/JavaScriptCore/ChangeLog

    r261591 r261593  
     12020-05-12  Mark Lam  <mark.lam@apple.com>
     2
     3        Cherry-pick r261549. rdar://problem/63156073
     4
     5    2020-05-12  Mark Lam  <mark.lam@apple.com>
     6
     7            Wasm::enableFastMemory() was called too late.
     8            https://bugs.webkit.org/show_bug.cgi?id=211773
     9
     10            Reviewed by Yusuke Suzuki.
     11
     12            If Wasm fast memory is to be enabled, we should just do it in initializeThreading()
     13            just like for all the other signal handlers that need to be initialized for JSC.
     14            This simplifies its initialization and ensures that it is done in a timely manner
     15            before Configs are frozen.
     16
     17            * jsc.cpp:
     18            (jscmain):
     19            * runtime/InitializeThreading.cpp:
     20            (JSC::initializeThreading):
     21
    1222020-05-12  Mark Lam  <mark.lam@apple.com>
    223
  • branches/safari-609-branch/Source/JavaScriptCore/jsc.cpp

    r253867 r261593  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2004-2019 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2004-2020 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2006 Bjoern Graf (bjoern.graf@gmail.com)
    55 *
     
    7575#include "WasmCapabilities.h"
    7676#include "WasmContext.h"
    77 #include "WasmFaultSignalHandler.h"
    7877#include "WasmMemory.h"
    7978#include <locale.h>
     
    31393138    JSC::initializeThreading();
    31403139    initializeTimeoutIfNeeded();
    3141 #if ENABLE(WEBASSEMBLY)
    3142     JSC::Wasm::enableFastMemory();
    3143 #endif
    31443140
    31453141    bool gigacageDisableRequested = false;
  • branches/safari-609-branch/Source/JavaScriptCore/runtime/InitializeThreading.cpp

    r261591 r261593  
    4848#include "WasmCalleeRegistry.h"
    4949#include "WasmCapabilities.h"
     50#include "WasmFaultSignalHandler.h"
    5051#include "WasmThunks.h"
    5152#include "WriteBarrier.h"
     
    105106#endif
    106107        VMTraps::initializeSignals();
     108#if ENABLE(WEBASSEMBLY)
     109        Wasm::enableFastMemory();
     110#endif
    107111
    108112        WTF::compilerFence();
  • branches/safari-609-branch/Source/WebKit

  • branches/safari-609-branch/Source/WebKit/ChangeLog

    r261578 r261593  
     12020-05-12  Mark Lam  <mark.lam@apple.com>
     2
     3        Cherry-pick r261549. rdar://problem/63156073
     4
     5    2020-05-12  Mark Lam  <mark.lam@apple.com>
     6
     7            Wasm::enableFastMemory() was called too late.
     8            https://bugs.webkit.org/show_bug.cgi?id=211773
     9
     10            Reviewed by Yusuke Suzuki.
     11
     12            Previously, we were calling Wasm::enableFastMemory() in WebProcess::initializeWebProcess().
     13            By then, it is too late because the JSC::Config and WTF::Config have already been
     14            frozen.  There is nothing special about Wasm::enableFastMemory() that it needs to
     15            be called this late.  This patch moves it into JSC::initializeThreading() where
     16            it belongs.
     17
     18            This change also make the initialization of Wasm fast memory consistent with how
     19            we have always done it for the jsc shell i.e. it is initialized at the end of
     20            JSC::initializeThreading().
     21
     22            * WebProcess/WebProcess.cpp:
     23            (WebKit::WebProcess::initializeWebProcess):
     24
    1252020-05-12  Alan Coon  <alancoon@apple.com>
    226
  • branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.cpp

    r258924 r261593  
    8181#include <JavaScriptCore/JSLock.h>
    8282#include <JavaScriptCore/MemoryStatistics.h>
    83 #include <JavaScriptCore/WasmFaultSignalHandler.h>
    8483#include <WebCore/AXObjectCache.h>
    8584#include <WebCore/ApplicationCacheStorage.h>
     
    453452#endif
    454453
    455 #if ENABLE(WEBASSEMBLY)
    456     JSC::Wasm::enableFastMemory();
    457 #endif
    458 
    459454#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    460455    WebResourceLoadObserver::setShouldLogUserInteraction(parameters.shouldLogUserInteraction);
Note: See TracChangeset for help on using the changeset viewer.