Closed Bug 512610 Opened 15 years ago Closed 15 years ago

nanojit: some register allocation clean-ups

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
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:

- Removes copyRegisters(), because it is dead.

- Changes RegAlloc::formatRegisters() from a static function into a normal
  member function, and removes the now-unnecessary first argument, because
  why do something an unusual way if you don't have to?

- Removes the prevreg() macro, because it is dead and only defined for two
  of the five back-ends.

- Replaces a couple of '1<<REG' occurrences with 'rmask(REG)', for
  consistency.

- In RegAlloc::formatRegisters(), uses FirstReg/LastReg/nextreg() to iterate
  over the registers -- as is done everywhere else -- instead of an integer
  loop.
Attachment #396637 - Flags: review?(edwsmith)
Attachment #396637 - Flags: review?(edwsmith) → review+
Comment on attachment 396637 [details] [diff] [review]
patch

one gotcha to look out for is the varous routines that do patching.  if they use asm_output indirectly, then foramtRegisters() will be called with a possibly null "this" (or _allocator) field.
(In reply to comment #1)
> one gotcha to look out for is the varous routines that do patching.  if they
> use asm_output indirectly, then foramtRegisters() will be called with a
> possibly null "this" (or _allocator) field.

I think it's safe... the only places formatRegisters() is called is within the output_asm macro, where I changed this:

   RegAlloc::formatRegisters(_allocator, outline, _thisfrag); \

to this:

   _allocator.formatRegisters(outline, _thisfrag); \

so all I really did was change _allocator from an explicit 1st argument to an implicit first argument (via 'this').  No variable scopes or uses changed otherwise.
Blocks: 513616
http://hg.mozilla.org/tracemonkey/rev/c1a97865c476
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/c1a97865c476
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: