Closed Bug 524640 Opened 15 years ago Closed 15 years ago

nanojit: avoid calling releaseRegisters() twice

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

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

Details

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

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
asm_leave_trace() calls releaseRegisters().  Shortly after, it calls assignSavedRegs() which again calls releaseRegisters().  The call in assignSavedRegs() can be removed without seeming ill effect, and I'm seeing a ~3ms SS speedup on my (64-bit) Mac.
Attachment #408558 - Flags: review?(gal)
Comment on attachment 408558 [details] [diff] [review]
patch

Nice.
Attachment #408558 - Flags: review?(gal) → review+
should we maybe move the call into assignSavedRegs? Or at least assert that registers were released?
I'm not sure if calling releaseRegisters() before nFragExit() is important.  I'm happy to add an assertion in assigneSavedRegs() that all the registers are free.
Attached patch patch v2Splinter Review
Having removed the call to releaseRegisters() from assignSavedRegs(), better add calls to releaseRegisters() to the other calls sites in the back-ends.

Another possibility would have been to keep the releaseRegisters() call in assignSavedRegs() and remove the one in asm_leave_trace(), but I didn't like that because then the function name would be misleading -- it should really be called releaseRegistersAndAssignSavedRegs().
Attachment #408558 - Attachment is obsolete: true
Attachment #418597 - Flags: review?(gal)
Attachment #418597 - Flags: review?(gal) → review+
http://hg.mozilla.org/tracemonkey/rev/9a76a5c713ee
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/9a76a5c713ee
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: