Closed Bug 505388 Opened 15 years ago Closed 15 years ago

nanojit: refactor two Assembler methods

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

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

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch patchSplinter Review
This patch refactors two methods in class Assembler.  In both cases it
simplifies hard-to-follow interactions between control flow and assignments,
making the code more functional (in the "functional programming" sense) and
less side-effect-laden.

Both functions are shorter as a result.  In registerAlloc() I was able to
remove an assertion that is now obviously true (it wasn't obvious before).
I'm also seeing a 3--5ms speedup for SunSpider;  it could be noise but
registerAlloc() accounts for a reasonable amount of total SunSpider time
(more than 1% IIRC) so it could be real.

(The original motivation for this change was that I'm looking at speeding up
the register allocator, and the complexity of these two functions, among
others, was impeding my ability to make understand the code and make changes.)
Attachment #389603 - Flags: review?(edwsmith)
Attachment #389603 - Flags: review?(edwsmith) → review+
http://hg.mozilla.org/tracemonkey/rev/1b8670957bfa
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/1b8670957bfa
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 513616
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: