Closed Bug 2041360 Opened 3 months ago Closed 3 months ago

Fix various issues about missing veneer pool blocks for riscv64

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(10 files)

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
No description provided.

Replace BlockTrampolinePoolScope with AutoForbidPoolsAndNops, copying the
comments from the ARM64 code. Using the same name as ARM32/64 allows to share
more code and the name "trampoline" is actually V8-specific, so it seems
better to use the SpiderMonkey-specific nomenclature.

Also starts adding missing AutoForbidPoolsAndNops and AutoForbidNops, but
more come in later parts.

Clean-ups:

  • Adds BaseIndex overloads to the load and store methods.
  • Removes the duplicate ma_fld_{s,d} and ma_fst_{s,d} copied from LoongArch64,
    so there's now only ma_load{Float,Double} and ma_store{Float,Double}.
  • And align with integer load/store methods to use computeScaledAddress instead
    of computeEffectiveAddress.

Fixes:

  • Add AutoForbidPoolsAndNops directly before the load/store instruction so that
    currentOffset() returns the proper offset. Without it veneer pools can be
    inserted before the load/store instruction.

This matches the ARM64 code and using ma_{load,store} resp. ma_{load,store}{Float,Double}
will ensure the correct FaultingCodeOffset is used.

Note: The missing AutoForbidPoolsAndNops for ma_{load,store} are added in part 4.

Add AutoForbidPoolsAndNops to ensure no veneer pools are added, otherwise
the offset from currentOffset() can be incorrect.

Veneer pools may still get inserted within the atomic code sequences, but at
least now currentOffset() is correctly computed.

Calling nextOffset() without blocking pools may not return the correct offset
if veneers get added. Change writeDataRelocation to accept the actual offset
as BufferOffset resp. CodeOffset.

Return the buffer offset to avoid adding AutoForbidPoolsAndNops before
calling currentOffset() resp. nextOffset().

Also move AutoForbidPoolsAndNops into ma_liPatchable to avoid some code
duplication and to make it easier to see that all instructions are placed next
to each other.

As a side-effect, this also fixes some missing AutoForbidPoolsAndNops.

Updates the remaining BlockTrampolinePoolScope to use AutoForbidPoolsAndNops. Also
adds more missing AutoForbidPoolsAndNops and adds some comments.

Call the buffer align method to ensure no buffer nops are inserted.

Severity: -- → S3
Priority: -- → P2
Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/bee3d9014010 https://hg.mozilla.org/integration/autoland/rev/e6dbaf82a3c6 Part 1: Add AutoForbidPoolsAndNops. r=jandem https://github.com/mozilla-firefox/firefox/commit/5274d03573d3 https://hg.mozilla.org/integration/autoland/rev/71535c539ee9 Part 2: Fix FaultingCodeOffset for floating point load/store. r=jandem https://github.com/mozilla-firefox/firefox/commit/1014f56356b2 https://hg.mozilla.org/integration/autoland/rev/d15335e5624c Part 3: Simplify and fix code offsets for wasm load/store. r=jandem https://github.com/mozilla-firefox/firefox/commit/45dc9220b2c1 https://hg.mozilla.org/integration/autoland/rev/7132b24ea307 Part 4: Add missing AutoForbidPoolsAndNops before load/store instructions. r=jandem https://github.com/mozilla-firefox/firefox/commit/a750b5ee78a3 https://hg.mozilla.org/integration/autoland/rev/54e1ca27a9a9 Part 5: Add missing AutoForbidPoolsAndNops before currentOffset in atomic operations. r=jandem https://github.com/mozilla-firefox/firefox/commit/5b31aeb2943f https://hg.mozilla.org/integration/autoland/rev/b5b21b945184 Part 6: Fix data relocation offsets. r=jandem https://github.com/mozilla-firefox/firefox/commit/279a1904f532 https://hg.mozilla.org/integration/autoland/rev/2f6b15b5d0cd Part 7: Return BufferOffset from some methods. r=jandem https://github.com/mozilla-firefox/firefox/commit/28c1e3488d54 https://hg.mozilla.org/integration/autoland/rev/622ac2d3a919 Part 8: Return BufferOffset from ma_liPatchable. r=jandem https://github.com/mozilla-firefox/firefox/commit/bf003fa14839 https://hg.mozilla.org/integration/autoland/rev/3a453b617e14 Part 9: Update remaining BlockTrampolinePoolScope to use AutoForbidPoolsAndNops. r=jandem https://github.com/mozilla-firefox/firefox/commit/a78e12146ca8 https://hg.mozilla.org/integration/autoland/rev/ce76fd62b122 Part 10: Fix nopAlign. r=jandem https://github.com/mozilla-firefox/firefox/commit/67f14c9e88e0 https://hg.mozilla.org/integration/autoland/rev/878336a0a8b7 apply code formatting via Lando
QA Whiteboard: [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: