Closed
Bug 463531
Opened 17 years ago
Closed 14 years ago
Need loop header instruction for hoisting
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
RESOLVED
WONTFIX
mozilla1.9.1
People
(Reporter: robarnold, Assigned: gal)
References
Details
Attachments
(3 files, 4 obsolete files)
|
52.05 KB,
application/octet-stream
|
Details | |
|
6.14 KB,
patch
|
robarnold
:
review+
|
Details | Diff | Splinter Review |
|
9.66 KB,
patch
|
Details | Diff | Splinter Review |
For future optimizations, it would be nice and efficient to perform or hoist some computations outside of the traced loop. We should generate a LIR_header instruction to mark the beginning of the loop.
| Assignee | ||
Comment 1•17 years ago
|
||
Assignee: general → gal
| Assignee | ||
Comment 2•17 years ago
|
||
Attachment #346788 -
Attachment is obsolete: true
Attachment #346790 -
Flags: review?(danderson)
| Reporter | ||
Updated•17 years ago
|
Attachment #346790 -
Attachment is patch: true
Attachment #346790 -
Attachment mime type: application/octet-stream → text/plain
Updated•17 years ago
|
Attachment #346790 -
Flags: review?(danderson) → review+
| Reporter | ||
Comment 3•17 years ago
|
||
This doesn't seem to affect the native code generated.
| Assignee | ||
Comment 4•17 years ago
|
||
Its not supposed to, except that instructions emitted between LIR_header and LIR_start will be above the loop header (which is LIR_header).
| Reporter | ||
Comment 5•17 years ago
|
||
When I hoist state above LIR_header, I get crashes on the 2nd iteration because it doesn't get properly unspilled on the loop edge.
| Assignee | ||
Comment 6•17 years ago
|
||
Can you attach a short patch that emits code in between the way you want it emitted? I will debug it a bit.
| Reporter | ||
Comment 7•17 years ago
|
||
Here's the bundle of my repo
Comment 8•17 years ago
|
||
should we introduce a new LIR structure, similar to VMSideExit, for labels? if each label could have its own structure, then they could be distinguished, and we might not need special LIR_header instruction?
on the other hand if we have the opcodes, checking ins->opcode() can be easier than peeking into some struct. depends on how/where it's used.
| Reporter | ||
Comment 9•17 years ago
|
||
Any progress on this Andreas?
Updated•17 years ago
|
Severity: normal → enhancement
| Assignee | ||
Comment 10•17 years ago
|
||
Attachment #346790 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•17 years ago
|
||
Attachment #349316 -
Attachment is obsolete: true
Attachment #349318 -
Flags: review?(tellrob)
| Reporter | ||
Updated•17 years ago
|
Attachment #349318 -
Flags: review?(tellrob) → review+
The problem with the previous patch is that (aside from LIR_header actually doing the same thing as LIR_start), is that stack slots can be re-used across the loop and hoisted spills get clobbered.
A _really, really_ hacky fix for this was to look for live spills at the loop header, and if they've been used more than once, to reserve pinned stack space.
If there was an easy way to tell whether an LIns* was between LIR_start and LIR_header then this wouldn't be necessary. Possibly something like TM's tracker would work.
There is still a problem in that you can't use these hoisted instructions on branch traces. We'd need either tree recompilation or some structure capable of recovering or caching the stack slots. In fact, right now, the mere presence of a branch trace might be able to clobber these pinned stack slots, though trace-tests does not trigger this.
The junk added in jstracer.cpp is a silly test case.
Whoops, attached was an interdiff - here's a full patch.
Attachment #350890 -
Attachment is obsolete: true
Comment 14•17 years ago
|
||
Don't know the status of this but LIR_header and LIR_label seem pretty similar; what are the important differences?
Comment 15•16 years ago
|
||
These bugs are all part of a search I made for js bugs that are getting lost in transit:
http://tinyurl.com/jsDeadEndBugs
They all have a review+'ed, non-obsoleted patch and are not marked fixed-in-tracemonkey or checkin-needed but have not seen any activity in 300 days. Some of these got lost simply because the assignee/patch provider never requested a checkin, or just because they were forgotten about.
Comment 16•14 years ago
|
||
Edwin, is this still wanted for Nanojit?
Comment 17•14 years ago
|
||
nope, WONTFIX.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•