Closed Bug 512640 Opened 15 years ago Closed 15 years ago

nanojit: refactor Assembler::findRegFor()

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

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

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch patchSplinter Review
findRegFor() currently involves a hard-to-follow combination of complex control flow and assignments.  This patch refactors it so it's much easier to follow.  I did the refactoring by carefully making a succession of small, mechanical changes, so I'm fairly confident it's correct.  The logic is certainly clearer, esp. that there are four main cases.

There is some repetition in the new version relating to hint() and the registerAlloc()/addActive() pair, but I don't think that's so bad.  (The registerAlloc()/addActive() cases could be cleaned up by better handling of RegAlloc invariants, as mentioned in bug 512634.)  The source code is a little shorter, the binary code is a little longer, and SunSpider speed hasn't changed.
Attachment #396670 - Flags: review?(edwsmith)
Attachment #396670 - Flags: review?(edwsmith) → review+
http://hg.mozilla.org/tracemonkey/rev/6c0862612a4a
Whiteboard: fixed-in-tracemonkey
Follow-up commit to remove a stray debugging printf():

http://hg.mozilla.org/tracemonkey/rev/430c1f40b6cd
Blocks: 513616
Blocks: 515548
http://hg.mozilla.org/mozilla-central/rev/6c0862612a4a
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: