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

Issue 6706018: Fix fast TLS support on Mac. (Closed)

Created:
9 years, 8 months ago by Vitaly Repeshko
Modified:
9 years, 3 months ago
CC:
v8-dev
Visibility:
Public.

Description

Fix fast TLS support on Mac.

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressing review comment #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -7 lines) Patch
M src/platform-macos.cc View 2 chunks +70 lines, -1 line 5 comments Download
M src/platform-tls-mac.h View 1 1 chunk +6 lines, -6 lines 2 comments Download

Messages

Total messages: 12 (0 generated)
Vitaly Repeshko
9 years, 8 months ago (2011-04-01 13:35:34 UTC) #1
Mark Mentovai
I haven’t tested this yet. http://codereview.chromium.org/6706018/diff/1/src/platform-tls-mac.h File src/platform-tls-mac.h (right): http://codereview.chromium.org/6706018/diff/1/src/platform-tls-mac.h#newcode48 src/platform-tls-mac.h:48: asm("movl %%gs:(%1), %0;" It ...
9 years, 8 months ago (2011-04-01 14:28:01 UTC) #2
Avi (use Gerrit)
http://codereview.chromium.org/6706018/diff/1/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/1/src/platform-macos.cc#newcode548 src/platform-macos.cc:548: } else if kernel_version_major == 11, else can we ...
9 years, 8 months ago (2011-04-01 15:40:57 UTC) #3
Vitaly Repeshko
http://codereview.chromium.org/6706018/diff/1/src/platform-tls-mac.h File src/platform-tls-mac.h (right): http://codereview.chromium.org/6706018/diff/1/src/platform-tls-mac.h#newcode48 src/platform-tls-mac.h:48: asm("movl %%gs:(%1), %0;" On 2011/04/01 14:28:01, Mark Mentovai wrote: ...
9 years, 8 months ago (2011-04-01 15:45:17 UTC) #4
Vitaly Repeshko
http://codereview.chromium.org/6706018/diff/1/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/1/src/platform-macos.cc#newcode548 src/platform-macos.cc:548: } On 2011/04/01 15:40:57, Avi wrote: > else if ...
9 years, 8 months ago (2011-04-01 15:48:30 UTC) #5
Mark Mentovai
I’m going to test this patch shortly. http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc#newcode546 src/platform-macos.cc:546: // 11.x.x ...
9 years, 8 months ago (2011-04-01 16:37:16 UTC) #6
Avi (use Gerrit)
http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc#newcode546 src/platform-macos.cc:546: // 11.x.x (Lion) changed the offset. On 2011/04/01 16:37:16, ...
9 years, 8 months ago (2011-04-01 16:41:52 UTC) #7
Vitaly Repeshko
http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc#newcode546 src/platform-macos.cc:546: // 11.x.x (Lion) changed the offset. On 2011/04/01 16:41:52, ...
9 years, 8 months ago (2011-04-01 16:47:54 UTC) #8
Mark Mentovai
I’ve tested this now and it works as advertised. LGTM as-is if you prefer, your ...
9 years, 8 months ago (2011-04-01 17:54:25 UTC) #9
Vitaly Repeshko
Thanks a lot for reviewing and testing this! Landed on bleeding_edge in r7488. This should ...
9 years, 8 months ago (2011-04-04 05:54:57 UTC) #10
fschneider
One comment. LGTM otherwise. http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc File src/platform-macos.cc (right): http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc#newcode515 src/platform-macos.cc:515: intptr_t kMacTlsBaseOffset = 0; not ...
9 years, 8 months ago (2011-04-04 07:39:26 UTC) #11
Vitaly Repeshko
9 years, 8 months ago (2011-04-04 21:15:43 UTC) #12
http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc
File src/platform-macos.cc (right):

http://codereview.chromium.org/6706018/diff/2002/src/platform-macos.cc#newcod...
src/platform-macos.cc:515: intptr_t kMacTlsBaseOffset = 0;
On 2011/04/04 07:39:26, fschneider wrote:
> not sure: Can you guarantee that writes to kMacTlsBaseOffset are atomic? e.g.
> unaligned store, splitting a cache line or the like.
> 
> Maybe make this use atomic-ops to for initializing, reading should still be
> fast, right?

Good question. Technically to prevent the offset from temporarily being in an
inconsistent state we should either use atomic ops when both storing and loading
it or use a mutex in the initialization code. But given that we know it all
happens on either ia32 or x64 (platform-tls-mac checks it) and given that the
linker must allocate the offset naturally aligned, we can rely on it being
stored/loaded atomically.

Powered by Google App Engine
This is Rietveld 408576698