Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c89babbf644179cf626f919ad1094440d0bc62f0
      
https://github.com/WebKit/WebKit/commit/c89babbf644179cf626f919ad1094440d0bc62f0
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-02-25 (Wed, 25 Feb 2026)

  Changed paths:
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

  Log Message:
  -----------
  [JSC] Remove redundant to_string in single-expression template literals
https://bugs.webkit.org/show_bug.cgi?id=308693

Reviewed by Yusuke Suzuki.

`${expr}` emits two consecutive to_string opcodes because
the loop body (L339) already calls emitToString on the expression,
and the size()==1 fast path (L350) calls emitToString again.

Before:
  [0] enter
  [1] mov       loc5, arg1
  [4] to_string loc5, loc5
  [7] to_string loc5, loc5   <- redundant
  [10] ret      loc5

After:
  [0] enter
  [1] mov       loc5, arg1
  [4] to_string loc5, loc5
  [7] ret       loc5

* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::TemplateLiteralNode::emitBytecode):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to