[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-21 Thread erikcorry
On 2015/05/19 17:39:38, adamk wrote: https://codereview.chromium.org/1142493002/diff/1/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/1142493002/diff/1/src/objects.cc#newcode5039 src/objects.cc:5039: return JSGlobalProxy::cast(this)->hash(); To expand slightly on T

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-19 Thread adamk
https://codereview.chromium.org/1142493002/diff/1/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/1142493002/diff/1/src/objects.cc#newcode5039 src/objects.cc:5039: return JSGlobalProxy::cast(this)->hash(); To expand slightly on Toon's explanation, here's the codepath

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-15 Thread verwaest
https://codereview.chromium.org/1142493002/diff/1/src/collection.js File src/collection.js (right): https://codereview.chromium.org/1142493002/diff/1/src/collection.js#newcode85 src/collection.js:85: if (IS_SPEC_OBJECT(key)) { On 2015/05/14 15:42:19, Erik Corry wrote: On 2015/05/14 15:01:27, ad

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread arv
https://codereview.chromium.org/1142493002/diff/1/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/1142493002/diff/1/src/isolate.cc#newcode791 src/isolate.cc:791: return name == heap()->hidden_string(); Does this one need to be updated too? https://codereview.chromium

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread erik . corry
https://codereview.chromium.org/1142493002/diff/1/src/collection.js File src/collection.js (right): https://codereview.chromium.org/1142493002/diff/1/src/collection.js#newcode85 src/collection.js:85: if (IS_SPEC_OBJECT(key)) { On 2015/05/14 15:01:27, adamk wrote: You might need a TODO here for

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread adamk
This looks great, I didn't realize how easy it was to add properties to a non-extensible object. I'm on vacation through Monday, so won't get back to this until next week. The only thing that I'm worried about is the question about the global below. https://codereview.chromium.org/1142493002

Re: [v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread Erik Arvidsson
On May 14, 2015 9:18 AM, wrote: > > Surely it always caused a map transition. How else can you add the hidden > property? Yeah. I realized that too. I agree that this is much cleaner. > > The change was to make an already existing test pass, but I can add another. > > > https://codereview.chromi

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread erik . corry
Surely it always caused a map transition. How else can you add the hidden property? The change was to make an already existing test pass, but I can add another. https://codereview.chromium.org/1142493002/ -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread arv
High level comments: 1. We have a perf test for maps. We should add a new case for objects as keys. 2. I assume the change to Isolate::IsInternallyUsedPropertyName makes us able to add this property to non extensible objects? (Needs tests?) 3. One drawback with this is that adding an object

[v8-dev] Re: Use a private own symbol instead of a hidden property for hash codes (issue 1142493002 by erikco...@chromium.org)

2015-05-14 Thread erik . corry
On my microbenchmark this doubles the speed of common operations on ES6 Map. I think it's a simplification too. Before (times in ms): Read 514 Update 1083 Set/delete 2075 After: Read 231 Update 484 Set/delete 1619 The microbenchmark: function MyKey() { this.x = "foo"; } function setu