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

Issue 573003: ia32: Fuse map and type checks in call ICs for API functions. (Closed)

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

Description

ia32: Fuse map and type checks in call ICs for API functions. This uses the fact that if a map stayed the same then the object still passes the type check. A new builtin is added to handle the API call in this case. Committed: http://code.google.com/p/v8/source/detail?r=3825

Patch Set 1 #

Patch Set 2 : Stubs for arm and x64. #

Total comments: 33

Patch Set 3 : Review fixes + tests. #

Patch Set 4 : Review fixes + tests. (Removed benchmarking code.) #

Patch Set 5 : Rewrote a comment. #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+819 lines, -143 lines) Patch
M src/arm/stub-cache-arm.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/builtins.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/builtins.cc View 1 2 1 chunk +70 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 5 chunks +11 lines, -3 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 3 4 7 chunks +385 lines, -75 lines 2 comments Download
M src/macro-assembler.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/stub-cache.h View 1 chunk +11 lines, -0 lines 2 comments Download
M src/top.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/top.cc View 1 chunk +6 lines, -1 line 0 comments Download
M src/v8-counters.h View 1 2 1 chunk +67 lines, -63 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 chunk +251 lines, -0 lines 8 comments Download

Messages

Total messages: 7 (0 generated)
Vitaly Repeshko
Mads, Anton, This is only for ia32 for now. I'll file a bug for other ...
10 years, 10 months ago (2010-02-04 08:21:13 UTC) #1
Mads Ager (chromium)
This stuff is getting hairy. :) In particular, I'm uncertain about the GC safety of ...
10 years, 10 months ago (2010-02-04 09:52:01 UTC) #2
antonm
overall comment: could you through in more tests for the cases you added? http://codereview.chromium.org/573003/diff/1009/15 File ...
10 years, 10 months ago (2010-02-04 11:49:51 UTC) #3
Vitaly Repeshko
All issues address. Tests added. Please take another look. Thanks, Vitaly http://codereview.chromium.org/573003/diff/1009/11 File src/builtins.cc (right): ...
10 years, 10 months ago (2010-02-05 18:48:36 UTC) #4
Mads Ager (chromium)
LGTM http://codereview.chromium.org/573003/diff/5002/8008 File src/stub-cache.h (right): http://codereview.chromium.org/573003/diff/5002/8008#newcode394 src/stub-cache.h:394: Register CheckPrototypes(JSObject* object, Add vertical space between the ...
10 years, 10 months ago (2010-02-08 08:56:58 UTC) #5
antonm
lgtm http://codereview.chromium.org/573003/diff/5002/8006 File src/ia32/stub-cache-ia32.cc (right): http://codereview.chromium.org/573003/diff/5002/8006#newcode803 src/ia32/stub-cache-ia32.cc:803: __ bind(&miss); feel free to ignore, but in ...
10 years, 10 months ago (2010-02-08 12:07:38 UTC) #6
Vitaly Repeshko
10 years, 10 months ago (2010-02-09 16:15:24 UTC) #7
Thanks for review! Submitted.


-- Vitaly

http://codereview.chromium.org/573003/diff/5002/8006
File src/ia32/stub-cache-ia32.cc (right):

http://codereview.chromium.org/573003/diff/5002/8006#newcode803
src/ia32/stub-cache-ia32.cc:803: __ bind(&miss);
On 2010/02/08 12:07:38, antonm wrote:
> feel free to ignore, but in case when !can_do_fast_api_call this adds
> unnecessary jump instruction---instead of branching to miss, we could
> immediately branch to miss_label.  Apparently relatively easy to fix, but up
to
> you.

Done.

http://codereview.chromium.org/573003/diff/5002/8008
File src/stub-cache.h (right):

http://codereview.chromium.org/573003/diff/5002/8008#newcode394
src/stub-cache.h:394: Register CheckPrototypes(JSObject* object,
On 2010/02/08 08:56:58, Mads Ager wrote:
> Add vertical space between the function declarations?

Done.

http://codereview.chromium.org/573003/diff/5002/8013
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/573003/diff/5002/8013#newcode5796
test/cctest/test-api.cc:5796: static v8::Handle<Value>
InterceptorCallICFastApi(Local<String> name,
On 2010/02/08 12:07:38, antonm wrote:
> I know that's boring, but apparently you didn't cover some cases like
> invalidation due to overriding in interceptor's holder-cached const function's
> holder chain.

Thanks, added a test. Yeah, it's boring...

http://codereview.chromium.org/573003/diff/5002/8013#newcode5851
test/cctest/test-api.cc:5851: GenerateSomeGarbage();
On 2010/02/08 08:56:58, Mads Ager wrote:
> Could you document why you generate some extra garbage in all of these tests?

Done.

http://codereview.chromium.org/573003/diff/5002/8013#newcode5855
test/cctest/test-api.cc:5855: "for (var i = 0; i < 1000; i++) {"
On 2010/02/08 08:56:58, Mads Ager wrote:
> I think we use 1000 in other places as well, but do we need that many
> iterations?  It is nice to have the tests run as fast as possible and still
> cover all the cases.

Sure we don't need that many. Reduced iterations by a factor of 10.

http://codereview.chromium.org/573003/diff/5002/8013#newcode5858
test/cctest/test-api.cc:5858: CHECK_EQ(42,
context->Global()->Get(v8_str("result"))->Int32Value());
On 2010/02/08 12:07:38, antonm wrote:
> if you add result as a last line of script, you could use value here, might be
> more convenient

Yup, but I prefer a slightly more uniform way here.

Powered by Google App Engine
This is Rietveld 408576698