Closed
Bug 1413944
Opened 7 years ago
Closed 7 years ago
Remove unreachable code in VMFunction's StringFromCharCode
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(1 file)
1012 bytes,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
- StringFromCharCode is only called [1] when the string cannot be loaded from StaticStrings, so this condition always evaluates to false [2].
- If the string isn't in StaticStrings, it's guaranteed to be a two-byte string, so we can directly call NewStringCopyNDontDeflate in [3].
[1] https://searchfox.org/mozilla-central/rev/423b2522c48e1d654e30ffc337164d677f934ec3/js/src/jit/CodeGenerator.cpp#8147-8149
[2] https://searchfox.org/mozilla-central/rev/423b2522c48e1d654e30ffc337164d677f934ec3/js/src/jit/VMFunctions.cpp#469-470
[3] https://searchfox.org/mozilla-central/rev/423b2522c48e1d654e30ffc337164d677f934ec3/js/src/jit/VMFunctions.cpp#472
Assignee | ||
Comment 1•7 years ago
|
||
(In reply to André Bargull [:anba] from comment #0)
> - StringFromCharCode is only called [1] when the string cannot be loaded
> from StaticStrings, so this condition always evaluates to false [2].
Derp, that's wrong because of `String.fromCharCode(0x10000 | 0x41)`.
Assignee | ||
Comment 2•7 years ago
|
||
The code unit can't be deflated to Latin-1, so we can directly call NewStringCopyNDontDeflate. This also realigns the code with CodeUnitToString in jsstr.cpp.
Attachment #8924595 -
Flags: review?(jdemooij)
Comment 3•7 years ago
|
||
Comment on attachment 8924595 [details] [diff] [review]
bug1413944.patch
Review of attachment 8924595 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM, thanks.
Attachment #8924595 -
Flags: review?(jdemooij) → review+
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Comment 4•7 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3c5fbdd2af8e45c5fafd8af65aa05d23f566f3c7
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f858fa7ff379
Don't try to deflate two-byte code unit in StringFromCharCode. r=jandem
Keywords: checkin-needed
Comment 6•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•