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

Issue 11575007: Make embedded maps in optimized code weak. (Closed)

Created:
8 years ago by ulan
Modified:
7 years, 11 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Make embedded maps in optimized code weak. Each map has a weak array of dependent codes, where the map tracks all the optimized codes that embed it. Old space GC either clears the dead dependent codes from the array if the corresponding map is alive or deoptimizes the live dependent codes if the map is dead. BUG=v8:2073 R=mstarzinger@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=13490

Patch Set 1 : #

Total comments: 7

Patch Set 2 : Derive DependentCodes from FixedArray. #

Patch Set 3 : Fix skipping of maps in visitors. #

Total comments: 14

Patch Set 4 : Add test that reproduces memleak and rebase. #

Total comments: 9

Patch Set 5 : Address comments" #

Total comments: 14

Patch Set 6 : Address more comments #

Patch Set 7 : Cleanup #

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+333 lines, -29 lines) Patch
M src/heap.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -0 lines 0 comments Download
M src/lithium.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/lithium.cc View 1 2 3 2 chunks +19 lines, -0 lines 0 comments Download
M src/mark-compact.h View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M src/mark-compact.cc View 1 2 3 4 8 chunks +68 lines, -5 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 8 chunks +49 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 3 4 1 chunk +28 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 5 chunks +66 lines, -0 lines 0 comments Download
M src/objects-visiting-inl.h View 1 2 3 4 5 6 5 chunks +19 lines, -11 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
A + test/mjsunit/regress/regress-2073.js View 1 2 3 4 1 chunk +65 lines, -11 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
ulan
Please take a look. This depends on https://chromiumcodereview.appspot.com/11547015/ https://chromiumcodereview.appspot.com/11575007/diff/3003/src/objects.h File src/objects.h (right): https://chromiumcodereview.appspot.com/11575007/diff/3003/src/objects.h#newcode4729 src/objects.h:4729: class ...
8 years ago (2012-12-13 14:37:25 UTC) #1
Michael Starzinger
A first round of high-level comments. https://codereview.chromium.org/11575007/diff/3003/src/objects-visiting-inl.h File src/objects-visiting-inl.h (right): https://codereview.chromium.org/11575007/diff/3003/src/objects-visiting-inl.h#newcode655 src/objects-visiting-inl.h:655: // Treat embedded ...
8 years ago (2012-12-14 14:15:26 UTC) #2
ulan
Please take another look. https://chromiumcodereview.appspot.com/11575007/diff/3003/src/objects-visiting-inl.h File src/objects-visiting-inl.h (right): https://chromiumcodereview.appspot.com/11575007/diff/3003/src/objects-visiting-inl.h#newcode655 src/objects-visiting-inl.h:655: // Treat embedded maps in ...
7 years, 11 months ago (2013-01-17 09:35:10 UTC) #3
Michael Starzinger
Final round of reviews, after that we should be good to go. https://chromiumcodereview.appspot.com/11575007/diff/19001/src/objects-visiting-inl.h File src/objects-visiting-inl.h ...
7 years, 11 months ago (2013-01-21 10:31:48 UTC) #4
Michael Starzinger
One more comment. https://chromiumcodereview.appspot.com/11575007/diff/25001/src/lithium.cc File src/lithium.cc (right): https://chromiumcodereview.appspot.com/11575007/diff/25001/src/lithium.cc#newcode432 src/lithium.cc:432: RegisterDependentCodeForEmbeddedMaps(code); Let's move the call to ...
7 years, 11 months ago (2013-01-21 10:49:46 UTC) #5
ulan
Uploaded new patch set. https://chromiumcodereview.appspot.com/11575007/diff/19001/src/objects-visiting-inl.h File src/objects-visiting-inl.h (right): https://chromiumcodereview.appspot.com/11575007/diff/19001/src/objects-visiting-inl.h#newcode395 src/objects-visiting-inl.h:395: // stack, this will make ...
7 years, 11 months ago (2013-01-21 13:11:57 UTC) #6
Michael Starzinger
LGTM (with a few final comments). https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiting-inl.h File src/objects-visiting-inl.h (right): https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiting-inl.h#newcode178 src/objects-visiting-inl.h:178: if (rinfo->host()->kind() != ...
7 years, 11 months ago (2013-01-21 14:36:44 UTC) #7
ulan
7 years, 11 months ago (2013-01-21 15:56:02 UTC) #8
Thank you for the feedback! I uploaded new patch set.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiti...
File src/objects-visiting-inl.h (right):

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiti...
src/objects-visiting-inl.h:178: if (rinfo->host()->kind() !=
Code::OPTIMIZED_FUNCTION ||
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> This should be behind the FLAG_collect_maps flag I guess, because we only
force
> deoptimization with this flag.

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiti...
src/objects-visiting-inl.h:649: // There are two places where we iterate code
bodies: here and the non-
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> s/non-templated/templated/

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiti...
src/objects-visiting-inl.h:650: // templated CodeIterateBody (above). They
should be kept in sync.
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> s/above/below/

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects-visiti...
src/objects-visiting-inl.h:663: template<typename StaticVisitor,
Code::EmbeddedMapVisitMode map_visit_mode>
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> We should no longer need the template parameter.

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects.h
File src/objects.h (right):

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects.h#newc...
src/objects.h:4521: enum EmbeddedMapVisitMode { VISIT_EMBEDDED_MAPS,
SKIP_EMBEDDED_MAPS };
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> We should no longer need this enum or the template parameter below.

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects.h#newc...
src/objects.h:4620: STATIC_ASSERT(kMarkedForDeoptimizationBitCount +
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> This should be "kMarkedForDeoptimizationFirstBit" here.

Done.

https://chromiumcodereview.appspot.com/11575007/diff/32001/src/objects.h#newc...
src/objects.h:4684: // Smi(0) if the number of codes is less than the length of
the array.
On 2013/01/21 14:36:44, Michael Starzinger wrote:
> Comment no longer applies, it's undefined instead of Smi(0) now.

Done.

Powered by Google App Engine
This is Rietveld 408576698