Closed Bug 1104199 Opened 10 years ago Closed 10 years ago

Optimize LUnbox codegen on x64

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached 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+
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
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: