-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick a36c251. rdar://122674588
[JSC] Spew strict-eq Baseline JIT code with constant strings https://bugs.webkit.org/show_bug.cgi?id=269106 rdar://122674588 Reviewed by Alexey Shvayka. Let's leverage the fact that there are many `"string" === x` comparisons. In that case, we can emit very specific optimized code even in Baseline JIT easily. This patch adds `StringIdent === x` case optimizations in Baseline JIT. Furthermore, we found that ``` switch (expr) { case "string1": ... case "string2": ... case variable: ... } ``` case is emitting very inefficient bytecode, which does not use constant register directly with `jstricteq`. As a result, my new optimization does not kick in with this. This patch also fixes BytecodeGenerator to make this new optimization work well by emitting `jstricteq constant, x`. * Source/JavaScriptCore/jit/JITOpcodes.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::compileOpStrictEqJump): Canonical link: https://commits.webkit.org/274418@main Identifier: 272448.551@safari-7618.1.15.11-branch
- Loading branch information
1 parent
e5e6058
commit 56a875d
Showing
2 changed files
with
101 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters