[webkit-changes] [WebKit/WebKit] 711c7d: [JSC] Call toThis for Object#toString in DFG / FTL

Yusuke Suzuki noreply at github.com
Tue Jan 17 22:39:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 711c7de281d5975ec9428ebe0e27f859ee57f022
      https://github.com/WebKit/WebKit/commit/711c7de281d5975ec9428ebe0e27f859ee57f022
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-01-17 (Tue, 17 Jan 2023)

  Changed paths:
    A JSTests/stress/object-to-string-and-to-this.js
    M Source/JavaScriptCore/dfg/DFGOperations.cpp

  Log Message:
  -----------
  [JSC] Call toThis for Object#toString in DFG / FTL
https://bugs.webkit.org/show_bug.cgi?id=250748
rdar://104299510

Reviewed by Mark Lam.

Object#toString specifically requires `toThis+Strict` since it keeps undefined |this| as is (most of them converts it to JSGlobalObject).
This is done in runtime function, but not done in DFG / FTL operations. This patch adds toThis call in DFG operations to make it work correctly.

* JSTests/stress/object-to-string-and-to-this.js: Added.
(shouldBe):
(foo):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):

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




More information about the webkit-changes mailing list