Added Kevin.

It seems to be a good idea to have a compact data structure for one-element
use-lists. Did you see any difference in compile-time?

Kevin and me were discussing representing uses not just as HValue*, but as a
pair (HValue*, operand_index) instead. This would allow us to simplify the code dealing with the case where one value is used multiple times in an instructions.
I think we can use your approach also if we represent uses as pairs in the
future (e.g. SmallPointerList<HUse> where HUse is a pair <HValue*, int>.

Otherwise this change LGTM.



http://codereview.chromium.org/6707001/diff/1/src/small-pointer-list.h
File src/small-pointer-list.h (right):

http://codereview.chromium.org/6707001/diff/1/src/small-pointer-list.h#newcode28
src/small-pointer-list.h:28: #ifndef V8_SMALL_POINTER_LIST_H_
You need to update the project files (gyp, visual studio, etc.) with the
new file.

http://codereview.chromium.org/6707001/diff/1/src/small-pointer-list.h#newcode89
src/small-pointer-list.h:89: if (pointer == single_value()) {
I rather like less nested if-statements:

if ((data_ & kTagMask) == kSingletonTag &&
    pointer == single_value()) {

http://codereview.chromium.org/6707001/diff/1/src/small-pointer-list.h#newcode125
src/small-pointer-list.h:125: if (start == 0 && start <= end) {
Maybe a matter of taste - I prefer

if (start == 0 && end >= 0) {

here.

http://codereview.chromium.org/6707001/

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

Reply via email to