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

Issue 6357005: Adding files for LiveObjectList implementation. (Closed)

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

Description

Adding files for LiveObjectList implementation. Committed: http://code.google.com/p/v8/source/detail?r=7012

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 73

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 52

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2816 lines, -36 lines) Patch
M src/flag-definitions.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M src/liveobjectlist.h View 1 2 3 4 5 1 chunk +245 lines, -35 lines 0 comments Download
M src/liveobjectlist.cc View 1 2 3 4 5 2 chunks +2475 lines, -1 line 0 comments Download
M src/liveobjectlist-inl.h View 1 2 3 4 5 1 chunk +90 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
marklam
9 years, 11 months ago (2011-01-19 07:31:37 UTC) #1
mnaganov (inactive)
On 2011/01/19 07:31:37, marklam wrote: I didn't managed to go through the full source yet. ...
9 years, 11 months ago (2011-01-20 16:47:51 UTC) #2
mnaganov (inactive)
http://codereview.chromium.org/6357005/diff/6001/src/liveobjectlist-inl.h File src/liveobjectlist-inl.h (right): http://codereview.chromium.org/6357005/diff/6001/src/liveobjectlist-inl.h#newcode40 src/liveobjectlist-inl.h:40: I think two blank lines are only needed between ...
9 years, 11 months ago (2011-01-20 16:48:00 UTC) #3
marklam
Mikhail, I've addressed all your comments. Please take another look and let me know if ...
9 years, 11 months ago (2011-01-21 03:47:49 UTC) #4
mnaganov (inactive)
Replies to your answers. I will review the updated code later today. http://codereview.chromium.org/6357005/diff/6001/src/liveobjectlist.cc File src/liveobjectlist.cc ...
9 years, 11 months ago (2011-01-21 13:19:47 UTC) #5
marklam
On 2011/01/21 13:19:47, Michail Naganov wrote: > Heap::InSpace accepts addresses and doesn't assume that the ...
9 years, 11 months ago (2011-01-21 15:18:03 UTC) #6
mnaganov (inactive)
I would also ask Soeren to look at this, because the patch is rather big. ...
9 years, 11 months ago (2011-01-21 16:52:36 UTC) #7
Søren Thygesen Gjesse
Hi Mark, A few general comments. I will provide more when your refactoring is uploaded. ...
9 years, 11 months ago (2011-01-25 14:34:47 UTC) #8
marklam
Here is the update that addresses all the comments except for 3 issue left to ...
9 years, 9 months ago (2011-03-01 15:16:05 UTC) #9
Søren Thygesen Gjesse
9 years, 9 months ago (2011-03-02 09:18:10 UTC) #10
On 2011/03/01 15:16:05, marklam wrote:
> Here is the update that addresses all the comments except for 3 issue left to
be
> addressed in a future CL:
> 1. "rewind" Capture() if allocation fails.
> 2. refactor lol core and debugger/runtime parts into 2 components.
> 3. add unit tests.
> 
> Please take a look.  Thanks.
> 
> http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc
> File src/liveobjectlist.cc (right):
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:231: }
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > You might add an ASSERT or SLOW_ASSERT of 'Heap::InSpace(heap_obj,
LO_SPACE)'
> > here.
> 
> Done.  I added the SLOW_ASSERT.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:381: if (elements_) break;
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > elements_ != NULL
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:770: enum {
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > Why use a enum here instead of
> > 
> > static const int kNumberOfEntries = ...?
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:979: return a->obj - b->obj;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > This will not work properly for x64. Please, use explicit comparison.
> 
> Done.  Sorry that I misunderstood what you're asking for here.  I've made the
> necessary change.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1101: // in the interim.
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > Please explain how more objects can get added to the heap during the call to
> > Capture().
> 
> I've remove this retry and padding logic.  It was added needed due to a
previous
> temporary implementation of this code which could allocate objects.  However,
> that need is no longer present.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1149: Handle<JSObject> result =
> Factory::NewJSObject(Top::object_function());
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > What is supposed to happen if a lol is captured but we are not able to
return
> a
> > result object?
> 
> Deferred fix for a future CL.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1384: if (older_id != 0) {
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > I see this code fragment for the 4th time. Can you please factor it out?
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1458: LiveObjectType type = (LiveObjectType)i;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > reinterpret_cast
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1464: 
> On 2011/01/25 14:34:48, Søren Gjesse wrote:
> > Why are you using mixed pointers/handles here - is that intentional? In
> > handles.h/handles.cc there is a SetProperty function which takes handles and
> > performs GC if required.
> > 
> > As this function already uses Factory methods GC can happen, so handlifying
> the
> > whole thing seems like the right thing to do.
> > 
> > Other functions below uses a mixture of handles and raw objects.
> 
> Deferred fix for a future CL.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1641: while (lol != NULL) {
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > I think, this code has much in common with GetObj. Can you please factor the
> > common part out?
> 
> Done.  Templatized the common part.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1757: if (lol_visitor.found()) {
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > This fragment of code looks almost exactly as the previous one. Can you
please
> > factor out common code?
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:1867: HeapObject* heap_obj =
> reinterpret_cast<HeapObject*>(GetObj(obj_id));
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > Please, use HeapObject::cast.
> 
> Done.  I did a search for *> and replace all the cases that seemed appropriate
> with the respective cast() calls.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2292: obj1 =
> reinterpret_cast<HeapObject*>(GetObj(obj_id1));
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > Please, use HeapObject::cast. You'll need to check if it IsHeapObject first.
> 
> Done.  GetObj() either returns undefined or a HeapObject.  So, it should be
> fine.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2298: HeapObject* obj2 =
> reinterpret_cast<HeapObject*>(GetObj(obj_id2));
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > ditto.
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2345: Element* elements = new Element[total_count];
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > NewArray<Element>
> 
> Done.  I did a search for all new and delete[] in this file and replaced them
> accordingly.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2406: delete[] elements;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > DeleteArray
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2447: i--;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > Personally, I prefer to write such loops as while-loops, incrementing
counter
> > when necessary, instead of undoing the work done by the for-loop increment.
> But
> > it's not mandatory.
> 
> Done.  Just to make you happy. =)
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2455: delete[] elements;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > DeleteArray
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2485: new_elements = new Element[new_count];
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > NewArray<Element>
> > And why don't you initialize during the declaration?
> 
> Done.  I think I had some debug / other experimental code in between before. 
> That code is now purged, but these weren't recombined.  I've re-combined them
> now.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2488: delete[] elements;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > DeleteArray
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2551: fflush(stdout);
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > Flush()
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2552: HeapIterator iterator;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > should be iterator(HeapIterator::kFilterFreeListNodes) ?
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2561: Element* result = reinterpret_cast<Element *>(
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > Element * -> Element*
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2569: result->obj = reinterpret_cast<HeapObject
> *>(heap_obj->address());
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > HeapObject * -> HeapObject*
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2598: delete[] elements;
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > DeleteArray
> 
> Done.
> 
>
http://codereview.chromium.org/6357005/diff/23001/src/liveobjectlist.cc#newco...
> src/liveobjectlist.cc:2650: for (it.Init(); !it.Done(); it.Next()) {
> On 2011/01/21 16:52:36, Mikhail Naganov (Chromium) wrote:
> > just curious: why don't you declare the iterator in the for loop
> initialization
> > part?
> 
> I suppose I could.  But if I did that, I might as well declare the "int i = 0"
> in the loop initializer as well, and that will increase the line to 83 chars. 
> It also makes the loop looks more complex and difficult to read.  So, I left
it
> this way mostly for readability.  It's easy to see that it does at a glance.

Committed: http://code.google.com/p/v8/source/detail?r=7012

Thank you for the patch.

Powered by Google App Engine
This is Rietveld 408576698