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

Issue 9956138: Process weak reference sets when a scavenge invokes the API callbacks. (Closed)

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

Description

Process weak reference sets when a scavenge invokes the API callbacks. BUG=2391 Committed: https://code.google.com/p/dart/source/detail?r=6348

Patch Set 1 #

Total comments: 10

Patch Set 2 : address review comments #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -15 lines) Patch
M runtime/vm/dart_api_impl_test.cc View 1 2 5 chunks +122 lines, -4 lines 0 comments Download
M runtime/vm/scavenger.h View 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/scavenger.cc View 1 4 chunks +79 lines, -11 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
cshapiro
8 years, 8 months ago (2012-04-04 03:54:38 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/9956138/diff/1/runtime/vm/scavenger.cc File runtime/vm/scavenger.cc (right): https://chromiumcodereview.appspot.com/9956138/diff/1/runtime/vm/scavenger.cc#newcode248 runtime/vm/scavenger.cc:248: if (!raw_obj->IsNewObject()) { Wouldn't just this check be ...
8 years, 8 months ago (2012-04-06 17:12:25 UTC) #2
podivilov
http://codereview.chromium.org/9956138/diff/1/runtime/vm/scavenger.cc File runtime/vm/scavenger.cc (right): http://codereview.chromium.org/9956138/diff/1/runtime/vm/scavenger.cc#newcode228 runtime/vm/scavenger.cc:228: isolate->gc_prologue_callbacks().Invoke(); Please invoke epilogue callbacks here.
8 years, 8 months ago (2012-04-06 17:20:10 UTC) #3
Ivan Posva
LGTM, but I am wondering how the tests pass if we are currently calling the ...
8 years, 8 months ago (2012-04-06 21:54:06 UTC) #4
cshapiro
The reason the tests pass is because the original behavior of the callbacks assumed they ...
8 years, 8 months ago (2012-04-06 22:24:31 UTC) #5
cshapiro
8 years, 8 months ago (2012-04-10 02:40:31 UTC) #6
I am going to go ahead and submit this to unblock Dartium.  I am happy to
revisit the issue of Smi reachablity in a subsequent change if the current
behavior is still believed to be undesirable.

https://chromiumcodereview.appspot.com/9956138/diff/1/runtime/vm/scavenger.cc
File runtime/vm/scavenger.cc (right):

https://chromiumcodereview.appspot.com/9956138/diff/1/runtime/vm/scavenger.cc...
runtime/vm/scavenger.cc:243: bool Scavenger::IsUnreachable(RawObject** p) {
While this is very rational adjustment when considered in isolation, it has been
so long since I made the change that I lost the context for the naming.

The unreachability test was supposed to be shared with the handle visiting code.
 The use of Unreachable as opposed to Reachable has some consistency given the
two uses.  Anyway, I have made the fix in VisitHandle and so this looks a bit
less strange (no more isolated double negative).  If you still think this looks
backward, I can submit a clean-up that flips the naming here and in the marker.

https://chromiumcodereview.appspot.com/9956138/diff/1/runtime/vm/scavenger.cc...
runtime/vm/scavenger.cc:245: if (!raw_obj->IsHeapObject()) {
I thought about this over the weekend.  Numbers are immutable and this is often
an opportunity for time and space optimizations.  Looking at it another way,
relying on values produced by different expressions being not equal is not
something that we are likely to make guarantees about.

Consider the following situations: "1.0 == 1.0" is always true, "1.0 === 1.0" is
true today under a broad range of circumstances, and "1.0 === (1 * 1.0)" is not
presently true but may become true in the future.

Reflecting on your example, Smi 1 does keep a set alive and 1.0 might as well,
depending on its provenance.

I am not sure there is an ideal resolution here.  This might be best to revisit
in a subsequent change as other parts of the code such as the handle processing
and the marker treats Smi objects as always live.

Powered by Google App Engine
This is Rietveld 408576698