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

Issue 8898034: - Implement the old sweeper. (Closed)

Created:
9 years ago by Ivan Posva
Modified:
9 years ago
Reviewers:
cshapiro, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

- Implement the old sweeper. Committed: https://code.google.com/p/dart/source/detail?r=2485

Patch Set 1 #

Total comments: 16

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -10 lines) Patch
M tests/vm/vm.status View 1 1 chunk +0 lines, -3 lines 0 comments Download
M vm/freelist.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M vm/gc_marker.cc View 1 5 chunks +14 lines, -2 lines 0 comments Download
A vm/gc_sweeper.h View 1 1 chunk +39 lines, -0 lines 0 comments Download
A vm/gc_sweeper.cc View 1 1 chunk +67 lines, -0 lines 0 comments Download
M vm/heap.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M vm/heap.cc View 1 2 chunks +9 lines, -0 lines 0 comments Download
M vm/heap_test.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M vm/pages.h View 1 2 chunks +9 lines, -0 lines 0 comments Download
M vm/pages.cc View 1 5 chunks +64 lines, -3 lines 0 comments Download
M vm/raw_object.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M vm/raw_object.cc View 1 3 chunks +18 lines, -1 line 0 comments Download
M vm/verifier.cc View 1 2 chunks +7 lines, -0 lines 0 comments Download
M vm/vm_sources.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Ivan Posva
9 years ago (2011-12-14 00:11:25 UTC) #1
Ivan Posva
9 years ago (2011-12-14 00:35:57 UTC) #2
siva
LGTM http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc File vm/gc_sweeper.cc (right): http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc#newcode10 vm/gc_sweeper.cc:10: #include "vm/object.h" list vm/object.h before vm/pages.h http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc#newcode18 vm/gc_sweeper.cc:18: ...
9 years ago (2011-12-14 16:20:13 UTC) #3
cshapiro
http://codereview.chromium.org/8898034/diff/1/vm/freelist.h File vm/freelist.h (right): http://codereview.chromium.org/8898034/diff/1/vm/freelist.h#newcode36 vm/freelist.h:36: static bool IsSpecialMap(RawObject* raw_obj) { This is the first ...
9 years ago (2011-12-14 18:48:11 UTC) #4
Ivan Posva
9 years ago (2011-12-15 22:29:18 UTC) #5
http://codereview.chromium.org/8898034/diff/1/vm/freelist.h
File vm/freelist.h (right):

http://codereview.chromium.org/8898034/diff/1/vm/freelist.h#newcode36
vm/freelist.h:36: static bool IsSpecialMap(RawObject* raw_obj) {
On 2011/12/14 18:48:11, cshapiro wrote:
> This is the first time I have seen the class information referred to as a Map.

> That naming is used in V8.  Maybe this should be called IsSpecialClass
instead?

Done.

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc
File vm/gc_sweeper.cc (right):

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc#newcode10
vm/gc_sweeper.cc:10: #include "vm/object.h"
On 2011/12/14 16:20:13, asiva wrote:
> list vm/object.h before vm/pages.h

object.h was only needed for testing. Removed.

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc#newcode18
vm/gc_sweeper.cc:18: intptr_t in_use = page->used();
On 2011/12/14 16:20:13, asiva wrote:
> ASERT(in_use != 0); ?

That would be an incorrect ASSERT for totally empty pages. Once we do not even
attempt to sweep entirely empty pages this assert would make sense.

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.cc#newcode38
vm/gc_sweeper.cc:38: uword free_end = current + raw_obj->Size();
On 2011/12/14 18:48:11, cshapiro wrote:
> How does this interact with FreeList elements?
> 
> FreeList objects will not be marked so, if I am following this correctly, if
you
> sweep a page with a FreeList element between two ordinary objects, you may
reach
> this case.
> 
> Either way, a one-liner comment describing the free storage policy would be
> great.
> 
> If that is the case, it looks like a FreeList element could be coalesced an
the
> FreeList would be corrupted.

FreeListElements are coalesced and added to the correct free list. Free lists
are entirely emptied before the sweep cycle.

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.h
File vm/gc_sweeper.h (right):

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.h#newcode25
vm/gc_sweeper.h:25: // all the unmarked onbjects to the freelist.
On 2011/12/14 16:20:13, asiva wrote:
> *onbjects*objects

Done.

http://codereview.chromium.org/8898034/diff/1/vm/gc_sweeper.h#newcode32
vm/gc_sweeper.h:32: Heap* heap_;
On 2011/12/14 16:20:13, asiva wrote:
> DISALLOW_COPY_AND_ASSIGN

DISALLOW_IMPLICIT_CONSTRUCTORS

http://codereview.chromium.org/8898034/diff/1/vm/pages.cc
File vm/pages.cc (right):

http://codereview.chromium.org/8898034/diff/1/vm/pages.cc#newcode242
vm/pages.cc:242: in_use_ = in_use;
On 2011/12/14 16:20:13, asiva wrote:
> in_use here is not accounting for the large pages in use.

Done.

http://codereview.chromium.org/8898034/diff/1/vm/pages.cc#newcode247
vm/pages.cc:247: OS::PrintErr("Mark-Sweep[%d]: %lldus (%dK -> %dK, %dK)\n",
On 2011/12/14 18:48:11, cshapiro wrote:
> Maybe report marking and sweeping time separately?

Many more counters to come here.

Powered by Google App Engine
This is Rietveld 408576698