nanojit: clean up codegen of i386 jumps

RESOLVED FIXED

Status

Core Graveyard
Nanojit
RESOLVED FIXED
8 years ago
4 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin)

Attachments

(2 attachments)

(Assignee)

Description

8 years ago
Created attachment 437477 [details] [diff] [review]
patch

This patch:

- Simplifies printing of jmp targets -- it prints 't' directly rather than
  computing (in a roundabout fashion) 't - _nIns + _nIns'.

- In JMP(), handles correctly a target of 0 (which requires later patching) by
  design, not just by luck.  In JCC() and JMP_long() it asserts that the
  target is not zero.

- Inlines JMP_long_nochk_offset() into its two callers and then removes it.
  Having that code factored out actually made things more complicated.

- Moves three jmp constants to where they're more visible.

These changes will help bug 506693.  I confirmed that codegen is unchanged
for TM on SunSpider.
Attachment #437477 - Flags: review?(edwsmith)

Updated

8 years ago
Attachment #437477 - Flags: review?(edwsmith) → review+
(Assignee)

Updated

8 years ago
Blocks: 506693
(Assignee)

Comment 1

8 years ago
http://hg.mozilla.org/projects/nanojit-central/rev/ec93bc283385

http://hg.mozilla.org/tracemonkey/rev/315c120ca1e7
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey

Comment 2

7 years ago
Created attachment 438755 [details] [diff] [review]
Loosen code in JCC() to allow for patchable backwards branches

TR generates conditional branches for loop edges (back-branches), which requires us to call asm_branch with target == 0, then patch later.

This patch loses the assert that t (target) != 0, but explicitly handles the patch case (target == 0) like the way its done in the X64 backend, instead of working by accident.
Attachment #438755 - Flags: review?(nnethercote)
(Assignee)

Updated

7 years ago
Attachment #438755 - Flags: review?(nnethercote) → review+

Comment 3

7 years ago
NJ fix: http://hg.mozilla.org/projects/nanojit-central/rev/5f12e1da6b7f

TR original: http://hg.mozilla.org/tamarin-redux/rev/7fc928af3c78
TR fix: http://hg.mozilla.org/tamarin-redux/rev/0dc2670f9505
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey → fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin
(Assignee)

Comment 4

7 years ago
TM fix: http://hg.mozilla.org/tracemonkey/rev/53895deb2fed

Comment 5

7 years ago
http://hg.mozilla.org/mozilla-central/rev/315c120ca1e7
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Component: Nanojit → Nanojit
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.