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

Issue 8372027: Implement Harmony sets and maps. (Closed)

Created:
9 years, 2 months ago by Michael Starzinger
Modified:
9 years, 1 month ago
CC:
v8-dev
Visibility:
Public.

Description

Implement Harmony sets and maps. This implementation extends the internal ObjectHashTable to be able to hold arbitrary objects (e.g. Smis, Strings, ...) as keys by applying specialized hashing functions to primitive types. Equality of keys is defined using the internal SameValue function. R=rossberg@chromium.org BUG=v8:1622 TEST=mjsunit/harmony/collections Committed: http://code.google.com/p/v8/source/detail?r=9777

Patch Set 1 #

Total comments: 18

Patch Set 2 : Fix bogus type-checks in runtime functions. #

Patch Set 3 : Addressed comments by Andreas Rossberg. #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+885 lines, -501 lines) Patch
M src/SConscript View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/bootstrapper.cc View 1 2 2 chunks +22 lines, -8 lines 0 comments Download
A + src/collection.js View 1 2 2 chunks +85 lines, -4 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 +8 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 1 chunk +2 lines, -1 line 2 comments Download
M src/handles.h View 1 1 chunk +7 lines, -1 line 0 comments Download
M src/handles.cc View 1 1 chunk +17 lines, -1 line 0 comments Download
M src/objects.h View 1 2 8 chunks +102 lines, -11 lines 2 comments Download
M src/objects.cc View 1 2 5 chunks +106 lines, -7 lines 0 comments Download
M src/objects-debug.cc View 2 chunks +22 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 14 chunks +59 lines, -188 lines 0 comments Download
M src/objects-visiting.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/runtime.h View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 1 chunk +76 lines, -0 lines 0 comments Download
M src/utils.h View 1 chunk +12 lines, -0 lines 0 comments Download
M src/v8.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
D src/weakmap.js View 1 2 1 chunk +0 lines, -98 lines 0 comments Download
A test/mjsunit/harmony/collections.js View 1 2 1 chunk +273 lines, -0 lines 6 comments Download
M test/mjsunit/harmony/proxies-hash.js View 1 2 1 chunk +68 lines, -12 lines 0 comments Download
M test/mjsunit/harmony/weakmaps.js View 1 2 1 chunk +0 lines, -167 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Michael Starzinger
PTAL.
9 years, 2 months ago (2011-10-24 09:13:17 UTC) #1
rossberg
http://codereview.chromium.org/8372027/diff/1/src/collection.js File src/collection.js (right): http://codereview.chromium.org/8372027/diff/1/src/collection.js#newcode31 src/collection.js:31: // const $Object = global.Object; Not needed? http://codereview.chromium.org/8372027/diff/1/src/flag-definitions.h File ...
9 years, 2 months ago (2011-10-24 15:44:10 UTC) #2
Michael Starzinger
Added new patch set. PTAL. http://codereview.chromium.org/8372027/diff/1/src/collection.js File src/collection.js (right): http://codereview.chromium.org/8372027/diff/1/src/collection.js#newcode31 src/collection.js:31: // const $Object = ...
9 years, 2 months ago (2011-10-25 11:17:26 UTC) #3
rossberg
lgtm http://codereview.chromium.org/8372027/diff/3024/src/flag-definitions.h File src/flag-definitions.h (right): http://codereview.chromium.org/8372027/diff/3024/src/flag-definitions.h#newcode104 src/flag-definitions.h:104: "enable harmony collections (sets, maps and weak maps)") ...
9 years, 2 months ago (2011-10-25 13:53:59 UTC) #4
Erik Corry
http://codereview.chromium.org/8372027/diff/3024/src/flag-definitions.h File src/flag-definitions.h (right): http://codereview.chromium.org/8372027/diff/3024/src/flag-definitions.h#newcode104 src/flag-definitions.h:104: "enable harmony collections (sets, maps and weak maps)") On ...
9 years, 2 months ago (2011-10-25 19:36:00 UTC) #5
arv (Not doing code reviews)
lgtm Drive by. This is awesome. I can't wait for this to hit Chromium. Is ...
9 years, 1 month ago (2011-10-26 17:09:44 UTC) #6
Michael Starzinger
9 years, 1 month ago (2011-10-27 15:36:05 UTC) #7
Thanks for the drive-by!

http://codereview.chromium.org/8372027/diff/3024/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/8372027/diff/3024/src/objects.h#newcode7022
src/objects.h:7022: // The JSSet describes EcmaScript Harmony maps
On 2011/10/26 17:09:44, arv wrote:
> nit 
> 
> // The JSSet describes EcmaScript Harmony *sets*

Done (will include in next CL).

http://codereview.chromium.org/8372027/diff/3024/test/mjsunit/harmony/collect...
File test/mjsunit/harmony/collections.js (right):

http://codereview.chromium.org/8372027/diff/3024/test/mjsunit/harmony/collect...
test/mjsunit/harmony/collections.js:72: for (i = 0; i < 20; i++) {
On 2011/10/26 17:09:44, arv wrote:
> missing var

Done (will include in next CL).

http://codereview.chromium.org/8372027/diff/3024/test/mjsunit/harmony/collect...
test/mjsunit/harmony/collections.js:102: var keys = [ +0, -0, +Infinity,
-Infinity, true, false ];
On 2011/10/26 17:09:44, arv wrote:
> is it worth testing NaN, undefined and null too?

Currently "undefined" and "null" cannot be used as keys to Maps, I am working on
that. The test for correct "NaN" handling is further down at line 203.

http://codereview.chromium.org/8372027/diff/3024/test/mjsunit/harmony/collect...
test/mjsunit/harmony/collections.js:187: for (i = 0; i < 20; i++) {
On 2011/10/26 17:09:44, arv wrote:
> var

Done (will include in next CL).

Powered by Google App Engine
This is Rietveld 408576698