Ignore:
Timestamp:
Dec 22, 2021, 5:12:14 PM (3 years ago)
Author:
[email protected]
Message:

LLInt should loop OSR into BBQ and BBQ should loop OSR into OMG
https://bugs.webkit.org/show_bug.cgi?id=234542

Reviewed by Yusuke Suzuki.

JSTests:

  • wasm/wast-tests/harness.js:

Source/JavaScriptCore:

It's a startup perf improvement on some Wasm benchmarks I'm running to have
Wasm LLInt do loop OSR entry into BBQ instead of OMG. This improves this
benchmark by 5%. There is probably more perf to be had here. Currently,
we're just OSR entering into B3 BBQ O1. However, in the future, we should
just compile a single Air BBQ Callee that allows for OSR entry at loop
boundaries. Maybe we can model this using EntrySwitch without any real
harm to throughput.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • assembler/MacroAssemblerCodeRef.cpp:

(JSC::shouldDumpDisassemblyFor):

  • jsc.cpp:

(JSC_DEFINE_HOST_FUNCTION):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::parseAndCompile):

  • wasm/WasmCallee.h:

(JSC::Wasm::Callee::setOSREntryCallee): Deleted.

  • wasm/WasmCalleeGroup.h:
  • wasm/WasmCompilationMode.cpp:

(JSC::Wasm::makeString):

  • wasm/WasmCompilationMode.h:

(JSC::Wasm::isOSREntry):
(JSC::Wasm::isAnyBBQ):
(JSC::Wasm::isAnyOMG):

  • wasm/WasmOMGForOSREntryPlan.cpp: Removed.
  • wasm/WasmOMGForOSREntryPlan.h: Removed.
  • wasm/WasmOSREntryPlan.cpp: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.cpp.

(JSC::Wasm::OSREntryPlan::OSREntryPlan):
(JSC::Wasm::OSREntryPlan::work):
(JSC::Wasm::OMGForOSREntryPlan::OMGForOSREntryPlan): Deleted.
(JSC::Wasm::OMGForOSREntryPlan::work): Deleted.

  • wasm/WasmOSREntryPlan.h: Copied from Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.h.
  • wasm/WasmOperations.cpp:

(JSC::Wasm::doOSREntry):
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):

  • wasm/WasmPlan.cpp:

(JSC::Wasm::Plan::updateCallSitesToCallUs):

  • wasm/WasmSlowPaths.cpp:

(JSC::LLInt::WASM_SLOW_PATH_DECL):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wasm/WasmCompilationMode.h

    r268942 r287379  
    3131    LLIntMode,
    3232    BBQMode,
     33    BBQForOSREntryMode,
    3334    OMGMode,
    3435    OMGForOSREntryMode,
     
    3839const char* makeString(CompilationMode);
    3940
     41constexpr inline bool isOSREntry(CompilationMode compilationMode)
     42{
     43    switch (compilationMode) {
     44    case CompilationMode::LLIntMode:
     45    case CompilationMode::BBQMode:
     46    case CompilationMode::OMGMode:
     47    case CompilationMode::EmbedderEntrypointMode:
     48        return false;
     49    case CompilationMode::BBQForOSREntryMode:
     50    case CompilationMode::OMGForOSREntryMode:
     51        return true;
     52    }
     53}
     54
     55constexpr inline bool isAnyBBQ(CompilationMode compilationMode)
     56{
     57    switch (compilationMode) {
     58    case CompilationMode::BBQMode:
     59    case CompilationMode::BBQForOSREntryMode:
     60        return true;
     61    case CompilationMode::OMGForOSREntryMode:
     62    case CompilationMode::LLIntMode:
     63    case CompilationMode::OMGMode:
     64    case CompilationMode::EmbedderEntrypointMode:
     65        return false;
     66    }
     67}
     68
     69constexpr inline bool isAnyOMG(CompilationMode compilationMode)
     70{
     71    switch (compilationMode) {
     72    case CompilationMode::OMGMode:
     73    case CompilationMode::OMGForOSREntryMode:
     74        return true;
     75    case CompilationMode::BBQMode:
     76    case CompilationMode::BBQForOSREntryMode:
     77    case CompilationMode::LLIntMode:
     78    case CompilationMode::EmbedderEntrypointMode:
     79        return false;
     80    }
     81}
     82
    4083} } // namespace JSC::Wasm
Note: See TracChangeset for help on using the changeset viewer.