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

Issue 623033002: Oilpan: Add support of pre-finalization callback to Oilpan infrastructure. (Closed)

Created:
6 years, 2 months ago by tkent
Modified:
6 years, 2 months ago
CC:
blink-reviews, Mads Ager (chromium), mkwst+moarreviews_chromium.org, dgrogan, cmumford, jsbell+idb_chromium.org, kouhei+heap_chromium.org
Project:
blink
Visibility:
Public.

Description

Oilpan: Add support of pre-finalization callback to Oilpan infrastructure. This CL introduces: - ThreadState::registerPreFinalizer(T&) - ThreadState::unregisterPreFinalizer(T&) - USING_PRE_FINALIZER(Class, method) They are used like the following: class Foo : GarbageCollected<Foo> { USING_PRE_FINALIZER(Foo, dispose); public: Foo() { ThreadState::current()->registerPreFinalizer(*this); } void trace(Visitor*); ... private: void dispose(); Member<Bar> m_bar; }; void Foo::dispose() { m_bar->doesSomething(); } BUG=420515 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183253

Patch Set 1 #

Total comments: 25

Patch Set 2 : apply review comments #

Total comments: 14

Patch Set 3 : typos, add an aasertion #

Total comments: 8

Patch Set 4 : Fix a wrong example in a comment #

Patch Set 5 : Update a comment #

