Closed
Bug 915833
Opened 12 years ago
Closed 12 years ago
Use immediate absolute addresses on x64 when possible
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: sunfish, Assigned: sunfish)
Details
Attachments
(4 files)
|
55.12 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
2.72 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
1.09 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
|
36.19 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
On x64, code sequences like this are common:
[Codegen] movl $0x2e6c300, %r11d
[Codegen] cmpl $0x0, 0x0(%r11)
[Codegen] je ((1655))
Since 64-bit addresses can't fit into 32-bit immediate fields in general, codegen just always materializes them into a register. However, it's pretty common for these absolute addresses to actually reside within the virtual address space addressable by the 32-bit immediate value. When it does, such code can be written like this:
[Codegen] cmpq $0x0, 0x2e6c300
[Codegen] jae ((1655))
The following patch sequence implements this, and harmonizes the x86 and x64 backends somewhat.
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #803916 -
Flags: review?(sstangl)
| Assignee | ||
Comment 2•12 years ago
|
||
Attachment #803918 -
Flags: review?(sstangl)
| Assignee | ||
Comment 3•12 years ago
|
||
Attachment #803920 -
Flags: review?(sstangl)
| Assignee | ||
Comment 4•12 years ago
|
||
Attachment #803921 -
Flags: review?(sstangl)
Updated•12 years ago
|
Attachment #803918 -
Flags: review?(sstangl) → review+
Updated•12 years ago
|
Attachment #803920 -
Flags: review?(sstangl) → review+
Comment 5•12 years ago
|
||
Comment on attachment 803921 [details] [diff] [review]
operand-x64-immediate-address.patch
Review of attachment 803921 [details] [diff] [review]:
-----------------------------------------------------------------
Cool.
::: js/src/jit/x64/Assembler-x64.h
@@ +175,5 @@
> REG,
> MEM_REG_DISP,
> FPREG,
> + MEM_SCALE,
> + MEM_ADDRESS
Would MEM_ADDRESS32 be a better name?
Attachment #803921 -
Flags: review?(sstangl) → review+
Comment 6•12 years ago
|
||
Comment on attachment 803916 [details] [diff] [review]
operand-renames.patch
Review of attachment 803916 [details] [diff] [review]:
-----------------------------------------------------------------
Sounds fine, no strong opinion on naming either way.
Attachment #803916 -
Flags: review?(sstangl) → review+
| Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Sean Stangl [:sstangl] from comment #5)
> @@ +175,5 @@
> > REG,
> > MEM_REG_DISP,
> > FPREG,
> > + MEM_SCALE,
> > + MEM_ADDRESS
>
> Would MEM_ADDRESS32 be a better name?
Works for me.
https://hg.mozilla.org/integration/mozilla-inbound/rev/217c7cffc581
https://hg.mozilla.org/integration/mozilla-inbound/rev/3bc4938ad49a
https://hg.mozilla.org/integration/mozilla-inbound/rev/9fac05846d6e
https://hg.mozilla.org/integration/mozilla-inbound/rev/339c713fcaef
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/217c7cffc581
https://hg.mozilla.org/mozilla-central/rev/3bc4938ad49a
https://hg.mozilla.org/mozilla-central/rev/9fac05846d6e
https://hg.mozilla.org/mozilla-central/rev/339c713fcaef
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•