[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
darin at apple.com
darin at apple.com
Sun Feb 20 22:56:22 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 27b6fb72868580f38f4ea4b6c2809a90c843dec2
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 14 02:52:53 2011 +0000
<rdar://problem/5469576> Use __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 if available.
Reviewed by Geoff Garen.
* DerivedSources.make: Create a header file, HeaderDetection.h, that tells
us whether pthread_machdep.h is available.
* wtf/FastMalloc.cpp: If __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 is available, then
don't do the pthread_getspecific_function_pointer trick.
(WTF::setThreadHeap): Ditto, but set thread-specific data.
(WTF::TCMalloc_ThreadCache::GetThreadHeap): Ditto, but get rather than set.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 3825ff9..2e03171 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-13 Darin Adler <darin at apple.com>
+
+ Reviewed by Geoff Garen.
+
+ <rdar://problem/5469576> Use __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 if available.
+
+ * DerivedSources.make: Create a header file, HeaderDetection.h, that tells
+ us whether pthread_machdep.h is available.
+ * wtf/FastMalloc.cpp: If __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 is available, then
+ don't do the pthread_getspecific_function_pointer trick.
+ (WTF::setThreadHeap): Ditto, but set thread-specific data.
+ (WTF::TCMalloc_ThreadCache::GetThreadHeap): Ditto, but get rather than set.
+
2011-01-13 Xan Lopez <xlopez at igalia.com>
Reviewed by Gavin Barraclough.
diff --git a/Source/JavaScriptCore/Configurations/Base.xcconfig b/Source/JavaScriptCore/Configurations/Base.xcconfig
index 09b6de1..a189159 100644
--- a/Source/JavaScriptCore/Configurations/Base.xcconfig
+++ b/Source/JavaScriptCore/Configurations/Base.xcconfig
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+// Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
@@ -40,7 +40,7 @@ GCC_MODEL_TUNING = $(GCC_MODEL_TUNING_$(REAL_PLATFORM_NAME));
GCC_MODEL_TUNING_macosx = G5;
GCC_OBJC_CALL_CXX_CDTORS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS);
GCC_STRICT_ALIASING = YES;
GCC_THREADSAFE_STATICS = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make
index 2e8adb4..4de4a88 100644
--- a/Source/JavaScriptCore/DerivedSources.make
+++ b/Source/JavaScriptCore/DerivedSources.make
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -37,20 +37,21 @@ VPATH = \
.PHONY : all
all : \
ArrayPrototype.lut.h \
- chartables.c \
DatePrototype.lut.h \
+ HeaderDetection.h \
JSONObject.lut.h \
+ JavaScriptCore.JSVALUE32.exp \
+ JavaScriptCore.JSVALUE32_64.exp \
+ JavaScriptCore.JSVALUE64.exp \
Lexer.lut.h \
MathObject.lut.h \
NumberConstructor.lut.h \
RegExpConstructor.lut.h \
+ RegExpJitTables.h \
RegExpObject.lut.h \
StringPrototype.lut.h \
+ chartables.c \
docs/bytecode.html \
- RegExpJitTables.h \
- JavaScriptCore.JSVALUE32.exp \
- JavaScriptCore.JSVALUE32_64.exp \
- JavaScriptCore.JSVALUE64.exp \
#
# lookup tables for classes
@@ -68,10 +69,13 @@ chartables.c : dftables
docs/bytecode.html: make-bytecode-docs.pl Interpreter.cpp
perl $^ $@
-#character tables for Yarr
+# character tables for Yarr
+
RegExpJitTables.h: create_regex_tables
python $^ > $@
+# export files
+
JavaScriptCore.JSVALUE32.exp: JavaScriptCore.exp JavaScriptCore.JSVALUE32only.exp
cat $^ > $@
@@ -80,3 +84,8 @@ JavaScriptCore.JSVALUE32_64.exp: JavaScriptCore.exp JavaScriptCore.JSVALUE32_64o
JavaScriptCore.JSVALUE64.exp: JavaScriptCore.exp JavaScriptCore.JSVALUE64only.exp
cat $^ > $@
+
+# header detection
+
+HeaderDetection.h : DerivedSources.make
+ if [ -f $SDKROOT/System/Library/Frameworks/System.framework/PrivateHeaders/pthread_machdep.h ]; then echo "#define HAVE_PTHREAD_MACHDEP_H 1" > $@; else echo > $@; fi
diff --git a/Source/JavaScriptCore/wtf/FastMalloc.cpp b/Source/JavaScriptCore/wtf/FastMalloc.cpp
index 62d7def..42b2812 100644
--- a/Source/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/Source/JavaScriptCore/wtf/FastMalloc.cpp
@@ -1,6 +1,6 @@
// Copyright (c) 2005, 2007, Google Inc.
// All rights reserved.
-// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -442,10 +442,18 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
#endif
+
+#if HAVE(HEADER_DETECTION_H)
+#include "HeaderDetection.h"
+#endif
+
#if HAVE(DISPATCH_H)
#include <dispatch/dispatch.h>
#endif
+#if HAVE(PTHREAD_MACHDEP_H)
+#include <System/pthread_machdep.h>
+#endif
#ifndef PRIuS
#define PRIuS "zu"
@@ -455,7 +463,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
// call to the function on Mac OS X, and it's used in performance-critical code. So we
// use a function pointer. But that's not necessarily faster on other platforms, and we had
// problems with this technique on Windows, so we'll do this only on Mac OS X.
-#if OS(DARWIN)
+#if OS(DARWIN) && !defined(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0)
static void* (*pthread_getspecific_function_pointer)(pthread_key_t) = pthread_getspecific;
#define pthread_getspecific(key) pthread_getspecific_function_pointer(key)
#endif
@@ -2448,11 +2456,18 @@ DWORD tlsIndex = TLS_OUT_OF_INDEXES;
static ALWAYS_INLINE void setThreadHeap(TCMalloc_ThreadCache* heap)
{
- // still do pthread_setspecific when using MSVC fast TLS to
- // benefit from the delete callback.
+ // Still do pthread_setspecific even if there's an alternate form
+ // of thread-local storage in use, to benefit from the delete callback.
pthread_setspecific(heap_key, heap);
+
#if OS(WINDOWS)
TlsSetValue(tlsIndex, heap);
+#elif defined(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0)
+ // Can't have two libraries both doing this in the same process,
+ // so check and make this crash right away.
+ if (_pthread_getspecific_direct(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0))
+ CRASH();
+ _pthread_setspecific_direct(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0, heap);
#endif
}
@@ -2964,6 +2979,8 @@ inline TCMalloc_ThreadCache* TCMalloc_ThreadCache::GetThreadHeap() {
return threadlocal_heap;
#elif OS(WINDOWS)
return static_cast<TCMalloc_ThreadCache*>(TlsGetValue(tlsIndex));
+#elif defined(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0)
+ return static_cast<TCMalloc_ThreadCache*>(_pthread_getspecific_direct(__PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0));
#else
return static_cast<TCMalloc_ThreadCache*>(pthread_getspecific(heap_key));
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list