Emitting incorrect x64 instruction for cmpb in some cases
Categories
(Core :: JavaScript Engine: JIT, task)
Tracking
()
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(4 files, 4 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
With patches for bug 1986983 I got a mysterious jit-test failure on Try, only on Win64 debug builds. I managed to reproduce it locally and I got a time travel debugging trace from WinDbg.
In CodeGenerator::visitStringToLowerCase we use branch8 to check if a char is already lower case:
masm.branch8(Assembler::NotEqual,
BaseIndex(toLowerCaseTable, current, TimesOne), current,
&hasUpper);
For certain registers, for example if toLowerCaseTable == rax and current == rdi, we emit a cmp instruction that compares to the wrong register:
cmp %bh,(%rax,%rdi,1)
Changing oneByteOp to oneByteOp8 in cmpb_rm fixes this:
cmp %dil,(%rax,%rdi,1)
If the bh register happens to have the same value in it as dil, this resulted in LStringToLowerCase thinking it could just return the input string and we fail the test.
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Comment 2•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Updated•1 year ago
|
https://hg.mozilla.org/mozilla-central/rev/897ce9eb6a45
https://hg.mozilla.org/mozilla-central/rev/63b10ce476d9
| Assignee | ||
Comment 5•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Original Revision: https://phabricator.services.mozilla.com/D264054
Updated•1 year ago
|
| Assignee | ||
Comment 6•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Original Revision: https://phabricator.services.mozilla.com/D264054
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Original Revision: https://phabricator.services.mozilla.com/D264054
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Original Revision: https://phabricator.services.mozilla.com/D264054
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 9•1 year ago
|
||
This uses the Zydis disassembler to check the generated code is what we expect.
Original Revision: https://phabricator.services.mozilla.com/D264054
Updated•1 year ago
|
| Assignee | ||
Comment 10•1 year ago
|
||
Use oneByteOp8 to emit the REX prefix for byte registers if needed. This fixes an
issue with our code for LStringToLowerCase for certain register combinations/values.
With patches for bug 1986983 this was caught by jit-tests on Win64-debug builds.
Original Revision: https://phabricator.services.mozilla.com/D263972
Updated•1 year ago
|
Updated•11 months ago
|
Comment 11•11 months ago
|
||
:jandem, the uplift request patches are missing the Uplift Request form?
https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift#Submit_the_Uplift_Request_Form
Comment 12•11 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: Broken websites.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Self-contained fix for x64 platforms to generate the right instruction.
- String changes made/needed: N/A
- Is Android affected?: no
| Assignee | ||
Comment 13•11 months ago
|
||
(In reply to Donal Meehan [:dmeehan] from comment #11)
:jandem, the uplift request patches are missing the Uplift Request form?
https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift#Submit_the_Uplift_Request_Form
Huh weird, when I went to "Uplift Assessment" for part 2 now it still had the answers I entered last time so I just submitted that again. I'm not sure what went wrong the first time. Is this okay now?
Comment 14•11 months ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #13)
(In reply to Donal Meehan [:dmeehan] from comment #11)
:jandem, the uplift request patches are missing the Uplift Request form?
https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift#Submit_the_Uplift_Request_FormHuh weird, when I went to "Uplift Assessment" for part 2 now it still had the answers I entered last time so I just submitted that again. I'm not sure what went wrong the first time. Is this okay now?
Thanks, it looks ok now
Updated•11 months ago
|
Updated•11 months ago
|
Updated•11 months ago
|
Comment 15•11 months ago
|
||
| uplift | ||
Description
•