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

Issue 12084066: Only mark the descriptor that is valid for the map in question. If this map (Closed)

Created:
7 years, 10 months ago by Toon Verwaest
Modified:
7 years, 10 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Only mark the descriptor that is valid for the map in question. If this map transitioned from a map with a different descriptor array (or has no back pointer), mark all valid descriptors from the start. This fixes the following memory leak: Map A shares a descriptor array with map B. Map B adds constant function c that in its scope holds on to an instance of B. If the descriptor array of A would keep all the shared descriptors alive, including c, this keeps alive both A and c indefinitely. This CL also fixes a bug in descriptor array trimming. When trimming descriptor arrays we need to trim off the slack as well (thus the entire storage); and since we are trimming a descriptor array, we need to trim * kDescriptorSize. Committed: https://code.google.com/p/v8/source/detail?r=13566

Patch Set 1 #

Patch Set 2 : Only visit pointers of the diff between current and backpointer map. #

Patch Set 3 : Added comment and rewrote so marking is agnostic to sharing internals. #

Total comments: 4

Patch Set 4 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -3 lines) Patch
M src/objects.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M src/objects-inl.h View 1 chunk +10 lines, -0 lines 0 comments Download
M src/objects-visiting-inl.h View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Toon Verwaest
PTAL
7 years, 10 months ago (2013-01-30 15:10:03 UTC) #1
Michael Starzinger
LGTM. I like the second approach much better than the one in the first patch-set. ...
7 years, 10 months ago (2013-01-31 10:44:09 UTC) #2
Toon Verwaest
7 years, 10 months ago (2013-01-31 10:50:02 UTC) #3
Addressed comments.

https://chromiumcodereview.appspot.com/12084066/diff/7/src/objects-visiting-i...
File src/objects-visiting-inl.h (right):

https://chromiumcodereview.appspot.com/12084066/diff/7/src/objects-visiting-i...
src/objects-visiting-inl.h:401: // non-empty descriptor array is marked, its
header is also marked. The slot
On 2013/01/31 10:44:09, Michael Starzinger wrote:
> s/its header is also marked/its header is also visited/

Done.

https://chromiumcodereview.appspot.com/12084066/diff/7/src/objects-visiting-i...
src/objects-visiting-inl.h:408: descriptors->GetFirstElementAddress(),
On 2013/01/31 10:44:09, Michael Starzinger wrote:
> Indent by 4 instead of 2 characters.

Done.

Powered by Google App Engine
This is Rietveld 408576698