Closed Bug 557705 Opened 14 years ago Closed 14 years ago

nanojit: clean up codegen of i386 jumps

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

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

Attachments

(2 files)

Attached patch patchSplinter Review
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)
Attachment #437477 - Flags: review?(edwsmith) → review+
Blocks: 506693
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)
Attachment #438755 - Flags: review?(nnethercote) → review+
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
http://hg.mozilla.org/mozilla-central/rev/315c120ca1e7
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: