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

Unified Diff: src/platform-tls-mac.h

Issue 6706018: Fix fast TLS support on Mac. (Closed)
Patch Set: Addressing review comment Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/platform-macos.cc ('K') | « src/platform-macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-tls-mac.h
diff --git a/src/platform-tls-mac.h b/src/platform-tls-mac.h
index 86a3347d0f710825808a231031a4f81851b15ffa..728524e80bdcfed8afae67bc4717d070ad52100e 100644
--- a/src/platform-tls-mac.h
+++ b/src/platform-tls-mac.h
@@ -37,20 +37,20 @@ namespace internal {
#define V8_FAST_TLS_SUPPORTED 1
+extern intptr_t kMacTlsBaseOffset;
+
INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index));
inline intptr_t InternalGetExistingThreadLocal(intptr_t index) {
- // The constants below are taken from pthreads.s from the XNU kernel
- // sources archive at www.opensource.apple.com.
intptr_t result;
#if defined(V8_HOST_ARCH_IA32)
- asm("movl %%gs:0x48(,%1,4), %0;"
+ asm("movl %%gs:(%1,%2,4), %0;"
:"=r"(result) // Output must be a writable register.
- :"0"(index)); // Input is the same as output.
+ :"r"(kMacTlsBaseOffset), "r"(index));
Mark Mentovai 2011/04/01 16:37:16 You might do better by letting the output share a
Vitaly Repeshko 2011/04/01 16:47:55 GCC docs say the compiler is free to reuse a regis
#else
- asm("movq %%gs:0x60(,%1,8), %0;"
+ asm("movq %%gs:(%1,%2,8), %0;"
:"=r"(result)
- :"0"(index));
+ :"r"(kMacTlsBaseOffset), "r"(index));
#endif
return result;
}
« src/platform-macos.cc ('K') | « src/platform-macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698