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

Issue 155635: Introduce faster utilty methods for storing and retrieving native pointers (Closed)

Created:
11 years, 5 months ago by antonm
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

Introduce faster utilty methods for storing and retrieving native pointers in internal fields.

Patch Set 1 #

Patch Set 2 : Initial version. Many tnx to Vitaly for discussion and ideas. #

Patch Set 3 : Adding a comment requiring the least bit of pointer to be zero #

Patch Set 4 : using proxies for unaligned pointers (tnx Kasper) and storing pointers directly #

Total comments: 18

Patch Set 5 : next round #

Total comments: 10

Patch Set 6 : last pass #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -0 lines) Patch
M include/v8.h View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 1 chunk +37 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 4 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
antonm
11 years, 5 months ago (2009-07-16 14:23:08 UTC) #1
Dean McNamee
No where do you document that the pointer is expected to be two byte aligned. ...
11 years, 5 months ago (2009-07-16 14:26:09 UTC) #2
Kasper Lund
I think this needs a bit more work. It feels fishy that it doesn't deal ...
11 years, 5 months ago (2009-07-16 14:34:11 UTC) #3
Kasper Lund
If you get rid of the bit fiddling and start using the IsSmi operations instead, ...
11 years, 5 months ago (2009-07-17 08:06:02 UTC) #4
Kasper Lund
One extra comment: http://codereview.chromium.org/155635/diff/8/1011 File src/api.cc (right): http://codereview.chromium.org/155635/diff/8/1011#newcode2490 Line 2490: i::Proxy* proxy = *i::Factory::NewProxy(reinterpret_cast<i::Address>(ptr)); Maybe ...
11 years, 5 months ago (2009-07-17 08:14:38 UTC) #5
antonm
Thanks a lot, Kasper! http://codereview.chromium.org/155635/diff/8/1010 File include/v8.h (right): http://codereview.chromium.org/155635/diff/8/1010#newcode1118 Line 1118: void SetPointerInInternalField(int index, void* ...
11 years, 5 months ago (2009-07-17 09:37:56 UTC) #6
Kasper Lund
LGTM. http://codereview.chromium.org/155635/diff/2001/15 File src/api.cc (right): http://codereview.chromium.org/155635/diff/2001/15#newcode2458 Line 2458: // Fast case, aligned native pointer Terminate ...
11 years, 5 months ago (2009-07-17 10:01:38 UTC) #7
antonm
11 years, 5 months ago (2009-07-17 10:22:43 UTC) #8
Thanks a lot, Kasper!

Submitting.

http://codereview.chromium.org/155635/diff/2001/15
File src/api.cc (right):

http://codereview.chromium.org/155635/diff/2001/15#newcode2458
Line 2458: // Fast case, aligned native pointer
On 2009/07/17 10:01:39, Kasper Lund wrote:
> Terminate comment with .

Done.

http://codereview.chromium.org/155635/diff/2001/15#newcode2464
Line 2464: // Play safe even if it's something unexpected
On 2009/07/17 10:01:39, Kasper Lund wrote:
> Terminate comment with .

Done.

http://codereview.chromium.org/155635/diff/2001/15#newcode2469
Line 2469: // Unaligned native pointer
On 2009/07/17 10:01:39, Kasper Lund wrote:
> Terminate comment with .

Done.

http://codereview.chromium.org/155635/diff/2001/15#newcode2490
Line 2490: if (reinterpret_cast<i::Object*>(value)->IsSmi()) {
On 2009/07/17 10:01:39, Kasper Lund wrote:
> Introduce a local variable to avoid reinterpret_cast'ing the value to
i::Object*
> twice.

Done.

http://codereview.chromium.org/155635/diff/2001/15#newcode2494
Line 2494: // Currently internal fields used by DOM wrappers which
On 2009/07/17 10:01:39, Kasper Lund wrote:
> used -> are used
> which got GCed by mark phases -> which only get GCed by the mark-sweep
collector

Done.

Powered by Google App Engine
This is Rietveld 408576698