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

Issue 150226: Port %ClassOf() optimization to X64 and ARM. (Closed)

Created:
11 years, 5 months ago by Mads Ager (chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Port %ClassOf() optimization to X64 and ARM. Committed: http://code.google.com/p/v8/source/detail?r=2339

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -5 lines) Patch
M src/arm/codegen-arm.cc View 1 chunk +55 lines, -2 lines 7 comments Download
M src/x64/codegen-x64.cc View 1 1 chunk +59 lines, -3 lines 7 comments Download

Messages

Total messages: 5 (0 generated)
Mads Ager (chromium)
11 years, 5 months ago (2009-07-02 13:12:10 UTC) #1
Erik Corry
http://codereview.chromium.org/150226/diff/5/1006 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/150226/diff/5/1006#newcode3187 Line 3187: null.Branch(eq); Ideally I'd like to do this as ...
11 years, 5 months ago (2009-07-02 13:48:31 UTC) #2
Erik Corry
LGTM
11 years, 5 months ago (2009-07-02 13:50:54 UTC) #3
Mads Ager (chromium)
Thanks! http://codereview.chromium.org/150226/diff/5/1006 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/150226/diff/5/1006#newcode3193 Line 3193: __ cmp(r1, Operand(FIRST_JS_OBJECT_TYPE)); On 2009/07/02 13:48:31, Erik ...
11 years, 5 months ago (2009-07-02 14:14:08 UTC) #4
William Hesse
11 years, 5 months ago (2009-07-02 14:44:25 UTC) #5
http://codereview.chromium.org/150226/diff/5/1005
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/150226/diff/5/1005#newcode3378
Line 3378: __ testl(obj.reg(), Immediate(kSmiTagMask));
On 2009/07/02 14:14:08, Mads Ager wrote:
> On 2009/07/02 13:48:31, Erik Corry wrote:
> > Do we need an l here?  Will that preclude an 8 bit immediate being used?
> 
> I'm using testl for consistency with the rest of the code.  I believe the
> encoding for testl is shorter.
> 

testl does not preclude an 8-bit encoding of the immediate.  testb would work
just as well, but no better.  We just want to avoid the REX prefix in cases
where we don't need it.

http://codereview.chromium.org/150226/diff/5/1005#newcode3386
Line 3386: __ cmpb(tmp.reg(), Immediate(FIRST_JS_OBJECT_TYPE));
On 2009/07/02 14:14:08, Mads Ager wrote:
> On 2009/07/02 13:48:31, Erik Corry wrote:
> > CmpObjectType?
> 
> Can't on x64/ia32 because the map register is clobbered by CmpObjectType. 
Maybe
> we should add another argument to CmpObjectType as on ARM.

On x64 and ia32, the map register isn't clobbered by CmpObjectType anymore, so
CmpObjectType can be followed by a CmpInstanceType that uses the map register
found by it.

CmpObjectType(obj.reg(), FIRST_JS_OBJECT_TYPE, tmp_reg());
null.Branch(less);
CmpInstanceType(tmp.reg(), JS_FUNCTION_TYPE);
function.Branch(equal);

should work fine on both ia32 and x64.  On x64 one can also use
kScratchRegister.

http://codereview.chromium.org/150226/diff/5/1005#newcode3401
Line 3401: __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, tmp.reg());
kScratchRegister, rather than tmp, can be used here.

Powered by Google App Engine
This is Rietveld 408576698