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

Issue 48923002: Provide private symbols through internal APIs (Closed)

Created:
7 years, 1 month ago by rossberg
Modified:
7 years, 1 month ago
CC:
v8-dev, Paweł Hajdan Jr., dcarney, Michael Starzinger
Visibility:
Public.

Description

Provide private symbols through internal APIs Adds a notion of private symbols, mainly intended for internal use, especially, self-hosting of built-in types that would otherwise require new C++ classes. On the JS side (i.e., in built-ins), private properties can be created and accessed through a set of macros: NEW_PRIVATE(print_name) HAS_PRIVATE(obj, sym) GET_PRIVATE(obj, sym) SET_PRIVATE(obj, sym, val) DELETE_PRIVATE(obj, sym) In the V8 API, they are accessible via a new class Private, and respective HasPrivate/Get/Private/SetPrivate/DeletePrivate methods on calss Object. These APIs are designed and restricted such that their implementation can later be replaced by whatever ES7+ will officially provide. R=yangguo@chromium.org BUG= Committed: http://code.google.com/p/v8/source/detail?r=17683

Patch Set 1 #

Patch Set 2 : Forgot added file #

Patch Set 3 : Make privates a non-value; comments #

Total comments: 6

Patch Set 4 : Comments #

Total comments: 4

Patch Set 5 : Mo comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+286 lines, -118 lines) Patch
M include/v8.h View 1 2 3 4 chunks +34 lines, -5 lines 0 comments Download
M src/api.cc View 1 2 3 6 chunks +45 lines, -10 lines 0 comments Download
M src/array-iterator.js View 1 2 3 chunks +11 lines, -11 lines 0 comments Download
M src/factory.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 3 chunks +14 lines, -1 line 0 comments Download
M src/macros.py View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/messages.js View 4 chunks +38 lines, -33 lines 0 comments Download
M src/objects.h View 1 2 3 4 chunks +12 lines, -4 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.cc View 1 chunk +1 line, -2 lines 0 comments Download
M src/runtime.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 chunks +38 lines, -20 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/private.js View 1 2 3 5 chunks +5 lines, -32 lines 0 comments Download
M test/mjsunit/harmony/symbols.js View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
rossberg
7 years, 1 month ago (2013-10-28 15:08:56 UTC) #1
arv (Not doing code reviews)
This is really great. Thanks for doing this. Did you forget these ones? https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/array-iterator.js&l=39 Should ...
7 years, 1 month ago (2013-10-28 21:58:19 UTC) #2
rossberg
On 2013/10/28 21:58:19, arv wrote: > Did you forget these ones? > > https://code.google.com/p/chromium/codesearch#chromium/src/v8/src/array-iterator.js&l=39 Ah, ...
7 years, 1 month ago (2013-10-29 12:01:16 UTC) #3
Yang
We got a bunch of call sites to Symbol::name that does not check for private, ...
7 years, 1 month ago (2013-10-29 12:47:25 UTC) #4
arv (Not doing code reviews)
On 2013/10/29 12:01:16, rossberg wrote: > What's currently missing is the ability to install private ...
7 years, 1 month ago (2013-10-29 13:20:43 UTC) #5
rossberg
https://codereview.chromium.org/48923002/diff/70001/src/api.cc File src/api.cc (right): https://codereview.chromium.org/48923002/diff/70001/src/api.cc#newcode6201 src/api.cc:6201: return Utils::ToLocal(result); On 2013/10/29 12:47:26, Yang wrote: > I ...
7 years, 1 month ago (2013-10-29 15:08:19 UTC) #6
rossberg
On 2013/10/29 13:20:43, arv wrote: > On 2013/10/29 12:01:16, rossberg wrote: > > > What's ...
7 years, 1 month ago (2013-10-29 15:10:06 UTC) #7
Yang
On 2013/10/29 15:10:06, rossberg wrote: > On 2013/10/29 13:20:43, arv wrote: > > On 2013/10/29 ...
7 years, 1 month ago (2013-11-05 13:50:54 UTC) #8
Michael Starzinger
Small drive-by. I like this change. https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc#newcode4868 src/runtime.cc:4868: if (name.is_null()) return ...
7 years, 1 month ago (2013-11-05 14:54:21 UTC) #9
rossberg
On 2013/11/05 13:50:54, Yang wrote: > Instead of a flag field, why not a new ...
7 years, 1 month ago (2013-11-11 15:19:35 UTC) #10
rossberg
https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc#newcode4868 src/runtime.cc:4868: if (name.is_null()) return Failure::Exception(); On 2013/11/05 14:54:21, Michael Starzinger ...
7 years, 1 month ago (2013-11-11 15:20:05 UTC) #11
Yang
On 2013/11/11 15:20:05, rossberg wrote: > https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc > File src/runtime.cc (right): > > https://codereview.chromium.org/48923002/diff/150001/src/runtime.cc#newcode4868 > ...
7 years, 1 month ago (2013-11-13 10:05:09 UTC) #12
rossberg
7 years, 1 month ago (2013-11-13 10:34:21 UTC) #13
Message was sent while issue was closed.
Committed patchset #5 manually as r17683 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698