Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Issue 3446024: Custom call IC for Math.abs. (Closed)

Created:
10 years, 3 months ago by Vitaly Repeshko
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Custom call IC for Math.abs. Committed: http://code.google.com/p/v8/source/detail?r=5538

Patch Set 1 #

Total comments: 2

Patch Set 2 : Test added #

Total comments: 1

Patch Set 3 : No SSE. Ported to ARM and x64. #

Total comments: 10

Patch Set 4 : Review fixes #

Total comments: 1

Patch Set 5 : More review fixes. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+408 lines, -49 lines) Patch
M src/arm/stub-cache-arm.cc View 3 4 1 chunk +102 lines, -0 lines 1 comment Download
M src/ia32/stub-cache-ia32.cc View 1 2 1 chunk +103 lines, -0 lines 2 comments Download
M src/stub-cache.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +103 lines, -0 lines 2 comments Download
D test/mjsunit/abs.js View 1 chunk +0 lines, -48 lines 0 comments Download
A test/mjsunit/math-abs.js View 2 3 4 1 chunk +98 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Vitaly Repeshko
10 years, 3 months ago (2010-09-24 15:30:51 UTC) #1
antonm
LGTM, but do we have enough test coverage? test/mjsunit/abs.js is somewhat small, for example it ...
10 years, 3 months ago (2010-09-24 15:55:59 UTC) #2
antonm
Still LGTM when ported or stubbed for other platforms. http://codereview.chromium.org/3446024/diff/6001/7005 File test/mjsunit/math-abs.js (right): http://codereview.chromium.org/3446024/diff/6001/7005#newcode28 test/mjsunit/math-abs.js:28: ...
10 years, 3 months ago (2010-09-24 16:09:41 UTC) #3
Vitaly Repeshko
[+Rico] I dropped the SSE stuff, because it was not really needed. The patch is ...
10 years, 2 months ago (2010-09-27 11:52:54 UTC) #4
Rico
LGTM http://codereview.chromium.org/3446024/diff/11001/12002 File src/ia32/stub-cache-ia32.cc (right): http://codereview.chromium.org/3446024/diff/11001/12002#newcode2016 src/ia32/stub-cache-ia32.cc:2016: __ mov(ebx, FieldOperand(eax, HeapNumber::kExponentOffset)); You could potentially use ...
10 years, 2 months ago (2010-09-27 13:18:23 UTC) #5
Rodolph Perfetta
http://codereview.chromium.org/3446024/diff/11001/12001 File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/3446024/diff/11001/12001#newcode1699 src/arm/stub-cache-arm.cc:1699: __ sub(r0, r0, r1); Did you mean sub(r0, r0, ...
10 years, 2 months ago (2010-09-27 14:17:23 UTC) #6
Vitaly Repeshko
Rico, thanks for the review! Rodolph, thanks for the additional comments! Could you please take ...
10 years, 2 months ago (2010-09-27 14:56:59 UTC) #7
Rodolph Perfetta
On 2010/09/27 14:56:59, Vitaly wrote: > http://codereview.chromium.org/3446024/diff/11001/12001#newcode1699 > src/arm/stub-cache-arm.cc:1699: __ sub(r0, r0, r1); > On ...
10 years, 2 months ago (2010-09-27 17:32:15 UTC) #8
Rodolph Perfetta
http://codereview.chromium.org/3446024/diff/12011/10003 File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/3446024/diff/12011/10003#newcode1718 src/arm/stub-cache-arm.cc:1718: __ b(nz, &negative_sign); I know this is a nit ...
10 years, 2 months ago (2010-09-27 17:33:49 UTC) #9
Vitaly Repeshko
Rodolph, Thanks very much for these explanations! I switched to using ne condition code and ...
10 years, 2 months ago (2010-09-27 22:44:00 UTC) #10
antonm
10 years, 2 months ago (2010-09-28 12:04:17 UTC) #11
http://codereview.chromium.org/3446024/diff/22001/23001
File src/arm/stub-cache-arm.cc (right):

http://codereview.chromium.org/3446024/diff/22001/23001#newcode1671
src/arm/stub-cache-arm.cc:1671: STATIC_ASSERT(kSmiTag == 0);
BranchOnSmi(r1, miss)?

http://codereview.chromium.org/3446024/diff/22001/23002
File src/ia32/stub-cache-ia32.cc (right):

http://codereview.chromium.org/3446024/diff/22001/23002#newcode1970
src/ia32/stub-cache-ia32.cc:1970: __ mov(edx, Operand(esp, 2 * kPointerSize));
should you load receiver into edx?  Maybe check for its smi-ness with an
operand?  You apparently don't need receiver anymore.

http://codereview.chromium.org/3446024/diff/22001/23002#newcode2010
src/ia32/stub-cache-ia32.cc:2010: __ ret(2 * kPointerSize);
Maybe unify this and ARM ret: in ARM code you use argc while here you doesn't.

http://codereview.chromium.org/3446024/diff/22001/23004
File src/x64/stub-cache-x64.cc (right):

http://codereview.chromium.org/3446024/diff/22001/23004#newcode1585
src/x64/stub-cache-x64.cc:1585: 
nit: maybe drop blank lines here, we imho don't add to readability

http://codereview.chromium.org/3446024/diff/22001/23004#newcode1603
src/x64/stub-cache-x64.cc:1603: __ SmiToInteger32(rax, rax);
do we need this tagging/untagging?  Looks like MSB of Smi still gives you the
sign and you can proceed exactly like in ia32 case?  (probably adding some
asserts/extending number of tests).

I won't be surprised if it'd be notably faster for fastest case.

Powered by Google App Engine
This is Rietveld 408576698