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

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed)

Created:
8 years, 4 months ago by danno
Modified:
8 years, 1 month ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Add code again to allow reclaiming old unexecuted functions. When code objects in the heap for FUNCTIONs and OPTIMIZED_FUNCTIONs are marked by the GC, their prologue is patched with a call to a stub that removes the patch. This allows the collector to quickly identify code objects that haven't been executed since the last full collection (they are the ones that sill contain the patch). The functionality is currently disabled, but can be activated by specifying the "--age-code". R=mstarzinger@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=12898

Patch Set 1 #

Patch Set 2 : Implement code aging fully on ia32 #

Patch Set 3 : Remove whitespace-only changes #

Patch Set 4 : Finalize ia32 implementation #

Patch Set 5 : Cleanup code #

Total comments: 32

Patch Set 6 : Review feedback #

Total comments: 4

Patch Set 7 : Merge with tip of free #

Patch Set 8 : Fix x64 support #

Patch Set 9 : Finish ARM implementation #

Patch Set 10 : Add runtime flag #

Patch Set 11 : Nits #

Total comments: 6

Patch Set 12 : Review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+814 lines, -32 lines) Patch
M src/arm/assembler-arm-inl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +22 lines, -0 lines 0 comments Download
M src/arm/builtins-arm.cc View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 3 4 5 6 7 8 1 chunk +86 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -6 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M src/assembler.h View 1 2 3 4 5 6 6 chunks +23 lines, -1 line 0 comments Download
M src/assembler.cc View 1 2 3 4 5 6 7 chunks +29 lines, -0 lines 0 comments Download
M src/builtins.h View 1 2 3 3 chunks +29 lines, -2 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M src/debug.cc View 1 2 3 4 5 6 1 chunk +6 lines, -2 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/assembler-ia32-inl.h View 1 2 3 4 5 6 7 5 chunks +30 lines, -2 lines 0 comments Download
M src/ia32/builtins-ia32.cc View 1 2 3 4 5 6 7 8 1 chunk +36 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 4 5 6 7 8 1 chunk +97 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -0 lines 0 comments Download
M src/liveedit.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M src/mark-compact.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M src/mark-compact.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +18 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +48 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +103 lines, -0 lines 0 comments Download
M src/objects-visiting.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-visiting-inl.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +37 lines, -16 lines 0 comments Download
M src/serialize.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M src/x64/assembler-x64.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M src/x64/assembler-x64-inl.h View 1 2 3 4 5 6 7 5 chunks +28 lines, -0 lines 0 comments Download
M src/x64/builtins-x64.cc View 1 2 3 4 5 6 7 8 1 chunk +40 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 3 4 5 6 7 8 1 chunk +85 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
danno
Platform ports are not done, but can you please take a first rough look?
8 years, 3 months ago (2012-09-20 16:00:27 UTC) #1
Michael Starzinger
First round of comments. https://codereview.chromium.org/10837037/diff/18002/src/compiler.cc File src/compiler.cc (right): https://codereview.chromium.org/10837037/diff/18002/src/compiler.cc#newcode612 src/compiler.cc:612: result->code()->MakeYoung(); I think we also ...
8 years, 3 months ago (2012-09-21 09:43:19 UTC) #2
Michael Starzinger
Second round with some follow-up comments, now that I am working on the incremental code ...
8 years, 2 months ago (2012-10-02 14:58:59 UTC) #3
danno
Please take another look, I think this is ready to go on ia32, x64 and ...
8 years, 1 month ago (2012-10-25 10:07:23 UTC) #4
Michael Starzinger
LGTM (with a final round of comments). The most important one is the one about ...
8 years, 1 month ago (2012-11-02 15:29:34 UTC) #5
danno
8 years, 1 month ago (2012-11-09 13:05:30 UTC) #6
Feedback addressed, landed.

https://codereview.chromium.org/10837037/diff/40001/src/mark-compact.cc
File src/mark-compact.cc (right):

https://codereview.chromium.org/10837037/diff/40001/src/mark-compact.cc#newco...
src/mark-compact.cc:2360: rinfo->set_code_age_stub(Code::cast(stub));
On 2012/11/02 15:29:34, Michael Starzinger wrote:
> Can we use the "if (target != old_target)" pattern here as well? Thereby we
> avoid flushing the instruction cache when the stub doesn't actually change.

Done.

https://codereview.chromium.org/10837037/diff/40001/src/objects-visiting-inl.h
File src/objects-visiting-inl.h (right):

https://codereview.chromium.org/10837037/diff/40001/src/objects-visiting-inl....
src/objects-visiting-inl.h:291: if (FLAG_age_code && !Serializer::enabled()) {
On 2012/11/02 15:29:34, Michael Starzinger wrote:
> Technically it shouldn't make any difference in this case, but I would sleep
> better if we could do the mutation before we scan the code body. Can we move
> this block to before we call CodeIterateBody() here?

Done.

https://codereview.chromium.org/10837037/diff/40001/src/objects-visiting-inl....
src/objects-visiting-inl.h:480: return function->code()->IsOld() &&
IsFlushable(heap, shared_info);
On 2012/11/02 15:29:34, Michael Starzinger wrote:
> We cannot yet flush optimized code because they are not recorded as
candidates.
> I will be working on that next. For now we need to leave in the original check
> in place.
> 
> Also, can we do the age-check as a separate step behind the FLAG_age_code flag
> and in the end always call through to IsFlushable() for the shared function? I
> think that's easier to read.
> 
> // Check age of optimized code.
> if (FLAG_age_code && !function->code()->IsOld()) {
>   return false;
> }
> 
> return IsFlushable(heap, shared_info);

Done.

Powered by Google App Engine
This is Rietveld 408576698