Optimize LUnbox codegen on x64

RESOLVED FIXED in mozilla37

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

(Blocks 1 bug)

unspecified
mozilla37
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Assignee

Description

5 years ago
Posted patch PatchSplinter Review
The micro-benchmark in bug 624299 is slower on x64 than on x86, apparently due to Unbox:Int32 instructions for the 3 arguments. For each argument we do:

[MoveGroup]
movq       0x68(%rsp), %rax
[Unbox:Int32]
movl       %eax, %eax

This patch changes useRegisterAtStart to useAtStart for infallible unbox instructions, so that we have just:

[Unbox:Int32]
movl       0x68(%rsp), %eax

With this patch the numbers are about the same as with a 32-bit build.
Attachment #8527826 - Flags: review?(sunfish)
Comment on attachment 8527826 [details] [diff] [review]
Patch

Review of attachment 8527826 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jit/x64/CodeGenerator-x64.cpp
@@ +90,2 @@
>      MUnbox *mir = unbox->mir();
> +    LAllocation *input = unbox->getOperand(LUnbox::Input);

This could be moved down along with the initialization of the result variable. And it could to do the ToOperand, instead of having it done on each use.
Attachment #8527826 - Flags: review?(sunfish) → review+
Assignee

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/6d64e1e46eb1

(In reply to Dan Gohman [:sunfish] from comment #1)
> This could be moved down along with the initialization of the result
> variable. And it could to do the ToOperand, instead of having it done on
> each use.

Done.
https://hg.mozilla.org/mozilla-central/rev/6d64e1e46eb1
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.