Follow-up changes for bug 1687441
Categories
(Core :: JavaScript Engine: JIT, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(11 files, 1 obsolete file)
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 |
André suggested some performance improvements that are worth addressing.
- Inline
IntPtr
constants forLCompare
- Avoid two
MArrayBufferViewLength
for.length
(Int32) and bounds check (IntPtr) with a separate IntPtrToInt32 guard - Related, optimize bounds check hoisting better for trivial
i < ta.length
case - See if we can use redefine for no-op
MInt32ToIntPtr
move64
optimization: https://bugzilla.mozilla.org/show_bug.cgi?id=1586662- Fix
AnalyzeLoadUnboxedScalar
, although it has no effect with Spectre mitigations on - Support
IntPtr
(forMInt32ToIntPtr
) inRangeAnalysis::addRangeAssertions
. - Propagate range for
MNonNegativeIntPtrToInt32
.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Change useAnyOrConstant to useAnyOrInt32Constant and use for Compare_UIntPtr.
For IntPtr values, useAnyOrInt32Constant checks a constant is only used for values
in the Int32 range.
Assignee | ||
Comment 2•4 years ago
|
||
Drive-by change: for Compare_Symbol and Compare_Object this allows the RHS to be
a memory operand on non-ARM platforms, instead of requiring a register.
Depends on D103482
Assignee | ||
Comment 3•4 years ago
|
||
Very similar to MIRType::Int32 but use branchPtr instead of branch32 for codegen.
Depends on D103483
Assignee | ||
Comment 4•4 years ago
|
||
This makes GVN and bounds check optimizations work better.
Depends on D103484
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Backed out for causing build bustages.
Backout link: https://hg.mozilla.org/integration/autoland/rev/a9360c938ce15d9712c628c3252796b82916b855
Failure log: https://treeherder.mozilla.org/logviewer?job_id=328472209&repo=autoland&lineNumber=21775
Comment 8•4 years ago
|
||
bugherder |
Assignee | ||
Comment 9•4 years ago
|
||
32-bit platforms: alawys use redefine to avoid an unnecessary register move.
64-bit platforms: use redefine for LInt32ToIntPtr when we know input >= 0
(checked in debug builds with LAssertInt32IsIntPtr).
Assignee | ||
Comment 10•4 years ago
|
||
It's easy enough to support memory operands with load32SignExtendToPtr.
Depends on D103754
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 11•4 years ago
|
||
We're already using defineReuseInput for LNonNegativeIntPtrToInt32 and the next patch
uses it for LInt32ToIntPtr too. This exposed an issue on Try: we can't merge those
virtual registers into a single bundle (allocation) because we can get confused about
the stack slots (for example do an 8-byte write for IntPtr to a 4-byte Int32 slot).
This adds some code to disable the tryMergeReusedRegister optimization in this case.
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
With the old Linear Scan register allocator, the list of Value stack slots in
safepoints was used on 32-bit platforms too: the allocator tried hard to spill
Value type and payload slots to adjacent stack slots so that we could trace them
as a single Value. If this failed, the type and payload halves were encoded
separately as "nunbox parts".
With the backtracking allocator we now always use the "nunbox parts" encoding on
32-bit. The Value slots in the safepoints are only used on 64-bit platforms
(addValueSlot is only called on 64-bit). This patch makes this more explicit by
either using "value slots" (64-bit) or "nunbox slots" (32-bit).
Assignee | ||
Comment 13•4 years ago
|
||
The old register allocator allocated 8 bytes for nunbox type or payload. It was
then able to use the same 8-byte slot for spilling the other half and could add
this Value-slot to safepoints as a single unit.
The backtracking allocator, however, doesn't have this optimization so allocating
8 bytes for nunbox type/payload is a waste: we only ever use 4 bytes.
This simplifies the next patch.
Depends on D104363
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 14•4 years ago
|
||
This isn't observable because offsetAdjustment is always 0 (AnalyzeLoadUnboxedScalar
doesn't know about the Int32 to IntPtr conversion).
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Assignee | ||
Comment 18•4 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #0)
- Fix
AnalyzeLoadUnboxedScalar
, although it has no effect with Spectre mitigations on
I'm not sure what to do with this one: I have a patch to make this work on a local test case, but the optimization doesn't kick in on any jit-tests or Octane (tested by adding a MOZ_CRASH()
) with --spectre-mitigations=off
.
Assignee | ||
Comment 19•4 years ago
|
||
As suggested, we can just propagate the range from the input.
Assignee | ||
Comment 20•4 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #18)
(In reply to Jan de Mooij [:jandem] from comment #0)
- Fix
AnalyzeLoadUnboxedScalar
, although it has no effect with Spectre mitigations onI'm not sure what to do with this one: I have a patch to make this work on a local test case, but the optimization doesn't kick in on any jit-tests or Octane (tested by adding a
MOZ_CRASH()
) with--spectre-mitigations=off
.
Filed bug 1691919 for this. Other than that, everything in comment 0 has now been addressed.
Updated•4 years ago
|
Assignee | ||
Comment 21•4 years ago
|
||
This is consistent with the shell flag that was renamed to --large-arraybuffers
Updated•4 years ago
|
Comment 22•4 years ago
|
||
Comment 23•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
bugherder |
Description
•