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

Issue 891473005: Add WeakKeyMap to v8.h (Closed)

Created:
5 years, 10 months ago by yurys
Modified:
5 years, 10 months ago
CC:
v8-dev, Paweł Hajdan Jr.
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Add WeakKeyMap to v8.h A new map wich references its keys weakly is added to v8.h. Internally it uses the same storage as JSWeakMap but doesn't depend on the JavaScript part of WeakMap implementation in weak-collection.js, hence it can be instantiated without entering any context. BUG=chromium:437416 LOG=Y Committed: https://crrev.com/ee7ed39ac8327124e74dd7ad5f1de0dede988cb7 Cr-Commit-Position: refs/heads/master@{#26425}

Patch Set 1 #

Patch Set 2 : Renamed WeakKeyMap to NativeWeakMap as suggested in review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -35 lines) Patch
M include/v8.h View 1 1 chunk +26 lines, -0 lines 0 comments Download
M src/api.cc View 1 1 chunk +113 lines, -0 lines 0 comments Download
M src/factory.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 chunk +7 lines, -0 lines 0 comments Download
M src/runtime/runtime-collections.cc View 6 chunks +37 lines, -21 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 chunks +73 lines, -0 lines 0 comments Download
M test/cctest/test-weakmaps.cc View 2 chunks +2 lines, -9 lines 0 comments Download
M test/cctest/test-weaksets.cc View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
yurys
This patch is slightly modified version of https://crrev.com/37d4c57630636f21e3add8d3d1c7c978ff5fc8e0 which was reverted due to component build ...
5 years, 10 months ago (2015-02-04 08:22:30 UTC) #2
Michael Starzinger
LGTM on (2), please wait for Andreas about (1).
5 years, 10 months ago (2015-02-04 09:08:15 UTC) #3
rossberg
Michael and I discussed this, and the best we could come up with was NativeWeakMap, ...
5 years, 10 months ago (2015-02-04 11:58:42 UTC) #4
Michael Starzinger
On 2015/02/04 11:58:42, rossberg wrote: > Michael and I discussed this, and the best we ...
5 years, 10 months ago (2015-02-04 11:59:53 UTC) #5
yurys
On 2015/02/04 11:59:53, Michael Starzinger wrote: > On 2015/02/04 11:58:42, rossberg wrote: > > Michael ...
5 years, 10 months ago (2015-02-04 12:07:18 UTC) #7
rossberg
lgtm
5 years, 10 months ago (2015-02-04 12:16:46 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/891473005/20001
5 years, 10 months ago (2015-02-04 12:23:05 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-04 12:52:59 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/ee7ed39ac8327124e74dd7ad5f1de0dede988cb7 Cr-Commit-Position: refs/heads/master@{#26425}
5 years, 10 months ago (2015-02-04 12:53:17 UTC) #12
yurys
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/901663002/ by yurys@chromium.org. ...
5 years, 10 months ago (2015-02-04 15:12:01 UTC) #13
yurys
The error looks weird to me. C4251 warning disabled in several build configurations [1], should ...
5 years, 10 months ago (2015-02-04 15:16:54 UTC) #14
dcarney
On 2015/02/04 15:16:54, yurys wrote: > The error looks weird to me. C4251 warning disabled ...
5 years, 10 months ago (2015-02-04 19:15:42 UTC) #15
yurys
5 years, 10 months ago (2015-02-05 08:39:59 UTC) #16
Message was sent while issue was closed.
On 2015/02/04 19:15:42, dcarney wrote:
> On 2015/02/04 15:16:54, yurys wrote:
> > The error looks weird to me. C4251 warning disabled in several build
> > configurations [1], should we do the same for v8? Otherwise I would have to
> > somehow instantiate v8::UniquePersistent<v8::Object> in v8.h and mark that
> class
> > as exported.
> > 
> > 
> > [1]
> >
>
https://code.google.com/p/chromium/codesearch#search/&q=C4251&sq=package:chro...
> 
> it's generally a bad idea to embed handles into objects.  It's completely
> contrary to of the way the rest of the api is written. in this case, you could
> make the class extend Data, since you want to pretend it's not in the js class
> hierachy and you wouldn't run into the windows warning.

Thanks for your comments, you are absolutely right. Fixed version is up at
https://codereview.chromium.org/900123003/

Powered by Google App Engine
This is Rietveld 408576698