Patch Set 6 : Add a FIXME #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -132 lines) Patch
M Source/modules/indexeddb/IDBCursor.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/modules/indexeddb/IDBCursor.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/indexeddb/IDBPendingTransactionMonitor.h View 1 chunk +0 lines, -19 lines 0 comments Download
M Source/modules/indexeddb/IDBPendingTransactionMonitor.cpp View 3 chunks +0 lines, -101 lines 0 comments Download
M Source/modules/indexeddb/IDBRequest.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/modules/indexeddb/IDBRequest.cpp View 1 4 chunks +3 lines, -4 lines 0 comments Download
M Source/platform/heap/HeapTest.cpp View 1 4 chunks +63 lines, -0 lines 0 comments Download
M Source/platform/heap/ThreadState.h View 1 2 3 4 5 6 chunks +73 lines, -4 lines 5 comments Download
M Source/platform/heap/ThreadState.cpp View 1 2 3 chunks +25 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (6 generated)
tkent
Please review this. https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h#newcode153 Source/platform/heap/ThreadState.h:153: static bool willFinalizeDeadGarbageCollectedObject(void* object, Visitor& visitor) ...
6 years, 2 months ago (2014-10-03 05:34:26 UTC) #2
haraken
The approach looks good. https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h#newcode132 Source/platform/heap/ThreadState.h:132: // other garbarge-collected members. However ...
6 years, 2 months ago (2014-10-03 06:00:32 UTC) #4
tkent
https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h#newcode132 Source/platform/heap/ThreadState.h:132: // other garbarge-collected members. However we must not allocate ...
6 years, 2 months ago (2014-10-03 06:34:01 UTC) #5
haraken
https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h#newcode132 Source/platform/heap/ThreadState.h:132: // other garbarge-collected members. However we must not allocate ...
6 years, 2 months ago (2014-10-03 06:39:18 UTC) #6
Erik Corry
I'm not seeing any tests here. Are the prefinalization callbacks run on the thread to ...
6 years, 2 months ago (2014-10-03 08:56:50 UTC) #8
Erik Corry
https://codereview.chromium.org/623033002/diff/1/Source/modules/indexeddb/IDBRequest.h File Source/modules/indexeddb/IDBRequest.h (left): https://codereview.chromium.org/623033002/diff/1/Source/modules/indexeddb/IDBRequest.h#oldcode65 Source/modules/indexeddb/IDBRequest.h:65: void dispose(); I'd prefer to keep this https://codereview.chromium.org/623033002/diff/1/Source/platform/heap/ThreadState.h File ...
6 years, 2 months ago (2014-10-03 09:13:27 UTC) #9
tkent
Updated the patch. - Consistent and simplified names. - Add more comments - The macro ...
6 years, 2 months ago (2014-10-06 01:25:53 UTC) #10
tkent
On 2014/10/06 01:25:53, tkent wrote: > Updated the patch. > - Consistent and simplified names. ...
6 years, 2 months ago (2014-10-06 01:34:51 UTC) #11
haraken
Mostly looks good. https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.cpp File Source/platform/heap/ThreadState.cpp (right): https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.cpp#newcode1119 Source/platform/heap/ThreadState.cpp:1119: invokePreFinalizers(*Heap::s_markingVisitor); Just to confirm: The main ...
6 years, 2 months ago (2014-10-06 01:55:28 UTC) #12
tkent
https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.h#newcode134 Source/platform/heap/ThreadState.h:134: // allocate new garbage-collected objects, and must not update ...
6 years, 2 months ago (2014-10-06 05:01:43 UTC) #13
haraken
LGTM https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/20001/Source/platform/heap/ThreadState.h#newcode666 Source/platform/heap/ThreadState.h:666: // argument should be |*this|. Registering a lot ...
6 years, 2 months ago (2014-10-06 05:26:42 UTC) #14
tkent
https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h#newcode142 Source/platform/heap/ThreadState.h:142: // HeapHashMap are collected at same time. On 2014/10/06 ...
6 years, 2 months ago (2014-10-06 06:02:24 UTC) #15
haraken
https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h#newcode142 Source/platform/heap/ThreadState.h:142: // HeapHashMap are collected at same time. On 2014/10/06 ...
6 years, 2 months ago (2014-10-06 06:28:09 UTC) #16
tkent
https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h#newcode142 Source/platform/heap/ThreadState.h:142: // HeapHashMap are collected at same time. On 2014/10/06 ...
6 years, 2 months ago (2014-10-06 07:00:52 UTC) #17
haraken
https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h#newcode142 Source/platform/heap/ThreadState.h:142: // HeapHashMap are collected at same time. On 2014/10/06 ...
6 years, 2 months ago (2014-10-06 07:04:09 UTC) #18
tkent
https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/40001/Source/platform/heap/ThreadState.h#newcode142 Source/platform/heap/ThreadState.h:142: // HeapHashMap are collected at same time. > Sounds ...
6 years, 2 months ago (2014-10-06 07:17:59 UTC) #19
haraken
Still LGTM.
6 years, 2 months ago (2014-10-06 07:28:20 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/623033002/100001
6 years, 2 months ago (2014-10-06 08:26:26 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/623033002/100001
6 years, 2 months ago (2014-10-06 08:31:25 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001) as 183253
6 years, 2 months ago (2014-10-06 08:32:05 UTC) #26
Erik Corry
https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h#newcode133 Source/platform/heap/ThreadState.h:133: // garbarge-collected objects allocated in the thread. However we ...
6 years, 2 months ago (2014-10-06 12:39:18 UTC) #27
haraken
https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h#newcode141 Source/platform/heap/ThreadState.h:141: // outlives objects pointed by WeakMembers. On 2014/10/06 12:39:18, ...
6 years, 2 months ago (2014-10-06 12:54:05 UTC) #28
tkent
https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h File Source/platform/heap/ThreadState.h (right): https://codereview.chromium.org/623033002/diff/100001/Source/platform/heap/ThreadState.h#newcode133 Source/platform/heap/ThreadState.h:133: // garbarge-collected objects allocated in the thread. However we ...
6 years, 2 months ago (2014-10-07 05:10:08 UTC) #29
haraken
> > As for overhead, if you are going to remove items from the map ...
6 years, 2 months ago (2014-10-07 05:16:56 UTC) #30
tkent
On 2014/10/07 05:16:56, haraken wrote: > > ThreadState::invokePreFinalizers() might have a performance issue because > ...
6 years, 2 months ago (2014-10-07 05:21:00 UTC) #31
haraken
6 years, 2 months ago (2014-10-07 05:22:25 UTC) #32
Message was sent while issue was closed.
On 2014/10/07 05:21:00, tkent wrote:
> On 2014/10/07 05:16:56, haraken wrote:
> > > ThreadState::invokePreFinalizers() might have a performance issue because
> > > HashMap::removeAll() can shrink repeatedly.
> > > We should optimize this if this is significant.
> > 
> > I guess the HashMap::removeAll() won't cause shrink because shrink is
disabled
> > during weak processing.
> 
> HashMap knows nothing about weak processing. More concretely,
> Allocator::isAllocationAllowed() in HashTable::shouldShrink() always returns
> true for off-heap HashMap.

oh, you're right. This is an off-heap HashMap, not an on-heap HeapHashMap.

Powered by Google App Engine
This is Rietveld 408576698