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

Issue 753553002: Phantom references support internal fields (Closed)

Created:
6 years, 1 month ago by Erik Corry Chromium.org
Modified:
5 years, 11 months ago
CC:
Paweł Hajdan Jr., v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Project:
v8
Visibility:
Public.

Description

Phantom references support internal fields BUG= Committed: https://crrev.com/3ff951943f60ffbfe6c29325a9a9c39195de54b5 Cr-Commit-Position: refs/heads/master@{#25889}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Don't clear fields after release, when that field is used for the next pointer #

Patch Set 3 : Don't forget to visit pointers to live objects so they can be updated to new location #

Total comments: 21

Patch Set 4 : Picksi feedback #

Patch Set 5 : Queue up phantom callbacks during GC to dispatch later #

Total comments: 19

Patch Set 6 : Don't use a handle for a dying object during GC #

Patch Set 7 : Add V8 tests, get into reviewable state #

Patch Set 8 : Code review feedback #

Patch Set 9 : Rebase on latest #

Patch Set 10 : Add include #

Patch Set 11 : Remove portability-challenged constants #

Patch Set 12 : Make Mac and Win compiler happeir #

Patch Set 13 : Remove extra uses of "typename" #

Patch Set 14 : Fix scavenge version of test #

Patch Set 15 : git cl format and rebase #

Patch Set 16 : Delete allocated objects in test to make memory sanitizer happy #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+641 lines, -184 lines) Patch
M include/v8.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +90 lines, -32 lines 1 comment Download
M src/api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +18 lines, -6 lines 0 comments Download
M src/debug.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M src/debug.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +40 lines, -22 lines 0 comments Download
M src/global-handles.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +65 lines, -2 lines 0 comments Download
M src/global-handles.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 chunks +321 lines, -115 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -2 lines 0 comments Download
M src/heap/mark-compact.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +93 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (8 generated)
jochen (gone - plz use gerrit)
i think we need to copy out the internal fields when we iterate the weak ...
6 years ago (2014-11-24 12:27:53 UTC) #3
Erik Corry
I might have to grow the node. That unfortunately means growing all the nodes, since ...
6 years ago (2014-11-24 12:38:26 UTC) #5
Erik Corry
Not yet ready, still crashes on the young space case.
6 years ago (2014-11-24 12:39:23 UTC) #6
jochen (gone - plz use gerrit)
On 2014/11/24 at 12:38:26, erik.corry wrote: > I might have to grow the node. That ...
6 years ago (2014-11-25 12:32:51 UTC) #7
picksi1
Thanks for CC'ing me in on this! It's interesting stuff. To repay your efforts I've ...
6 years ago (2014-11-28 12:15:11 UTC) #9
Erik Corry
https://codereview.chromium.org/753553002/diff/40001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/753553002/diff/40001/include/v8.h#newcode516 include/v8.h:516: if (a == 0) return b == 0; On ...
6 years ago (2014-11-28 14:21:25 UTC) #10
picksi1
https://codereview.chromium.org/753553002/diff/40001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/753553002/diff/40001/include/v8.h#newcode517 include/v8.h:517: if (b == 0) return false; On 2014/11/28 14:21:25, ...
6 years ago (2014-11-28 14:51:05 UTC) #11
picksi1
lgtm!
6 years ago (2014-11-28 14:58:19 UTC) #12
jochen (gone - plz use gerrit)
https://codereview.chromium.org/753553002/diff/80001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/753553002/diff/80001/include/v8.h#newcode510 include/v8.h:510: V8_INLINE void Empty() { val_ = NULL; } what ...
6 years ago (2014-12-02 10:25:59 UTC) #13
Erik Corry
I still need to fix creation and processing of the deferred phantom callback queue in ...
6 years ago (2014-12-02 10:40:49 UTC) #14
rmcilroy
https://codereview.chromium.org/753553002/diff/80001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/753553002/diff/80001/include/v8.h#newcode422 include/v8.h:422: class CallbackData { nit - BaseCallbackData or maybe even ...
6 years ago (2014-12-03 11:56:35 UTC) #15
Erik Corry
https://codereview.chromium.org/753553002/diff/80001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/753553002/diff/80001/include/v8.h#newcode422 include/v8.h:422: class CallbackData { On 2014/12/03 11:56:35, rmcilroy wrote: > ...
6 years ago (2014-12-15 15:12:42 UTC) #16
Erik Corry
This latest version queues up the callbacks and then calls them later. We have to ...
6 years ago (2014-12-15 15:18:30 UTC) #17
jochen (gone - plz use gerrit)
lgtm assuming you can make the compilers happy :)
6 years ago (2014-12-15 15:39:40 UTC) #18
rmcilroy
On 2014/12/15 15:39:40, jochen (slow) wrote: > lgtm assuming you can make the compilers happy ...
6 years ago (2014-12-16 10:59:07 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/753553002/260001
6 years ago (2014-12-16 15:05:21 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_asan_rel on tryserver.v8 (http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_asan_rel/builds/486)
6 years ago (2014-12-16 15:52:41 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/753553002/280002
6 years ago (2014-12-18 15:33:21 UTC) #25
commit-bot: I haz the power
Committed patchset #16 (id:280002)
6 years ago (2014-12-18 16:09:13 UTC) #26
commit-bot: I haz the power
Patchset 16 (id:??) landed as https://crrev.com/3ff951943f60ffbfe6c29325a9a9c39195de54b5 Cr-Commit-Position: refs/heads/master@{#25889}
6 years ago (2014-12-18 18:05:43 UTC) #27
dcarney
5 years, 11 months ago (2015-01-07 13:18:51 UTC) #29
Message was sent while issue was closed.
https://codereview.chromium.org/753553002/diff/280002/include/v8.h
File include/v8.h (right):

https://codereview.chromium.org/753553002/diff/280002/include/v8.h#newcode477
include/v8.h:477: T* internal_field1_;
I'm a little late weighing in here, but I have a few points of concern.  The
first is that these two fields can be heap objects, which is crazily dangerous
for about 6 reasons.  We should set nullptr for any values that are not aligned
according to SetAlignedPointerInInternalField, which won't catch all smis
(probably we should box any smis set as internal fields).

The second problem is that in many cases in blink we want both the internal
fields and the parameter, so splitting into two callbacks types is a pretty bad
idea here.  I think setting a bit saying you need up to the first 2 internal
fields if they are there should be okay, since an embedder should be able to
rearrange things such that those fields are in the first two slots.  There
should be no additional memory required at that point for global handle nodes,
just additional memory for the phantom callback queue, which should be fine.

Lastly, these field are set with void*, so I think getting them with void*
should be okay, avoiding extra template parameters, but i'm pretty indifferent
to this.

Powered by Google App Engine
This is Rietveld 408576698