Changeset 223907 in webkit


Ignore:
Timestamp:
Oct 24, 2017 11:55:52 AM (7 years ago)
Author:
jfbastien@apple.com
Message:

WebAssembly: NFC renames of things that aren't JS-specific
https://bugs.webkit.org/show_bug.cgi?id=178738

Reviewed by Saam Barati.

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::parseAndCompile):

  • wasm/WasmB3IRGenerator.h:
  • wasm/WasmBBQPlan.cpp:

(JSC::Wasm::BBQPlan::complete):

  • wasm/WasmCodeBlock.cpp:

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

  • wasm/WasmCodeBlock.h:

(JSC::Wasm::CodeBlock::embedderEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): Deleted.

  • wasm/WasmFormat.h:
  • wasm/js/JSToWasm.cpp:

(JSC::Wasm::createJSToWasmWrapper):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):

Location:
trunk/Source/JavaScriptCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r223904 r223907  
     12017-10-24  JF Bastien  <jfbastien@apple.com>
     2
     3        WebAssembly: NFC renames of things that aren't JS-specific
     4        https://bugs.webkit.org/show_bug.cgi?id=178738
     5
     6        Reviewed by Saam Barati.
     7
     8        * wasm/WasmB3IRGenerator.cpp:
     9        (JSC::Wasm::parseAndCompile):
     10        * wasm/WasmB3IRGenerator.h:
     11        * wasm/WasmBBQPlan.cpp:
     12        (JSC::Wasm::BBQPlan::complete):
     13        * wasm/WasmCodeBlock.cpp:
     14        (JSC::Wasm::CodeBlock::CodeBlock):
     15        * wasm/WasmCodeBlock.h:
     16        (JSC::Wasm::CodeBlock::embedderEntrypointCalleeFromFunctionIndexSpace):
     17        (JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): Deleted.
     18        * wasm/WasmFormat.h:
     19        * wasm/js/JSToWasm.cpp:
     20        (JSC::Wasm::createJSToWasmWrapper):
     21        * wasm/js/WebAssemblyModuleRecord.cpp:
     22        (JSC::WebAssemblyModuleRecord::link):
     23        (JSC::WebAssemblyModuleRecord::evaluate):
     24
    1252017-10-24  Stephan Szabo  <stephan.szabo@sony.com>
    226
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

    r223875 r223907  
    13591359    auto result = std::make_unique<InternalFunction>();
    13601360
    1361     compilationContext.jsEntrypointJIT = std::make_unique<CCallHelpers>();
     1361    compilationContext.embedderEntrypointJIT = std::make_unique<CCallHelpers>();
    13621362    compilationContext.wasmEntrypointJIT = std::make_unique<CCallHelpers>();
    13631363
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.h

    r223738 r223907  
    5050
    5151struct CompilationContext {
    52     std::unique_ptr<CCallHelpers> jsEntrypointJIT;
    53     std::unique_ptr<B3::OpaqueByproducts> jsEntrypointByproducts;
     52    std::unique_ptr<CCallHelpers> embedderEntrypointJIT;
     53    std::unique_ptr<B3::OpaqueByproducts> embedderEntrypointByproducts;
    5454    std::unique_ptr<CCallHelpers> wasmEntrypointJIT;
    5555    std::unique_ptr<B3::OpaqueByproducts> wasmEntrypointByproducts;
  • trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp

    r223738 r223907  
    314314
    315315            if (auto embedderToWasmInternalFunction = m_embedderToWasmInternalFunctions.get(functionIndex)) {
    316                 LinkBuffer linkBuffer(*context.jsEntrypointJIT, nullptr, JITCompilationCanFail);
     316                LinkBuffer linkBuffer(*context.embedderEntrypointJIT, nullptr, JITCompilationCanFail);
    317317                if (UNLIKELY(linkBuffer.didFailToAllocate())) {
    318318                    Base::fail(locker, makeString("Out of executable memory in function entrypoint at index ", String::number(functionIndex)));
     
    321321
    322322                embedderToWasmInternalFunction->entrypoint.compilation = std::make_unique<B3::Compilation>(
    323                     FINALIZE_CODE(linkBuffer, ("JavaScript->WebAssembly entrypoint[%i] %s", functionIndex, SignatureInformation::get(signatureIndex).toString().ascii().data())),
    324                     WTFMove(context.jsEntrypointByproducts));
     323                    FINALIZE_CODE(linkBuffer, ("Embedder->WebAssembly entrypoint[%i] %s", functionIndex, SignatureInformation::get(signatureIndex).toString().ascii().data())),
     324                    WTFMove(context.embedderEntrypointByproducts));
    325325            }
    326326        }
  • trunk/Source/JavaScriptCore/wasm/WasmCodeBlock.cpp

    r223738 r223907  
    6262        m_wasmIndirectCallEntryPoints.resize(m_calleeCount);
    6363
    64         m_plan->initializeCallees([&] (unsigned calleeIndex, RefPtr<Wasm::Callee>&& jsEntrypointCallee, Ref<Wasm::Callee>&& wasmEntrypointCallee) {
    65             if (jsEntrypointCallee) {
    66                 auto result = m_jsCallees.set(calleeIndex, WTFMove(jsEntrypointCallee));
     64        m_plan->initializeCallees([&] (unsigned calleeIndex, RefPtr<Wasm::Callee>&& embedderEntrypointCallee, Ref<Wasm::Callee>&& wasmEntrypointCallee) {
     65            if (embedderEntrypointCallee) {
     66                auto result = m_embedderCallees.set(calleeIndex, WTFMove(embedderEntrypointCallee));
    6767                ASSERT_UNUSED(result, result.isNewEntry);
    6868            }
  • trunk/Source/JavaScriptCore/wasm/WasmCodeBlock.h

    r223738 r223907  
    7878    // These two callee getters are only valid once the callees have been populated.
    7979
    80     Callee& jsEntrypointCalleeFromFunctionIndexSpace(unsigned functionIndexSpace)
     80    Callee& embedderEntrypointCalleeFromFunctionIndexSpace(unsigned functionIndexSpace)
    8181    {
    8282        ASSERT(runnable());
     
    8484        unsigned calleeIndex = functionIndexSpace - functionImportCount();
    8585
    86         auto callee = m_jsCallees.get(calleeIndex);
     86        auto callee = m_embedderCallees.get(calleeIndex);
    8787        RELEASE_ASSERT(callee);
    8888        return *callee;
     
    124124    Vector<RefPtr<Callee>> m_callees;
    125125    Vector<RefPtr<Callee>> m_optimizedCallees;
    126     HashMap<uint32_t, RefPtr<Callee>, typename DefaultHash<uint32_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> m_jsCallees;
     126    HashMap<uint32_t, RefPtr<Callee>, typename DefaultHash<uint32_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> m_embedderCallees;
    127127    Vector<void*> m_wasmIndirectCallEntryPoints;
    128128    Vector<TierUpCount> m_tierUpCounts;
  • trunk/Source/JavaScriptCore/wasm/WasmFormat.h

    r223738 r223907  
    279279};
    280280
    281 struct WasmExitStubs {
    282     MacroAssemblerCodeRef wasmToJs;
    283     MacroAssemblerCodeRef wasmToWasm;
    284 };
    285 
    286281using WasmEntrypointLoadLocation = void**;
    287282
  • trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp

    r223738 r223907  
    3737std::unique_ptr<InternalFunction> createJSToWasmWrapper(CompilationContext& compilationContext, const Signature& signature, Vector<UnlinkedWasmToWasmCall>* unlinkedWasmToWasmCalls, const ModuleInformation& info, MemoryMode mode, unsigned functionIndex)
    3838{
    39     CCallHelpers& jit = *compilationContext.jsEntrypointJIT;
     39    CCallHelpers& jit = *compilationContext.embedderEntrypointJIT;
    4040
    4141    auto result = std::make_unique<InternalFunction>();
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp

    r223738 r223907  
    123123                //     b. Append func to funcs.
    124124                //     c. Return func.
    125                 Wasm::Callee& jsEntrypointCallee = codeBlock->jsEntrypointCalleeFromFunctionIndexSpace(exp.kindIndex);
     125                Wasm::Callee& embedderEntrypointCallee = codeBlock->embedderEntrypointCalleeFromFunctionIndexSpace(exp.kindIndex);
    126126                Wasm::WasmEntrypointLoadLocation wasmEntrypointLoadLocation = codeBlock->wasmEntrypointLoadLocationFromFunctionIndexSpace(exp.kindIndex);
    127127                Wasm::SignatureIndex signatureIndex = module->signatureIndexFromFunctionIndexSpace(exp.kindIndex);
    128128                const Wasm::Signature& signature = Wasm::SignatureInformation::get(signatureIndex);
    129                 WebAssemblyFunction* function = WebAssemblyFunction::create(vm, globalObject, signature.argumentCount(), String::fromUTF8(exp.field), instance, jsEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
     129                WebAssemblyFunction* function = WebAssemblyFunction::create(vm, globalObject, signature.argumentCount(), String::fromUTF8(exp.field), instance, embedderEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
    130130                exportedValue = function;
    131131            }
     
    195195            m_startFunction.set(vm, this, startFunction);
    196196        } else {
    197             Wasm::Callee& jsEntrypointCallee = codeBlock->jsEntrypointCalleeFromFunctionIndexSpace(startFunctionIndexSpace);
     197            Wasm::Callee& embedderEntrypointCallee = codeBlock->embedderEntrypointCalleeFromFunctionIndexSpace(startFunctionIndexSpace);
    198198            Wasm::WasmEntrypointLoadLocation wasmEntrypointLoadLocation = codeBlock->wasmEntrypointLoadLocationFromFunctionIndexSpace(startFunctionIndexSpace);
    199             WebAssemblyFunction* function = WebAssemblyFunction::create(vm, globalObject, signature.argumentCount(), "start", instance, jsEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
     199            WebAssemblyFunction* function = WebAssemblyFunction::create(vm, globalObject, signature.argumentCount(), "start", instance, embedderEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
    200200            m_startFunction.set(vm, this, function);
    201201        }
     
    314314            }
    315315
    316             Wasm::Callee& jsEntrypointCallee = codeBlock->jsEntrypointCalleeFromFunctionIndexSpace(functionIndex);
     316            Wasm::Callee& embedderEntrypointCallee = codeBlock->embedderEntrypointCalleeFromFunctionIndexSpace(functionIndex);
    317317            Wasm::WasmEntrypointLoadLocation wasmEntrypointLoadLocation = codeBlock->wasmEntrypointLoadLocationFromFunctionIndexSpace(functionIndex);
    318318            const Wasm::Signature& signature = Wasm::SignatureInformation::get(signatureIndex);
     
    322322            // https://bugs.webkit.org/show_bug.cgi?id=165825
    323323            WebAssemblyFunction* function = WebAssemblyFunction::create(
    324                 vm, m_instance->globalObject(), signature.argumentCount(), String(), m_instance.get(), jsEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
     324                vm, m_instance->globalObject(), signature.argumentCount(), String(), m_instance.get(), embedderEntrypointCallee, wasmEntrypointLoadLocation, signatureIndex);
    325325
    326326            table->setFunction(vm, tableIndex, function);
Note: See TracChangeset for help on using the changeset viewer.