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

Issue 12459026: ES6 symbols: implement name property (Closed)

Created:
7 years, 9 months ago by rossberg
Modified:
7 years, 9 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

ES6 symbols: implement name property Adds string-valued name property to symbols, and uses it for pretty-printing. Requires allocating symbols in pointer space, with a custom iterator to skip the unboxed hash. R=mstarzinger@chromium.org BUG= Committed: http://code.google.com/p/v8/source/detail?r=14053

Patch Set 1 #

Patch Set 2 : Add missing scavenge visitor #

Total comments: 8

Patch Set 3 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -26 lines) Patch
M src/d8.js View 1 chunk +2 lines, -1 line 0 comments Download
M src/heap.cc View 1 3 chunks +7 lines, -2 lines 0 comments Download
M src/heap-inl.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/log.cc View 9 chunks +79 lines, -12 lines 0 comments Download
M src/objects.h View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 2 chunks +11 lines, -2 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects-visiting.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-visiting.cc View 1 chunk +1 line, -3 lines 0 comments Download
M src/objects-visiting-inl.h View 2 chunks +10 lines, -0 lines 0 comments Download
M src/runtime.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime.cc View 1 2 1 chunk +16 lines, -2 lines 0 comments Download
M src/symbol.js View 1 2 3 chunks +13 lines, -1 line 0 comments Download
M test/mjsunit/harmony/symbols.js View 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rossberg
7 years, 9 months ago (2013-03-21 13:11:08 UTC) #1
Michael Starzinger
LGTM if comments are addressed. https://codereview.chromium.org/12459026/diff/2002/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/12459026/diff/2002/src/objects.cc#newcode1467 src/objects.cc:1467: String::cast(symbol->name())->StringShortPrint(accumulator); I think there ...
7 years, 9 months ago (2013-03-22 12:03:24 UTC) #2
rossberg
7 years, 9 months ago (2013-03-22 13:02:41 UTC) #3
https://codereview.chromium.org/12459026/diff/2002/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/12459026/diff/2002/src/objects.cc#newcode1467
src/objects.cc:1467:
String::cast(symbol->name())->StringShortPrint(accumulator);
On 2013/03/22 12:03:25, Michael Starzinger wrote:
> I think there is a white-space missing between the hash and the name in the
> printout.

That actually was intentional, but I added a space anyway. :)

https://codereview.chromium.org/12459026/diff/2002/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/12459026/diff/2002/src/objects.h#newcode7401
src/objects.h:7401: DECL_ACCESSORS(name, Object)
On 2013/03/22 12:03:25, Michael Starzinger wrote:
> Maybe it might make sense to add a short one-line comment of what the
semantics
> of this field are, e.g.:
> 
> // [name]: The string representation of this symbol or undefined.

Done.

https://codereview.chromium.org/12459026/diff/2002/src/runtime.cc
File src/runtime.cc (right):

https://codereview.chromium.org/12459026/diff/2002/src/runtime.cc#newcode688
src/runtime.cc:688: Handle<Object> name(args[0], isolate);
On 2013/03/22 12:03:25, Michael Starzinger wrote:
> If you use the following instead, you can get by without allocating a handle
and
> hence with a NoHandleAllocation scope instead.
> 
> Handle<Object> name = args.at<Object>(0);
> 
> We might even support the following by now, not sure though. I would prefer
the
> second if possible.
> 
> CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);

Done.

https://codereview.chromium.org/12459026/diff/2002/src/symbol.js
File src/symbol.js (right):

https://codereview.chromium.org/12459026/diff/2002/src/symbol.js#newcode45
src/symbol.js:45: throw new $TypeError("Symbol.prototype.name is not generic");
On 2013/03/22 12:03:25, Michael Starzinger wrote:
> Use MakeTypeError here, see my comments in the previous CL about this.

Done.

Powered by Google App Engine
This is Rietveld 408576698