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

Issue 115744: This patch much improves our tracking of whether function is... (Closed)

Created:
11 years, 7 months ago by Erik Corry
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

This patch much improves our tracking of whether function is called from within a loop or not. In the past we lost the information if a call site went megamorphic before a lazily compiled callee was called for the first time. Now we track that correctly (this is an issue that affects richards). We still don't manage to track the in-loop state through a constructor call, since constructor calls use LoadICs instead of CallICs. This issue affects delta-blue. So in this patch we assume that lazy compilations that don't happen through a CallIC happen from inside a loop. I have an idea to fix this but this patch is big enough already. With our improved tracking of in-loop state I have switched off the inlining of in-object loads for code that is not in a loop. This benefits compile speed. One issue is that eagerly compiled code now doesn't get the in-object loads inlined. We need to eagerly compile less code to fix this. Committed: http://code.google.com/p/v8/source/detail?r=2046

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+244 lines, -139 lines) Patch
M src/arm/codegen-arm.h View 2 chunks +3 lines, -2 lines 0 comments Download
M src/arm/codegen-arm.cc View 7 chunks +14 lines, -6 lines 1 comment Download
M src/arm/ic-arm.cc View 3 chunks +3 lines, -3 lines 2 comments Download
M src/arm/stub-cache-arm.cc View 4 chunks +9 lines, -5 lines 3 comments Download
M src/builtins.cc View 1 chunk +6 lines, -6 lines 0 comments Download
M src/code-stubs.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/code-stubs.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/codegen.cc View 2 chunks +15 lines, -12 lines 1 comment Download
M src/globals.h View 2 chunks +6 lines, -2 lines 0 comments Download
M src/ia32/codegen-ia32.h View 2 chunks +1 line, -3 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 6 chunks +19 lines, -9 lines 0 comments Download
M src/ia32/ic-ia32.cc View 3 chunks +7 lines, -3 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 4 chunks +7 lines, -5 lines 2 comments Download
M src/ia32/virtual-frame-ia32.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M src/ic.h View 1 chunk +2 lines, -1 line 1 comment Download
M src/ic.cc View 8 chunks +35 lines, -18 lines 2 comments Download
M src/objects.h View 3 chunks +20 lines, -13 lines 0 comments Download
M src/objects.cc View 1 chunk +0 lines, -1 line 0 comments Download
M src/objects-inl.h View 5 chunks +16 lines, -1 line 1 comment Download
M src/runtime.cc View 1 chunk +8 lines, -2 lines 0 comments Download
M src/stub-cache.h View 5 chunks +25 lines, -11 lines 0 comments Download
M src/stub-cache.cc View 16 chunks +41 lines, -32 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
11 years, 7 months ago (2009-05-23 19:13:28 UTC) #1
Kasper Lund
LGTM, but maybe Kevin should take a look too? http://codereview.chromium.org/115744/diff/1/17 File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/115744/diff/1/17#newcode66 Line ...
11 years, 7 months ago (2009-05-25 09:45:42 UTC) #2
Kevin Millikin (Chromium)
11 years, 7 months ago (2009-05-25 11:00:42 UTC) #3
LGTM with some comments.

http://codereview.chromium.org/115744/diff/1/19
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/115744/diff/1/19#newcode1060
Line 1060: CallFunctionStub(int argc, InlineCacheInLoop in_loop)
I like a name that indicates flaggishness.  InLoopFlag?

http://codereview.chromium.org/115744/diff/1/18
File src/arm/ic-arm.cc (right):

http://codereview.chromium.org/115744/diff/1/18#newcode425
Line 425: Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, NOT_IN_LOOP,
MONOMORPHIC);
Long line?

http://codereview.chromium.org/115744/diff/1/18#newcode758
Line 758: Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, NOT_IN_LOOP,
MONOMORPHIC);
Long line?

http://codereview.chromium.org/115744/diff/1/17
File src/arm/stub-cache-arm.cc (right):

http://codereview.chromium.org/115744/diff/1/17#newcode500
Line 500: Code::Flags flags) {
Since you've generalized the call site to take flags, you might want to assert
here that the passed flags has type FIELD.

http://codereview.chromium.org/115744/diff/1/17#newcode552
Line 552: Code::Flags flags) {
Same as above with type CONSTANT_FUNCTION.

http://codereview.chromium.org/115744/diff/1/13
File src/codegen.cc (right):

http://codereview.chromium.org/115744/diff/1/13#newcode330
Line 330: if (in_loop) {
My opinion is mixed about making these two value, on/off flags  into enums (for
readability at the call site).

But since you didn't make it a bool, please write:

if (in_loop == IN_LOOP) ...

http://codereview.chromium.org/115744/diff/1/5
File src/ia32/stub-cache-ia32.cc (right):

http://codereview.chromium.org/115744/diff/1/5#newcode474
Line 474: Code::Flags flags) {
Same comment about ASSERT as in the ARM file.

http://codereview.chromium.org/115744/diff/1/5#newcode523
Line 523: Code::Flags flags) {
And here.

http://codereview.chromium.org/115744/diff/1/8
File src/ic.cc (right):

http://codereview.chromium.org/115744/diff/1/8#newcode451
Line 451: state == PREMONOMORPHIC || state == MONOMORPHIC ||
One disjunct per line?

http://codereview.chromium.org/115744/diff/1/8#newcode1111
Line 1111: if (in_loop) {
if (in_loop == IN_LOOP) ....

http://codereview.chromium.org/115744/diff/1/16
File src/objects-inl.h (right):

http://codereview.chromium.org/115744/diff/1/16#newcode1957
Line 1957: if (in_loop) bits |= kFlagsICInLoopMask;
if (in_loop == IN_LOOP) ...

Powered by Google App Engine
This is Rietveld 408576698