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

Issue 1105693002: Implement IdentityMap<V>, a robust, GC-safe object-identity HashMap. (Closed)

Created:
5 years, 8 months ago by titzer
Modified:
5 years, 7 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Implement IdentityMap<V>, a robust, GC-safe object-identity HashMap. R=hpayer@chromium.org, erikcorry@chromium.org BUG= Committed: https://crrev.com/6d26ec0b4c74b77a3c8079291e9bbc4bb8998aed Cr-Commit-Position: refs/heads/master@{#28257}

Patch Set 1 #

Total comments: 16

Patch Set 2 : #

Total comments: 31

Patch Set 3 : #

Total comments: 11

Patch Set 4 : #

Total comments: 6

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : Add visitor synchronization. #

Patch Set 9 : Fix use-after-free screwup. #

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+725 lines, -19 lines) Patch
M BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/heap/heap.h View 1 2 3 4 5 2 chunks +27 lines, -3 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 7 8 9 5 chunks +51 lines, -1 line 0 comments Download
A src/heap/identity-map.h View 1 2 3 4 5 6 1 chunk +96 lines, -0 lines 0 comments Download
A src/heap/identity-map.cc View 1 2 3 1 chunk +191 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 1 chunk +16 lines, -15 lines 0 comments Download
M test/cctest/cctest.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A test/cctest/test-identity-map.cc View 1 chunk +339 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (5 generated)
titzer
5 years, 8 months ago (2015-04-23 17:10:26 UTC) #1
titzer
On 2015/04/23 17:10:26, titzer wrote: PTAL, still needs a test that actually runs queries in ...
5 years, 8 months ago (2015-04-23 17:10:57 UTC) #2
adamk
Drive-by interest: I've been wishing for something better than the Object Identity Hash for hashing ...
5 years, 8 months ago (2015-04-23 18:14:58 UTC) #3
adamk
Drive-by interest: I've been wishing for something better than the Object Identity Hash for hashing ...
5 years, 8 months ago (2015-04-23 18:15:03 UTC) #4
titzer
On 2015/04/23 18:15:03, adamk wrote: > Drive-by interest: I've been wishing for something better than ...
5 years, 8 months ago (2015-04-24 08:28:24 UTC) #5
adamk
On 2015/04/24 08:28:24, titzer wrote: > On 2015/04/23 18:15:03, adamk wrote: > > Drive-by interest: ...
5 years, 8 months ago (2015-04-24 15:15:58 UTC) #6
Benedikt Meurer
https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc File src/heap/identity-map.cc (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc#newcode17 src/heap/identity-map.cc:17: if (concurrent_) heap_->relocation_mutex()->Lock(); How about a simple helper class ...
5 years, 8 months ago (2015-04-27 04:04:18 UTC) #8
Sven Panne
DBC https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h File src/heap/identity-map.h (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h#newcode68 src/heap/identity-map.h:68: return static_cast<int>((raw_address >> 11) ^ raw_address); On 2015/04/27 ...
5 years, 8 months ago (2015-04-27 06:26:47 UTC) #10
titzer
https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h File src/heap/identity-map.h (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h#newcode68 src/heap/identity-map.h:68: return static_cast<int>((raw_address >> 11) ^ raw_address); On 2015/04/27 06:26:47, ...
5 years, 8 months ago (2015-04-27 07:57:51 UTC) #11
titzer
https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc File src/heap/identity-map.cc (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc#newcode17 src/heap/identity-map.cc:17: if (concurrent_) heap_->relocation_mutex()->Lock(); On 2015/04/27 04:04:17, Benedikt Meurer wrote: ...
5 years, 8 months ago (2015-04-27 10:43:03 UTC) #12
Hannes Payer (out of office)
looking good, just nits https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc File src/heap/identity-map.cc (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc#newcode50 src/heap/identity-map.cc:50: Resize(); // Should only have ...
5 years, 8 months ago (2015-04-27 15:06:33 UTC) #13
Erik Corry
I'm going to stop here and ask a more fundamental question: We already have HashTable ...
5 years, 8 months ago (2015-04-27 15:39:13 UTC) #15
titzer
https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc File src/heap/identity-map.cc (right): https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.cc#newcode50 src/heap/identity-map.cc:50: Resize(); // Should only have to resize once, since ...
5 years, 8 months ago (2015-04-27 16:32:51 UTC) #16
titzer
https://codereview.chromium.org/1105693002/diff/20001/src/heap/heap.h File src/heap/heap.h (right): https://codereview.chromium.org/1105693002/diff/20001/src/heap/heap.h#newcode1478 src/heap/heap.h:1478: delete list; On 2015/04/27 15:39:13, Erik Corry wrote: > ...
5 years, 8 months ago (2015-04-27 16:36:49 UTC) #17
titzer
On 2015/04/27 15:39:13, Erik Corry wrote: > I'm going to stop here and ask a ...
5 years, 8 months ago (2015-04-27 16:45:16 UTC) #18
Erik Corry
Not happy with this change. Using addresses for hashes is nasty because it adds work ...
5 years, 7 months ago (2015-04-28 09:32:34 UTC) #19
titzer
On 2015/04/28 09:32:34, Erik Corry wrote: > Not happy with this change. > > Using ...
5 years, 7 months ago (2015-04-28 11:20:43 UTC) #20
titzer
https://codereview.chromium.org/1105693002/diff/40001/src/heap/identity-map.cc File src/heap/identity-map.cc (right): https://codereview.chromium.org/1105693002/diff/40001/src/heap/identity-map.cc#newcode13 src/heap/identity-map.cc:13: static const int kInitialIdentityMapSize = 32; On 2015/04/28 09:32:34, ...
5 years, 7 months ago (2015-04-28 11:23:49 UTC) #21
Erik Corry
https://codereview.chromium.org/1105693002/diff/60001/src/heap/identity-map.h File src/heap/identity-map.h (right): https://codereview.chromium.org/1105693002/diff/60001/src/heap/identity-map.h#newcode88 src/heap/identity-map.h:88: *(reinterpret_cast<V*>(GetEntry(key))) = value; This assignment takes place without holding ...
5 years, 7 months ago (2015-04-28 13:51:16 UTC) #22
titzer
On 2015/04/28 13:51:16, Erik Corry wrote: > https://codereview.chromium.org/1105693002/diff/60001/src/heap/identity-map.h > File src/heap/identity-map.h (right): > > https://codereview.chromium.org/1105693002/diff/60001/src/heap/identity-map.h#newcode88 ...
5 years, 7 months ago (2015-04-28 14:46:55 UTC) #23
Erik Corry
My mistake. I had missed that the Rehash takes place on the compiler thread after ...
5 years, 7 months ago (2015-04-28 15:27:32 UTC) #24
Erik Corry
I'm warming to this change/coming to terms with its inevitability. Some non-blocking comments to consider. ...
5 years, 7 months ago (2015-04-28 15:42:34 UTC) #25
Benedikt Meurer
On 2015/04/27 07:57:51, titzer wrote: > https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h > File src/heap/identity-map.h (right): > > https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h#newcode68 > ...
5 years, 7 months ago (2015-04-29 03:43:10 UTC) #26
Benedikt Meurer
https://codereview.chromium.org/1105693002/diff/60001/src/heap/heap.h File src/heap/heap.h (right): https://codereview.chromium.org/1105693002/diff/60001/src/heap/heap.h#newcode1456 src/heap/heap.h:1456: struct StrongRootsList { Style nit: Please forward declare struct ...
5 years, 7 months ago (2015-04-29 03:48:35 UTC) #27
Erik Corry
On 2015/04/29 03:43:10, Benedikt Meurer wrote: > On 2015/04/27 07:57:51, titzer wrote: > > https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h ...
5 years, 7 months ago (2015-04-29 09:29:36 UTC) #28
Sven Panne
On 2015/04/29 09:29:36, Erik Corry wrote: > If you cast the pointer to unintptr_t then ...
5 years, 7 months ago (2015-04-29 09:42:11 UTC) #29
titzer
On 2015/04/29 03:43:10, Benedikt Meurer wrote: > On 2015/04/27 07:57:51, titzer wrote: > > https://codereview.chromium.org/1105693002/diff/1/src/heap/identity-map.h ...
5 years, 7 months ago (2015-04-29 15:03:35 UTC) #30
Benedikt Meurer
On 2015/04/29 15:03:35, titzer wrote: > On 2015/04/29 03:43:10, Benedikt Meurer wrote: > > On ...
5 years, 7 months ago (2015-04-30 05:33:51 UTC) #31
Benedikt Meurer
On 2015/04/30 05:33:51, Benedikt Meurer wrote: > On 2015/04/29 15:03:35, titzer wrote: > > On ...
5 years, 7 months ago (2015-04-30 05:35:16 UTC) #32
titzer
https://codereview.chromium.org/1105693002/diff/60001/src/heap/heap.h File src/heap/heap.h (right): https://codereview.chromium.org/1105693002/diff/60001/src/heap/heap.h#newcode1456 src/heap/heap.h:1456: struct StrongRootsList { On 2015/04/29 03:48:35, Benedikt Meurer wrote: ...
5 years, 7 months ago (2015-05-06 09:11:25 UTC) #33
titzer
On 2015/04/30 05:33:51, Benedikt Meurer wrote: > On 2015/04/29 15:03:35, titzer wrote: > > On ...
5 years, 7 months ago (2015-05-06 09:14:24 UTC) #34
Erik Corry
LGTM, if you have considered the things in comment 25 and a few missed comments ...
5 years, 7 months ago (2015-05-06 09:27:24 UTC) #35
titzer
https://codereview.chromium.org/1105693002/diff/40001/src/heap/identity-map.h File src/heap/identity-map.h (right): https://codereview.chromium.org/1105693002/diff/40001/src/heap/identity-map.h#newcode65 src/heap/identity-map.h:65: // The value type {V} must be reinterpret_cast'able to ...
5 years, 7 months ago (2015-05-06 09:29:51 UTC) #36
titzer
https://codereview.chromium.org/1105693002/diff/20001/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1105693002/diff/20001/src/heap/heap.cc#newcode5003 src/heap/heap.cc:5003: for (StrongRootsList* list = strong_roots_list_; list; list = list->next_) ...
5 years, 7 months ago (2015-05-06 09:40:36 UTC) #37
Hannes Payer (out of office)
Check out the ASAN bot failures and please add a motivation to the description.
5 years, 7 months ago (2015-05-06 10:20:15 UTC) #38
Hannes Payer (out of office)
LGTM
5 years, 7 months ago (2015-05-06 12:35:48 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1105693002/170001
5 years, 7 months ago (2015-05-06 12:38:56 UTC) #42
commit-bot: I haz the power
Committed patchset #10 (id:170001)
5 years, 7 months ago (2015-05-06 12:40:27 UTC) #43
commit-bot: I haz the power
5 years, 7 months ago (2015-05-06 12:40:43 UTC) #44
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/6d26ec0b4c74b77a3c8079291e9bbc4bb8998aed
Cr-Commit-Position: refs/heads/master@{#28257}

Powered by Google App Engine
This is Rietveld 408576698