Closed
Bug 512652
Opened 16 years ago
Closed 16 years ago
TM: refactor Assembler::evict()
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
12.10 KB,
patch
|
rreitmai
:
review+
|
Details | Diff | Splinter Review |
This patch does some refactoring of Assembler::evict(). The process was:
- evict() contained a call to registerAlloc(rmask(r)). So I cloned
registerAlloc() and then specialised the clone for the case where the
argument is a single register.
- I did likewise for findVictim() within the clone, and inlined the
result.
- I then inlined the cloned registerAlloc() within evict(), the only place that
called it, and did some more local optimisations and rearrangements.
- I then split evict() into maybeEvict() and evict().
The end result is that less code is run because it's specialised for
evicting a single register. Also, even though there's slightly more source
code I think it's easier to understand because there's less indirection and
layers of function calls involved.
Attachment #396684 -
Flags: review?(edwsmith)
Comment 1•16 years ago
|
||
Comment on attachment 396684 [details] [diff] [review]
patch
looks ok to me but adding Rick for a second set of eyes.
Attachment #396684 -
Flags: review?(rreitmai)
Attachment #396684 -
Flags: review?(edwsmith)
Attachment #396684 -
Flags: review+
![]() |
Assignee | |
Comment 2•16 years ago
|
||
This just tweaks the ordering in evict() -- the previous patch caused the debug output to be slightly wrong, because when printing the state that precedes the eviction instruction the evicted register was still shown as live.
Attachment #396684 -
Attachment is obsolete: true
Attachment #397140 -
Flags: review?(rreitmai)
Attachment #396684 -
Flags: review?(rreitmai)
Comment 3•16 years ago
|
||
Comment on attachment 397140 [details] [diff] [review]
revised patch
Interesting that the semantics of maybeEvict() lead to the 'used' bit being set in the case of register being free?!?
We should probably add 'NanoAssert(_allocator.getActive(r));' in this case, as I'm guessing that we'd have a bug if this was not true.
Or possibly the register is used as a temp and it will be free'd shortly.
Attachment #397140 -
Flags: review?(rreitmai) → review+
![]() |
Assignee | |
Comment 4•16 years ago
|
||
(In reply to comment #3)
> (From update of attachment 397140 [details] [diff] [review])
> Interesting that the semantics of maybeEvict() lead to the 'used' bit being set
> in the case of register being free?!?
Don't blame me, I preserved the meaning of what was there :) Having said that, whether the 'used' field is correct is unclear but it is scheduled for removal anyway, see bug 512398.
> We should probably add 'NanoAssert(_allocator.getActive(r));' in this case, as
> I'm guessing that we'd have a bug if this was not true.
By "this case" you mean the "then" branch of the if-then-else in maybeEvict()? If so, definitely not -- if a register is free it cannot be active. I think 'used' is misleading, probably wrong, and best ignored!
![]() |
Assignee | |
Comment 5•16 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 6•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 7•16 years ago
|
||
status1.9.2:
--- → beta1-fixed
Flags: wanted1.9.2+
You need to log in
before you can comment on or make changes to this bug.
Description
•