Move code from architecture-specific CodeGenerator into common CodeGenerator
Categories
(Core :: JavaScript Engine: JIT, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox131 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(26 files)
Bug 1913413 - Part 1: Move visitTestIAndBranch into shared CodeGenerator. r=#spidermonkey-reviewers!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1913413 - Part 7: Replace testObjectEmitBranch with branchTestObject. r=#spidermonkey-reviewers!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
MacroAssembler now provides enough abstractions that we can move more code from architecture-specific CodeGenerator into the common CodeGenerator.
Assignee | ||
Comment 1•3 months ago
|
||
Doesn't change generated code, but let's us share more code across all target
architectures.
Notes:
- If
isNextBlock(lir->ifTrue()->lir())
istrue
, thenjumpToBlock(lir->ifTrue())
is a no-op, so it's not necessary to checkisNextBlock
and we can instead
directly calljumpToBlock
. branchTest32(cond, input, input)
is handled by ARM targets to instead emit
branch32(cond, input, Imm32(0))
.
Also updated visitTestBIAndBranch
to stay in-sync.
Assignee | ||
Comment 2•3 months ago
|
||
Some target architectures allow the right-hand side to be an Address
, which
needs to be special-cased, because cmp{32,Ptr}Set
only supports Address
as
the left-hand side operand.
Assignee | ||
Comment 3•3 months ago
|
||
Similar to the previous two parts, share more code across targets.
Assignee | ||
Comment 4•3 months ago
|
||
Assignee | ||
Comment 5•3 months ago
|
||
Use branchTestNull
to share the same code across all targets.
Assignee | ||
Comment 6•3 months ago
|
||
Assignee | ||
Comment 7•3 months ago
|
||
Assignee | ||
Comment 8•3 months ago
|
||
Move the NaN handling code into a separate method.
Assignee | ||
Comment 9•3 months ago
|
||
Some branch64
methods were already calling into their branchPtr
counterparts. Do this consistently to avoid duplicating code.
Assignee | ||
Comment 10•3 months ago
|
||
Instead directly call either low
or hi
.
Assignee | ||
Comment 11•3 months ago
|
||
Support additional condition codes for part 13.
Drive-by change:
- Move
jump(fail)
for ARM32/x86 to the end to avoid duplicate code.
Assignee | ||
Comment 12•3 months ago
|
||
The next part will use these functions.
Assignee | ||
Comment 13•3 months ago
|
||
Share visitCompareI64AndBranch
across all target architectures.
Drive-by change:
- Move
const
forgetInt64Operand
to the correct position, because returning
aconst
value isn't really useful.
Assignee | ||
Comment 14•3 months ago
|
||
All architectures expect for ARM64 used useInt64OrConstant
, whereas ARM64 used
useInt64RegisterOrConstant
. The previous part ensures that Address operands are
correctly handled on all platforms, so useInt64OrConstant
is now also supported
for ARM64 and we can move the lowering back into the shared code.
Assignee | ||
Comment 15•3 months ago
|
||
Assignee | ||
Comment 16•3 months ago
|
||
Used in the next part.
Assignee | ||
Comment 17•3 months ago
|
||
And extend the existing branchTest64
on x86 and ARM32 to handle the case when
temp
is an invalid register or lhs != rhs
.
Assignee | ||
Comment 18•3 months ago
|
||
Using branchTest64
from the previous part, it's now possible to use a single
definition of visitTestI64AndBranch
.
Assignee | ||
Comment 19•3 months ago
|
||
lowerForBitAndAndBranch
is exactly the same across all targets, so there's
no reason to duplicate this code.
Drive-by change:
- Rename some variable to be consistent with other code in
visitTest
.
Assignee | ||
Comment 20•3 months ago
|
||
Requires adding LBitAnd64AndBranch
to cleanly handle 32- and 64-bit targets.
Assignee | ||
Comment 21•3 months ago
|
||
Assignee | ||
Comment 22•3 months ago
|
||
Assignee | ||
Comment 23•3 months ago
|
||
Used in the next part.
Assignee | ||
Comment 24•3 months ago
|
||
Assignee | ||
Comment 25•3 months ago
|
||
All callers use Register64 outputs, so it's easier to pass Register64 to
the MacroAssembler.
Assignee | ||
Comment 26•3 months ago
|
||
Comment 27•3 months ago
|
||
Comment 28•3 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0d102f00d0d7
https://hg.mozilla.org/mozilla-central/rev/8f9328e21fa7
https://hg.mozilla.org/mozilla-central/rev/bd7b76800a95
https://hg.mozilla.org/mozilla-central/rev/00221f811b82
https://hg.mozilla.org/mozilla-central/rev/ef6def483963
https://hg.mozilla.org/mozilla-central/rev/09a7c6105499
https://hg.mozilla.org/mozilla-central/rev/5dfd87ed05b4
https://hg.mozilla.org/mozilla-central/rev/2bac091fec61
https://hg.mozilla.org/mozilla-central/rev/9cb172f866f5
https://hg.mozilla.org/mozilla-central/rev/667435a5c4f7
https://hg.mozilla.org/mozilla-central/rev/4ca179b8636f
https://hg.mozilla.org/mozilla-central/rev/93bfcf8e8706
https://hg.mozilla.org/mozilla-central/rev/f0fbaabaa131
https://hg.mozilla.org/mozilla-central/rev/4f8dd358e534
https://hg.mozilla.org/mozilla-central/rev/c5923db1a7d7
https://hg.mozilla.org/mozilla-central/rev/517a6a9add34
https://hg.mozilla.org/mozilla-central/rev/190893e0c9c2
https://hg.mozilla.org/mozilla-central/rev/7c69fd0c5de7
https://hg.mozilla.org/mozilla-central/rev/6b57333f3d76
https://hg.mozilla.org/mozilla-central/rev/e50e1cfff284
https://hg.mozilla.org/mozilla-central/rev/4ff89086adc6
https://hg.mozilla.org/mozilla-central/rev/a7ce2906337d
https://hg.mozilla.org/mozilla-central/rev/4d4c4c4e791d
https://hg.mozilla.org/mozilla-central/rev/6ae14ffaa8c4
https://hg.mozilla.org/mozilla-central/rev/cf3241eb6da8
https://hg.mozilla.org/mozilla-central/rev/e812df518f63
Description
•