op_switch_char broken for rope strings after JSRopeString layout rewrite
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2019 00:20:07 +0000 (00:20 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2019 00:20:07 +0000 (00:20 +0000)
commit19cc3a2f155ace7550128a77475135b7fa2940fc
tree0b5e43f4e26206db443d2bcd18805f9be061ec22
parent60a29c8348f955a2135612ac404c37cee56b5581
op_switch_char broken for rope strings after JSRopeString layout rewrite
https://bugs.webkit.org/show_bug.cgi?id=195339
<rdar://problem/48592545>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/switch-on-char-llint-rope.js: Added.

Source/JavaScriptCore:

When we did the JSString rewrite, we accidentally broke LLInt's switch_char
for rope strings. That change made it so that we always go to the slow path
for ropes. That's wrong. The slow path should only be taken when the rope
is of length 1. For lengths other than 1, we need to fall through to the
default case. This patch fixes this.

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSString.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/switch-on-char-llint-rope.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/JSString.h