Closed Bug 741317 Opened 13 years ago Closed 10 years ago

IonMonkey: Optimize findBestFreeRegister

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Assigned: sunfish)

References

(Blocks 1 open bug)

Details

(Whiteboard: [ion:t] )

Attachments

(1 file)

audio-beat-detection spends about 15% of the time under allocateRegisters, most of it in findBestFreeRegister. findBestFreeRegister has a number of inefficiencies, for instance if we need a GP register we shouldn't look at intervals for double registers, and if the interval has a register hint, and this register is free, there's no need to look at the other registers. With some refactoring findBestFreeRegister should be both faster and easier to understand.
Attached patch a proposed fixSplinter Review
This patch implements the first part of your suggestion; avoiding looking at GP regs when double regs are needed and so on. It results in about a 3% reduction in the total number of instructions executed on a bunch of common benchmarks when run with --ion-eager.
Attachment #770633 - Flags: review?(jdemooij)
Comment on attachment 770633 [details] [diff] [review] a proposed fix Review of attachment 770633 [details] [diff] [review]: ----------------------------------------------------------------- Nice, thanks for doing this.
Attachment #770633 - Flags: review?(jdemooij) → review+
Will there be a part 2? If so, please put "leave open" in the whiteboard.
Whiteboard: [ion:t] → [ion:t] [leave open]
Thanks; added. Part 2 would be using hints when present to speed up findBestFreeRegister, though I'm not currently working on it.
LSRA is now disabled by default (and will be removed soon) so we can close this. sunfish did land a patch here so marking this FIXED.
Assignee: jdemooij → sunfish
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [ion:t] [leave open] → [ion:t]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: