If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nanojit: some register allocation clean-ups

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

Trunk
x86
Linux
Points:
---
Bug Flags:
wanted1.9.2 +

Firefox Tracking Flags

(status1.9.2 beta1-fixed)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
Created attachment 396637 [details] [diff] [review]
patch

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)

Updated

8 years ago
Attachment #396637 - Flags: review?(edwsmith) → review+

Comment 1

8 years ago
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.
(Assignee)

Comment 2

8 years ago
(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.
(Assignee)

Updated

8 years ago
Blocks: 513616
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/tracemonkey/rev/c1a97865c476
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/c1a97865c476
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Comment 5

8 years ago
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/0523517082d7
status1.9.2: --- → beta1-fixed
Flags: wanted1.9.2+
You need to log in before you can comment on or make changes to this bug.