Lasse,

major rework, but now covered by tests. If you have any other ideas what else I
should test, they'd be most appreciated.


http://codereview.chromium.org/1695007/diff/1/2
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/1695007/diff/1/2#newcode6625
src/ia32/codegen-ia32.cc:6625: __ add(FieldOperand(ecx,
kCacheSizeOffset), Immediate(2 << 1));
On 2010/04/29 08:53:55, Lasse Reichstein wrote:
It's not lea that is faster (it just saves one instruction over a move
and and
add), but avoiding the read entirely.
Reads are the worst-case of memory access. If they fail the L1 cache,
they can
be very expensive (not likely here, since we loaded the value recently
anyway),
and the following operations typically delay for the value to load
(especially
in a read-modify-write operation like add to memory).

Yes, that's precisely for I think it's already in the cache being read
just an instruction before that I used direct add.

http://codereview.chromium.org/1695007/diff/1003/9003
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/1695007/diff/1003/9003#newcode4294
src/x64/codegen-x64.cc:4294: STATIC_ASSERT(kSmiTagSize == 1);
On 2010/04/29 08:53:55, Lasse Reichstein wrote:
Remove asserts (comment is no longer true).

I assume that Smi are twice bigger than ints in ln. 4367-69.  That's
probably a bad idea, fixing.

http://codereview.chromium.org/1695007/diff/1003/9003#newcode4301
src/x64/codegen-x64.cc:4301: __ SmiSubConstant(dst_, dst_,
kEntrySizeSmi);
On 2010/04/29 08:53:55, Lasse Reichstein wrote:
Consider converting the smi to a 32-bit integer and do computations on
that.
With the current encoding, Smi constants are loaded as 64-bit
constants in a
separate instruction, so there is an overhead to save.

Thanks a lot, nice idea, code reworked.

http://codereview.chromium.org/1695007/diff/1003/9003#newcode4319
src/x64/codegen-x64.cc:4319: // Consider prefetching into some reg.
On 2010/04/29 08:53:55, Lasse Reichstein wrote:
Don't just consider it. Do it, and convert it to integer from smi so
your
loop-variable doesn't have to be a smi.
You should have plenty of registers to work with on X64.

Done.

http://codereview.chromium.org/1695007/show

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

Reply via email to