This seems like a nice cleanup even if it doesn't make a noticeable
performance difference.


http://codereview.chromium.org/42565/diff/1/2
File src/jump-target.cc (right):

http://codereview.chromium.org/42565/diff/1/2#newcode275
Line 275: // Set the register counts and indices.
Update this comment to go with the code.

http://codereview.chromium.org/42565/diff/1/8
File src/register-allocator.cc (right):

http://codereview.chromium.org/42565/diff/1/8#newcode110
Line 110: if (count(target) == (cgen_->frame()->is_used(target) ? 1 :
0))  {
Don't you want something more like

cgen_->frame()->is_used(target) && count(target) == 1

It seems a lot clearer, since you've already taken care of the case
!is_used(target) (and you wouldn't want to call spill on the frame if
the register isn't used there anyway).

http://codereview.chromium.org/42565/diff/1/6
File src/virtual-frame-arm.h (right):

http://codereview.chromium.org/42565/diff/1/6#newcode80
Line 80: return frame_registers_.count(reg);
You should remove this function and the RegisterFile from the ARM frame
class.

http://codereview.chromium.org/42565/diff/1/5
File src/virtual-frame.cc (right):

http://codereview.chromium.org/42565/diff/1/5#newcode196
Line 196: } else if (cgen_->allocator()->count(i) == 0) {
The only call site of this function has already searched for unused
registers, so we don't need to repeat that work here.  I think you
should be able to skip the else if and break out of the loop as soon as
you find a register to spill.

http://codereview.chromium.org/42565/diff/1/5#newcode387
Line 387: if (!is_used(value->reg())) {
I like to flip these ifs with elses so the condition is not negated.

http://codereview.chromium.org/42565/diff/1/5#newcode487
Line 487: new_element = CopyElementAt(register_index(reg));
You could consider just adding the copy to elements_ (and the register
in the other branch of the if) rather than assigning to a local and
adding later.

http://codereview.chromium.org/42565

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to