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

Issue 203243004: Implement ES6 symbol registry and predefined symbols (Closed)

Created:
6 years, 9 months ago by rossberg
Modified:
6 years, 9 months ago
CC:
v8-dev, Paweł Hajdan Jr., sof
Visibility:
Public.

Description

Implement ES6 symbol registry and predefined symbols R=mstarzinger@chromium.org, arv@chromium.org BUG= LOG=Y Committed: https://code.google.com/p/v8/source/detail?r=20118

Patch Set 1 #

Patch Set 2 : Test parameter types #

Total comments: 17

Patch Set 3 : Comments addressed #

Patch Set 4 : Fixed bug #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -12 lines) Patch
M include/v8.h View 1 2 3 1 chunk +1 line, -1 line 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 1 chunk +8 lines, -0 lines 0 comments Download
M src/messages.js View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/symbol.js View 1 2 3 2 chunks +64 lines, -0 lines 8 comments Download
M test/mjsunit/harmony/private.js View 1 chunk +14 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/symbols.js View 1 2 1 chunk +38 lines, -11 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
rossberg
6 years, 9 months ago (2014-03-18 16:26:15 UTC) #1
sof
https://codereview.chromium.org/203243004/diff/20001/src/symbol.js File src/symbol.js (right): https://codereview.chromium.org/203243004/diff/20001/src/symbol.js#newcode100 src/symbol.js:100: throw MakeTypeError("not_a_symbol", ["Symbol.keyFor", symbol]); Looks like 'symbol' (%1) isn't ...
6 years, 9 months ago (2014-03-19 09:06:46 UTC) #2
Michael Starzinger
LGTM if comments are addressed. https://codereview.chromium.org/203243004/diff/20001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/203243004/diff/20001/src/runtime.cc#newcode640 src/runtime.cc:640: HandleScope scope(isolate); nit: Not ...
6 years, 9 months ago (2014-03-19 10:15:25 UTC) #3
rossberg
https://codereview.chromium.org/203243004/diff/20001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/203243004/diff/20001/src/runtime.cc#newcode640 src/runtime.cc:640: HandleScope scope(isolate); On 2014/03/19 10:15:25, Michael Starzinger wrote: > ...
6 years, 9 months ago (2014-03-20 10:40:13 UTC) #4
sof
https://codereview.chromium.org/203243004/diff/20001/src/symbol.js File src/symbol.js (right): https://codereview.chromium.org/203243004/diff/20001/src/symbol.js#newcode121 src/symbol.js:121: var symbolCreate = SymbolHook("@@create"); On 2014/03/20 10:40:13, rossberg wrote: ...
6 years, 9 months ago (2014-03-20 10:49:06 UTC) #5
rossberg
https://codereview.chromium.org/203243004/diff/20001/src/symbol.js File src/symbol.js (right): https://codereview.chromium.org/203243004/diff/20001/src/symbol.js#newcode121 src/symbol.js:121: var symbolCreate = SymbolHook("@@create"); On 2014/03/20 10:49:06, sof wrote: ...
6 years, 9 months ago (2014-03-20 11:05:20 UTC) #6
rossberg
Committed patchset #4 manually as r20118.
6 years, 9 months ago (2014-03-20 12:26:38 UTC) #7
arv (Not doing code reviews)
The important functionality: LGTM I'm not sure that we should install Symbol.x if we do ...
6 years, 9 months ago (2014-03-22 17:15:49 UTC) #8
rossberg
On 2014/03/22 17:15:49, arv wrote: > I'm not sure that we should install Symbol.x if ...
6 years, 9 months ago (2014-03-24 10:25:46 UTC) #9
rossberg
https://codereview.chromium.org/203243004/diff/50010/src/symbol.js File src/symbol.js (right): https://codereview.chromium.org/203243004/diff/50010/src/symbol.js#newcode68 src/symbol.js:68: if (!('internal' in registry)) { On 2014/03/22 17:15:49, arv ...
6 years, 9 months ago (2014-03-24 10:25:53 UTC) #10
arv (Not doing code reviews)
Thanks for the follow up. https://codereview.chromium.org/203243004/diff/50010/src/symbol.js File src/symbol.js (right): https://codereview.chromium.org/203243004/diff/50010/src/symbol.js#newcode121 src/symbol.js:121: var symbolCreate = InternalSymbol("@@create"); ...
6 years, 9 months ago (2014-03-24 15:18:57 UTC) #11
rossberg
6 years, 9 months ago (2014-03-24 15:37:56 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/203243004/diff/50010/src/symbol.js
File src/symbol.js (right):

https://codereview.chromium.org/203243004/diff/50010/src/symbol.js#newcode121
src/symbol.js:121: var symbolCreate = InternalSymbol("@@create");
On 2014/03/24 15:18:57, arv wrote:
> On 2014/03/24 10:25:53, rossberg wrote:
> > On 2014/03/22 17:15:49, arv wrote:
> > > Doesn't '@' in a property name cause the object to become slow?
> > 
> > Objects should be completely ignorant to symbol descriptions. Am I missing
> > something?
> > 
> > > The [[Description]] should be "Symbol.create".
> > > 
> > >
>
http://people.mozilla.org/%25257Ejorendorff/es6-draft.html#sec-well-known-sym...
> > 
> > Done.
> 
> You use the key on line 80. If we have a non identifier key we end up with a
> slow object instead of an object with a hidden class for registry.internal.
> However, I doubt this is an issue since the calls to InternalSymbol is
limited.

You're right. The dot will have the same effect, though.

But: I don't think it's an issue, quite the opposite -- this object is meant to
be a dictionary. It would actually be preferable to force this and the other
objects to be in dictionary mode from the get-go, to avoid unnecessary
transitions and polymorphism. I'll add that to the other CL.

Powered by Google App Engine
This is Rietveld 408576698