Changeset 215853 in webkit


Ignore:
Timestamp:
Apr 26, 2017 7:57:09 PM (7 years ago)
Author:
keith_miller@apple.com
Message:

Follow up to r215843
https://bugs.webkit.org/show_bug.cgi?id=171361

Reviewed by Saam Barati.

This patch fixes some style comments Saam didn't get a chance to
request before I landed: https://bugs.webkit.org/show_bug.cgi?id=170134.

It renames Wasm::CodeBlock::m_wasmEntrypoints to
m_wasmIndirectCallEntrypoints, as well as fixes some copyrights and
indentation.

  • wasm/WasmBBQPlan.cpp:
  • wasm/WasmCodeBlock.cpp:

(JSC::Wasm::CodeBlock::CodeBlock):

  • wasm/WasmCodeBlock.h:

(JSC::Wasm::CodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace):

  • wasm/WasmOMGPlan.cpp:

(JSC::Wasm::OMGPlan::work):

  • wasm/WasmTierUpCount.h:

(JSC::Wasm::TierUpCount::TierUpCount):
(JSC::Wasm::TierUpCount::loopDecrement):
(JSC::Wasm::TierUpCount::functionEntryDecrement):
(JSC::Wasm::TierUpCount::shouldStartTierUp):
(JSC::Wasm::TierUpCount::count):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r215852 r215853  
     12017-04-26  Keith Miller  <keith_miller@apple.com>
     2
     3        Follow up to r215843
     4        https://bugs.webkit.org/show_bug.cgi?id=171361
     5
     6        Reviewed by Saam Barati.
     7
     8        This patch fixes some style comments Saam didn't get a chance to
     9        request before I landed: https://bugs.webkit.org/show_bug.cgi?id=170134.
     10
     11        It renames Wasm::CodeBlock::m_wasmEntrypoints to
     12        m_wasmIndirectCallEntrypoints, as well as fixes some copyrights and
     13        indentation.
     14
     15        * wasm/WasmBBQPlan.cpp:
     16        * wasm/WasmCodeBlock.cpp:
     17        (JSC::Wasm::CodeBlock::CodeBlock):
     18        * wasm/WasmCodeBlock.h:
     19        (JSC::Wasm::CodeBlock::wasmEntrypointLoadLocationFromFunctionIndexSpace):
     20        * wasm/WasmOMGPlan.cpp:
     21        (JSC::Wasm::OMGPlan::work):
     22        * wasm/WasmTierUpCount.h:
     23        (JSC::Wasm::TierUpCount::TierUpCount):
     24        (JSC::Wasm::TierUpCount::loopDecrement):
     25        (JSC::Wasm::TierUpCount::functionEntryDecrement):
     26        (JSC::Wasm::TierUpCount::shouldStartTierUp):
     27        (JSC::Wasm::TierUpCount::count):
     28
    1292017-04-26  Saam Barati  <sbarati@apple.com>
    230
  • trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp

    r215843 r215853  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
  • trunk/Source/JavaScriptCore/wasm/WasmCodeBlock.cpp

    r215843 r215853  
    5353        m_jsCallees.resize(m_calleeCount);
    5454        m_optimizedCallees.resize(m_calleeCount);
    55         m_wasmEntryPoints.resize(m_calleeCount);
     55        m_wasmIndirectCallEntryPoints.resize(m_calleeCount);
    5656
    5757        m_plan->initializeCallees([&] (unsigned calleeIndex, Ref<Wasm::Callee>&& jsEntrypointCallee, Ref<Wasm::Callee>&& wasmEntrypointCallee) {
    5858            m_jsCallees[calleeIndex] = WTFMove(jsEntrypointCallee);
    5959            m_callees[calleeIndex] = WTFMove(wasmEntrypointCallee);
    60             m_wasmEntryPoints[calleeIndex] = m_callees[calleeIndex]->entrypoint();
     60            m_wasmIndirectCallEntryPoints[calleeIndex] = m_callees[calleeIndex]->entrypoint();
    6161        });
    6262
  • trunk/Source/JavaScriptCore/wasm/WasmCodeBlock.h

    r215843 r215853  
    9999        RELEASE_ASSERT(functionIndexSpace >= functionImportCount());
    100100        unsigned calleeIndex = functionIndexSpace - functionImportCount();
    101         return &m_wasmEntryPoints[calleeIndex];
     101        return &m_wasmIndirectCallEntryPoints[calleeIndex];
    102102    }
    103103
     
    121121    Vector<RefPtr<Callee>> m_optimizedCallees;
    122122    Vector<RefPtr<Callee>> m_jsCallees;
    123     Vector<void*> m_wasmEntryPoints;
     123    Vector<void*> m_wasmIndirectCallEntryPoints;
    124124    Vector<TierUpCount> m_tierUpCounts;
    125125    Vector<Vector<UnlinkedWasmToWasmCall>> m_wasmToWasmCallsites;
  • trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp

    r215843 r215853  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    125125    // It's important to make sure we do this before we make any of the code we just compiled visible. If we didn't, we could end up
    126126    // where we are tiering up some function A to A' and we repatch some function B to call A' instead of A. Another CPU could see
    127     // the updates to B but still not have reset it's cache of A', which would lead to all kinds of badness.
     127    // the updates to B but still not have reset its cache of A', which would lead to all kinds of badness.
    128128    resetInstructionCacheOnAllThreads();
    129129    WTF::storeStoreFence(); // This probably isn't necessary but it's good to be paranoid.
    130130
    131     m_codeBlock->m_wasmEntryPoints[m_functionIndex] = entrypoint;
     131    m_codeBlock->m_wasmIndirectCallEntryPoints[m_functionIndex] = entrypoint;
    132132    {
    133133        LockHolder holder(m_codeBlock->m_lock);
  • trunk/Source/JavaScriptCore/wasm/WasmTierUpCount.h

    r215843 r215853  
    3434namespace JSC { namespace Wasm {
    3535
    36     // This class manages the tier up counts for Wasm binaries. The main interesting thing about
    37     // wasm tiering up counts is that the least significant bit indicates if the tier up has already
    38     // started. Also, wasm code does not atomically update this count. This is because we
    39     // don't care too much if the countdown is slightly off. The tier up trigger is atomic, however,
    40     // so tier up will be triggered exactly once.
    41     class TierUpCount {
    42         WTF_MAKE_NONCOPYABLE(TierUpCount);
    43     public:
    44         TierUpCount()
    45             : m_count(Options::webAssemblyOMGTierUpCount() * 2)
    46         {
    47         }
     36// This class manages the tier up counts for Wasm binaries. The main interesting thing about
     37// wasm tiering up counts is that the least significant bit indicates if the tier up has already
     38// started. Also, wasm code does not atomically update this count. This is because we
     39// don't care too much if the countdown is slightly off. The tier up trigger is atomic, however,
     40// so tier up will be triggered exactly once.
     41class TierUpCount {
     42    WTF_MAKE_NONCOPYABLE(TierUpCount);
     43public:
     44    TierUpCount()
     45        : m_count(Options::webAssemblyOMGTierUpCount() * 2)
     46    {
     47    }
    4848
    49         TierUpCount(TierUpCount&& other)
    50         {
    51             ASSERT(other.m_count == Options::webAssemblyOMGTierUpCount() * 2);
    52             m_count = other.m_count;
    53         }
     49    TierUpCount(TierUpCount&& other)
     50    {
     51        ASSERT(other.m_count == Options::webAssemblyOMGTierUpCount() * 2);
     52        m_count = other.m_count;
     53    }
    5454
    55         static uint32_t loopDecrement() { return Options::webAssemblyLoopDecrement() * 2; }
    56         static uint32_t functionEntryDecrement() { return Options::webAssemblyFunctionEntryDecrement() * 2; }
     55    static uint32_t loopDecrement() { return Options::webAssemblyLoopDecrement() * 2; }
     56    static uint32_t functionEntryDecrement() { return Options::webAssemblyFunctionEntryDecrement() * 2; }
    5757
    58         bool shouldStartTierUp()
    59         {
    60             return !(WTF::atomicExchangeOr(&m_count, 1) & 1);
    61         }
     58    bool shouldStartTierUp()
     59    {
     60        return !(WTF::atomicExchangeOr(&m_count, 1) & 1);
     61    }
    6262
    63         int32_t count() { return bitwise_cast<int32_t>(m_count); }
     63    int32_t count() { return bitwise_cast<int32_t>(m_count); }
    6464
    65     private:
    66         uint32_t m_count;
    67     };
     65private:
     66    uint32_t m_count;
     67};
    6868   
    6969} } // namespace JSC::Wasm
Note: See TracChangeset for help on using the changeset viewer.