Changeset 261549 in webkit


Ignore:
Timestamp:
May 12, 2020, 1:49:10 AM (5 years ago)
Author:
mark.lam@apple.com
Message:

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:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

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

    r261542 r261549  
    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 *
     
    7777#include "WasmCapabilities.h"
    7878#include "WasmContext.h"
    79 #include "WasmFaultSignalHandler.h"
    8079#include "WasmMemory.h"
    8180#include <locale.h>
     
    32323231    JSC::initializeThreading();
    32333232    initializeTimeoutIfNeeded();
    3234 #if ENABLE(WEBASSEMBLY)
    3235     JSC::Wasm::enableFastMemory();
    3236 #endif
    32373233
    32383234    bool gigacageDisableRequested = false;
  • trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp

    r261538 r261549  
    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();
  • trunk/Source/WebKit/ChangeLog

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

    r261462 r261549  
    8484#include <JavaScriptCore/JSLock.h>
    8585#include <JavaScriptCore/MemoryStatistics.h>
    86 #include <JavaScriptCore/WasmFaultSignalHandler.h>
    8786#include <WebCore/AXObjectCache.h>
    8887#include <WebCore/ApplicationCacheStorage.h>
     
    467466#endif
    468467
    469 #if ENABLE(WEBASSEMBLY)
    470     JSC::Wasm::enableFastMemory();
    471 #endif
    472 
    473468#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    474469    WebResourceLoadObserver::setShouldLogUserInteraction(parameters.shouldLogUserInteraction);
Note: See TracChangeset for help on using the changeset viewer.