Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4706d27c38ec93dd7ac88bb6f35ae781cf23e850
      
https://github.com/WebKit/WebKit/commit/4706d27c38ec93dd7ac88bb6f35ae781cf23e850
  Author: Justin Michaud <[email protected]>
  Date:   2024-04-19 (Fri, 19 Apr 2024)

  Changed paths:
    A JSTests/microbenchmarks/wasm-cc-int-to-int.js
    A JSTests/microbenchmarks/wasm-cc-int-to-int.wasm
    A JSTests/microbenchmarks/wasm-cc-int-to-int.wat
    A JSTests/wasm/stress/cc-i32-kitchen-sink.js
    A JSTests/wasm/stress/cc-int-to-int-cross-module-with-exception.js
    M JSTests/wasm/stress/cc-int-to-int-cross-module.js
    A JSTests/wasm/stress/cc-int-to-int-memory.js
    A JSTests/wasm/stress/cc-int-to-int-no-jit.js
    M JSTests/wasm/stress/cc-int-to-int.js
    M Source/JavaScriptCore/llint/InPlaceInterpreter.cpp
    M Source/JavaScriptCore/llint/InPlaceInterpreter.h
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/runtime/Options.cpp
    M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
    M Source/JavaScriptCore/wasm/WasmCallee.cpp
    M Source/JavaScriptCore/wasm/WasmCallee.h
    M Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
    M Source/JavaScriptCore/wasm/WasmLLIntPlan.h
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h

  Log Message:
  -----------
  Remove simple JS->Wasm entry thunks by using metadata
https://bugs.webkit.org/show_bug.cgi?id=267481
rdar://120933304

Reviewed by Yusuke Suzuki.

This is a re-land of the first patch, but disabled by default after it was 
reverted.

This patch lays the groundwork for a new way to call wasm functions without JIT.
We opt in only the simplest cases for now, but in those cases, we can skip the
generated JS->WASM entry thunk. Future work can expand this to more signatures.

This also changes the way tier-up works. Today, we re-write the JS->Wasm 
entrypoint
call pointer. This won't work anymore, so we instead check when loading the 
entrypoint
for interpreted-entry callees.

This shouldn't affect the jsCallEntrypoint IC, so this is a step in the 
direction
of completely removing these non-ic jit thunks in the future.

* JSTests/microbenchmarks/wasm-cc-int-to-int.js: Added.
(wasm_instance.exports):
* JSTests/microbenchmarks/wasm-cc-int-to-int.wasm: Added.
* JSTests/microbenchmarks/wasm-cc-int-to-int.wat: Added.
* JSTests/wasm/stress/cc-i32-kitchen-sink.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.f0.export.string_appeared_here.param.x0.i32.param.x1.i32.param.x2.i32.param.x3.i32.param.x4.i32.param.x5.i32.param.x6.i32.param.x7.i32.result.i32.i32.add.local.x0.i32.add.local.x1.i32.add.local.x2.i32.add.local.x3.i32.add.local.x4.i32.add.local.x5.i32.add.local.x6.local.x7.func.f1.export.string_appeared_here.param.x0.i32.param.x1.i32.param.x2.i32.param.x3.i32.param.x4.i32.param.x5.i32.param.x6.i32.param.x7.i32.param.x8.i32.param.x9.i32.param.x10.i32.param.x11.i32.result.i32.i32.add.local.x0.i32.add.local.x1.i32.add.local.x2.i32.add.local.x3.i32.add.local.x4.i32.add.local.x5.i32.add.local.x6.i32.add.local.x7.i32.add.local.x8.i32.add.local.x9.i32.add.local.x10.local.x11.func.f2.export.string_appeared_here.param.x0.i32.param.x1.i32.param.x2.i32.param.x3.i32.param.x4.i32.param.x5.i32.param.x6.i32.param.x7.i32.param.x8.i32.param.x9.i32.param.x10.i32.param.x11.i32.result.i32.i32.add.local.x0.local.x11
* JSTests/wasm/stress/cc-int-to-int-cross-module-with-exception.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.watA.module.import.string_appeared_here.string_appeared_here.func.functionB.param.x.i32.result.i32.import.string_appeared_here.string_appeared_here.func.doThrow.param.i32.import.string_appeared_here.string_appeared_here.func.log.param.i32.memory.1.tag.e.func.fillerSoNoJIT1.func.fillerSoNoJIT2.func.fillerSoNoJIT3.func.fillerSoNoJIT4.func.fillerSoNoJIT5.func.fillerSoNoJIT6.func.fillerSoNoJIT7.func.fillerSoNoJIT8.func.fillerSoNoJIT9.func.fillerSoNoJIT10.func.functionA.export.string_appeared_here.param.x.f64.result.f64.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.i32.local.l0.i32.local.l0.i32.const.555555555.i32.ne.i32.
(noInline.doTest.async test.doThrow):
(noInline.doTest.async test.log):
(noInline.doTest.async test):
* JSTests/wasm/stress/cc-int-to-int-cross-module.js:
* JSTests/wasm/stress/cc-int-to-int-memory.js: Added.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.memory.1.data.i32.const.0.string_appeared_here.func.test.export.string_appeared_here.param.x.i32.result.i32.i32.add.local.x.i32.load.i32.const.0.async
 test):
* JSTests/wasm/stress/cc-int-to-int-no-jit.js: Copied from 
JSTests/wasm/stress/cc-int-to-int.js.
(from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.type.sig_test.func.param.i32.result.i32.table.t.1.funcref.elem.i32.const.0.test.func.test.export.string_appeared_here.param.x.i32.result.i32.i32.add.local.x.i32.const.42.func.export.string_appeared_here.param.x.i32.result.i32.i32.add.local.x.call.test.i32.const.1337.func.export.string_appeared_here.param.x.i32.result.i32.local.x.i32.const.98.call_indirect.t.type.sig_test.i32.const.0.i32.add.async
 test):
* JSTests/wasm/stress/cc-int-to-int.js:
* Source/JavaScriptCore/llint/InPlaceInterpreter.cpp:
(JSC::IPInt::initialize):
* Source/JavaScriptCore/llint/InPlaceInterpreter.h:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::Options::notifyOptionsChanged):
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::JSEntrypointInterpreterCallee::JSEntrypointInterpreterCallee):
(JSC::Wasm::JSEntrypointInterpreterCallee::entrypointImpl const):
(JSC::Wasm::JSEntrypointInterpreterCallee::calleeSaveRegistersImpl):
* Source/JavaScriptCore/wasm/WasmCallee.h:
(JSC::Wasm::jsEntrypointMetadataForGPR):
(JSC::Wasm::jsEntrypointMetadataForFPR):
(JSC::Wasm::dumpJSEntrypointInterpreterCalleeMetadata):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::makeInterpretedJSToWasmCallee):
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::m_jsToWasmBoxedInterpreterCallee):
(JSC::m_boxedWasmCallee): Deleted.
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h:

Canonical link: https://commits.webkit.org/277762@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to