Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 47d91b3b9badc4625d8b324ad29fa64f952cb5e7
      
https://github.com/WebKit/WebKit/commit/47d91b3b9badc4625d8b324ad29fa64f952cb5e7
  Author: Yusuke Suzuki <ysuz...@apple.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
    M Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
    M Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/runtime/VM.h
    M Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h
    M Source/JavaScriptCore/wasm/WasmOperations.cpp
    M Source/JavaScriptCore/wasm/WasmOperationsInlines.h
    M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp

  Log Message:
  -----------
  [JSC] Always use Wasm::Callee for wasm function callee
https://bugs.webkit.org/show_bug.cgi?id=251026
rdar://104563575

Reviewed by Tadeu Zagallo.

This patch removes hack for wasm catch. Previously we are setting JSCell on 
callee when throwing an error from wasm because
LLInt catch code etc. strongly assumes JSCell on callee slot and retrieving VM 
from that. And to allow this rewrite, we had
a side table VM::calleeForWasmCatch which holds true Wasm::Callee and then we 
needed to replace it later.
But we can now get VM easily even in wasm frame because we strongly guarantee 
that CodeBlock slot now holds Wasm::Instance*
if a frame is wasm frame. This patch fixes the code so that VM retrieval 
becomes as follows.

    if (callee is wasm)
        get VM from wasmInstance in codeBlock slot
    else
        get VM from callee cell

This removes the hack for wasm exception, and we can remove 
VM::calleeForWasmCatch.

* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::calleeForWasmCatchOffset): Deleted.
* Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h:
(JSC::Wasm::emitCatchPrologueShared):
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h:
(JSC::Wasm::throwWasmToJSException):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_SLOW_PATH_DECL):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to