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

Issue 9148051: Provide API support for weak handles and post-mortem finalization. (Closed)

Created:
8 years, 11 months ago by cshapiro
Modified:
8 years, 11 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Provide API support for weak handles and post-mortem finalization. In addition, this change separates the storage of weak persistent handles from ordinary persistent handles. An ordinary persistent handle now stores no other data than the raw pointer value. Committed: https://code.google.com/p/dart/source/detail?r=3273

Patch Set 1 #

Patch Set 2 : improve an assert and remove commented-out code #

Patch Set 3 : a better strategy for protected handle checks #

Total comments: 10

Patch Set 4 : address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -161 lines) Patch
M runtime/vm/dart_api_impl.h View 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 7 chunks +32 lines, -20 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 chunk +31 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_state.h View 1 2 10 chunks +133 lines, -73 lines 0 comments Download
D runtime/vm/dart_api_state.cc View 1 2 1 chunk +0 lines, -15 lines 0 comments Download
M runtime/vm/gc_marker.h View 2 chunks +2 lines, -1 line 0 comments Download
M runtime/vm/gc_marker.cc View 1 2 3 3 chunks +13 lines, -13 lines 0 comments Download
M runtime/vm/handles.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/handles_impl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/isolate.h View 2 chunks +2 lines, -4 lines 0 comments Download
M runtime/vm/isolate.cc View 3 chunks +3 lines, -10 lines 0 comments Download
M runtime/vm/scavenger.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/scavenger.cc View 1 2 3 3 chunks +17 lines, -18 lines 0 comments Download
M runtime/vm/verifier.h View 1 2 3 2 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/verifier.cc View 1 2 3 2 chunks +13 lines, -2 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
cshapiro
8 years, 11 months ago (2012-01-12 01:03:08 UTC) #1
Anton Muhin
DBC http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc File runtime/vm/gc_marker.cc (right): http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc#newcode202 runtime/vm/gc_marker.cc:202: handle->Finalize(); there might be unpleasant problem: naively implemented ...
8 years, 11 months ago (2012-01-12 13:40:26 UTC) #2
cshapiro
http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc File runtime/vm/gc_marker.cc (right): http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc#newcode202 runtime/vm/gc_marker.cc:202: handle->Finalize(); Correct. There is one case we consider to ...
8 years, 11 months ago (2012-01-12 18:15:36 UTC) #3
Ivan Posva
LGTM with comments. -Ivan http://codereview.chromium.org/9148051/diff/4001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): http://codereview.chromium.org/9148051/diff/4001/runtime/vm/dart_api_impl.cc#newcode513 runtime/vm/dart_api_impl.cc:513: state->persistent_handles().FreeHandle(ref); Why not checking for ...
8 years, 11 months ago (2012-01-12 23:30:38 UTC) #4
cshapiro
http://codereview.chromium.org/9148051/diff/4001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): http://codereview.chromium.org/9148051/diff/4001/runtime/vm/dart_api_impl.cc#newcode513 runtime/vm/dart_api_impl.cc:513: state->persistent_handles().FreeHandle(ref); A good idea. Done. This makes the diff ...
8 years, 11 months ago (2012-01-13 01:30:02 UTC) #5
Anton Muhin
http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc File runtime/vm/gc_marker.cc (right): http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc#newcode202 runtime/vm/gc_marker.cc:202: handle->Finalize(); Carl, sorry, I wasn't clear enough regarding #2. ...
8 years, 11 months ago (2012-01-13 14:20:56 UTC) #6
cshapiro
8 years, 11 months ago (2012-01-13 22:56:45 UTC) #7
http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc
File runtime/vm/gc_marker.cc (right):

http://codereview.chromium.org/9148051/diff/4001/runtime/vm/gc_marker.cc#newc...
runtime/vm/gc_marker.cc:202: handle->Finalize();
Thanks for the clarification.

I discussed your concern with Ivan and the current opinion is that situations
where the finalizer is non-trivial should be resolved by queuing an object for
destruction through the event queue (I believe the render even queue was
mentioned) and having those actions be handled outside the garbage collector.

If you feel this does not work for you, let's have a discussion outside this
review to resolve whether or not we have something workable.

Powered by Google App Engine
This is Rietveld 408576698