Title: [174110] trunk/Source
Revision
174110
Author
[email protected]
Date
2014-09-30 11:40:32 -0700 (Tue, 30 Sep 2014)

Log Message

REGRESSION (r172532): JSBase.h declares NSMapTable functions that are SPI
https://bugs.webkit.org/show_bug.cgi?id=137170
<rdar://problem/18477384>

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

Move conditional include of header Foundation/NSMapTablePriv.h and forward declarations
of NSMapTable SPI from file _javascript_Core/API/JSBase.h to WTF/wtf/spi/cocoa/NSMapTableSPI.h.

* API/JSBase.h:
* API/JSManagedValue.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h.
* API/JSVirtualMachine.mm: Ditto.
* API/JSVirtualMachineInternal.h: Forward declare class NSMapTable.
* API/JSWrapperMap.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h. Also, order
#include directives such that they are sorted in alphabetical order.

Source/WTF:

Add SPI wrapper header, NSMapTableSPI.h.

Additionally, define convenience macro EXTERN_C that can be used to specify the C linkage
convention for a declaration. For example, the declaration "EXTERN_C const int x;" will
expand to:

extern const int x;

and

extern "C" const int x;

when used in a C and C++ file, respectively.

* WTF.xcodeproj/project.pbxproj:
* wtf/Compiler.h:
* wtf/spi/cocoa/NSMapTableSPI.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSBase.h (174109 => 174110)


--- trunk/Source/_javascript_Core/API/JSBase.h	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/API/JSBase.h	2014-09-30 18:40:32 UTC (rev 174110)
@@ -32,26 +32,8 @@
 
 #ifdef __OBJC__
 #import <Foundation/Foundation.h>
-
-#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
-#if __has_include(<Foundation/NSMapTablePriv.h>)
-#import <Foundation/NSMapTablePriv.h>
-#else
-
-#ifndef __cplusplus
-extern "C" {
 #endif
-    void *NSMapGet(NSMapTable *, const void *key);
-    void NSMapInsert(NSMapTable *, const void *key, const void *value);
-    void NSMapRemove(NSMapTable *, const void *key);
 
-#ifndef __cplusplus
-}
-#endif
-#endif
-#endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
-#endif // __OBJC__
-
 /* _javascript_ engine interface */
 
 /*! @typedef JSContextGroupRef A group that associates _javascript_ contexts with one another. Contexts in the same group may share and exchange _javascript_ objects. */

Modified: trunk/Source/_javascript_Core/API/JSManagedValue.mm (174109 => 174110)


--- trunk/Source/_javascript_Core/API/JSManagedValue.mm	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/API/JSManagedValue.mm	2014-09-30 18:40:32 UTC (rev 174110)
@@ -37,6 +37,7 @@
 #import "WeakHandleOwner.h"
 #import "ObjcRuntimeExtras.h"
 #import "JSCInlines.h"
+#import <wtf/spi/cocoa/NSMapTableSPI.h>
 
 class JSManagedValueHandleOwner : public JSC::WeakHandleOwner {
 public:

Modified: trunk/Source/_javascript_Core/API/JSVirtualMachine.mm (174109 => 174110)


--- trunk/Source/_javascript_Core/API/JSVirtualMachine.mm	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachine.mm	2014-09-30 18:40:32 UTC (rev 174110)
@@ -37,6 +37,7 @@
 #import "SlotVisitorInlines.h"
 #import <mutex>
 #import <wtf/NeverDestroyed.h>
+#import <wtf/spi/cocoa/NSMapTableSPI.h>
 
 static NSMapTable *globalWrapperCache = 0;
 

Modified: trunk/Source/_javascript_Core/API/JSVirtualMachineInternal.h (174109 => 174110)


--- trunk/Source/_javascript_Core/API/JSVirtualMachineInternal.h	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachineInternal.h	2014-09-30 18:40:32 UTC (rev 174110)
@@ -36,6 +36,8 @@
 }
 
 #if defined(__OBJC__)
+@class NSMapTable;
+
 @interface JSVirtualMachine(Internal)
 
 JSContextGroupRef getGroupFromVirtualMachine(JSVirtualMachine *);

Modified: trunk/Source/_javascript_Core/API/JSWrapperMap.mm (174109 => 174110)


--- trunk/Source/_javascript_Core/API/JSWrapperMap.mm	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/API/JSWrapperMap.mm	2014-09-30 18:40:32 UTC (rev 174110)
@@ -30,16 +30,17 @@
 
 #import "APICast.h"
 #import "JSAPIWrapperObject.h"
+#import "JSCInlines.h"
 #import "JSCallbackObject.h"
 #import "JSContextInternal.h"
 #import "JSWrapperMap.h"
 #import "ObjCCallbackFunction.h"
 #import "ObjcRuntimeExtras.h"
-#import "JSCInlines.h"
 #import "WeakGCMap.h"
+#import <wtf/HashSet.h>
 #import <wtf/TCSpinLock.h>
 #import <wtf/Vector.h>
-#import <wtf/HashSet.h>
+#import <wtf/spi/cocoa/NSMapTableSPI.h>
 
 #include <mach-o/dyld.h>
 

Modified: trunk/Source/_javascript_Core/ChangeLog (174109 => 174110)


--- trunk/Source/_javascript_Core/ChangeLog	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-09-30 18:40:32 UTC (rev 174110)
@@ -1,3 +1,21 @@
+2014-09-30  Daniel Bates  <[email protected]>
+
+        REGRESSION (r172532): JSBase.h declares NSMapTable functions that are SPI
+        https://bugs.webkit.org/show_bug.cgi?id=137170
+        <rdar://problem/18477384>
+
+        Reviewed by Geoffrey Garen.
+
+        Move conditional include of header Foundation/NSMapTablePriv.h and forward declarations
+        of NSMapTable SPI from file _javascript_Core/API/JSBase.h to WTF/wtf/spi/cocoa/NSMapTableSPI.h.
+
+        * API/JSBase.h:
+        * API/JSManagedValue.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h.
+        * API/JSVirtualMachine.mm: Ditto.
+        * API/JSVirtualMachineInternal.h: Forward declare class NSMapTable.
+        * API/JSWrapperMap.mm: Include header WTF/wtf/spi/cocoa/NSMapTableSPI.h. Also, order
+        #include directives such that they are sorted in alphabetical order.
+
 2014-09-30  Oliver Hunt  <[email protected]>
 
         Fix C API header

Modified: trunk/Source/WTF/ChangeLog (174109 => 174110)


--- trunk/Source/WTF/ChangeLog	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/WTF/ChangeLog	2014-09-30 18:40:32 UTC (rev 174110)
@@ -1,3 +1,29 @@
+2014-09-30  Daniel Bates  <[email protected]>
+
+        REGRESSION (r172532): JSBase.h declares NSMapTable functions that are SPI
+        https://bugs.webkit.org/show_bug.cgi?id=137170
+        <rdar://problem/18477384>
+
+        Reviewed by Geoffrey Garen.
+
+        Add SPI wrapper header, NSMapTableSPI.h.
+
+        Additionally, define convenience macro EXTERN_C that can be used to specify the C linkage
+        convention for a declaration. For example, the declaration "EXTERN_C const int x;" will
+        expand to:
+
+        extern const int x;
+
+        and
+
+        extern "C" const int x;
+
+        when used in a C and C++ file, respectively.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/Compiler.h:
+        * wtf/spi/cocoa/NSMapTableSPI.h: Added.
+
 2014-09-29  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r174045.

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (174109 => 174110)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2014-09-30 18:40:32 UTC (rev 174110)
@@ -274,6 +274,7 @@
 		B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
 		CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
 		CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; };
+		CE46516E19DB1FB4003ECA05 /* NSMapTableSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */; };
 		E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; };
 		E15556F618A0CC18006F48FB /* CryptographicUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E15556F418A0CC18006F48FB /* CryptographicUtilities.h */; };
 		EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; };
@@ -564,6 +565,7 @@
 		B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
 		CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
 		CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = "<group>"; };
+		CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSMapTableSPI.h; sourceTree = "<group>"; };
 		E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicUtilities.cpp; sourceTree = "<group>"; };
 		E15556F418A0CC18006F48FB /* CryptographicUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptographicUtilities.h; sourceTree = "<group>"; };
 		EB95E1EF161A72410089A2F5 /* ByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteOrder.h; sourceTree = "<group>"; };
@@ -692,6 +694,7 @@
 				A8A4731B151A825B004123FF /* text */,
 				A8A47339151A825B004123FF /* threads */,
 				A8A47348151A825B004123FF /* unicode */,
+				CEF4820C19DA347600CC04B8 /* spi */,
 				A8A4725A151A825A004123FF /* ASCIICType.h */,
 				A8A4725B151A825A004123FF /* Assertions.cpp */,
 				A8A4725C151A825A004123FF /* Assertions.h */,
@@ -989,6 +992,22 @@
 			path = icu;
 			sourceTree = "<group>";
 		};
+		CE46516C19DB1FB4003ECA05 /* cocoa */ = {
+			isa = PBXGroup;
+			children = (
+				CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */,
+			);
+			path = cocoa;
+			sourceTree = "<group>";
+		};
+		CEF4820C19DA347600CC04B8 /* spi */ = {
+			isa = PBXGroup;
+			children = (
+				CE46516C19DB1FB4003ECA05 /* cocoa */,
+			);
+			path = spi;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
@@ -1090,6 +1109,7 @@
 				A8A473EB151A825B004123FF /* MessageQueue.h in Headers */,
 				A8A473ED151A825B004123FF /* MetaAllocator.h in Headers */,
 				A8A473EE151A825B004123FF /* MetaAllocatorHandle.h in Headers */,
+				CE46516E19DB1FB4003ECA05 /* NSMapTableSPI.h in Headers */,
 				0F0D85B417234CC100338210 /* NoLock.h in Headers */,
 				A8A473EF151A825B004123FF /* Noncopyable.h in Headers */,
 				A8A473F5151A825B004123FF /* NumberOfCores.h in Headers */,

Modified: trunk/Source/WTF/wtf/Compiler.h (174109 => 174110)


--- trunk/Source/WTF/wtf/Compiler.h	2014-09-30 18:37:45 UTC (rev 174109)
+++ trunk/Source/WTF/wtf/Compiler.h	2014-09-30 18:40:32 UTC (rev 174110)
@@ -155,6 +155,14 @@
 #define CONSTEXPR
 #endif
 
+/* EXTERN_C */
+
+#ifdef __cplusplus
+#define EXTERN_C extern "C"
+#else
+#define EXTERN_C extern
+#endif
+
 /* FALLTHROUGH */
 
 #if !defined(FALLTHROUGH) && COMPILER_SUPPORTS(FALLTHROUGH_WARNINGS) && COMPILER(CLANG)

Copied: trunk/Source/WTF/wtf/spi/cocoa/NSMapTableSPI.h (from rev 174109, trunk/Source/_javascript_Core/API/JSVirtualMachineInternal.h) (0 => 174110)


--- trunk/Source/WTF/wtf/spi/cocoa/NSMapTableSPI.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/spi/cocoa/NSMapTableSPI.h	2014-09-30 18:40:32 UTC (rev 174110)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 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 met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <Foundation/NSMapTable.h>
+
+#if PLATFORM(IOS) && USE(APPLE_INTERNAL_SDK)
+#import <Foundation/NSMapTablePriv.h>
+#endif
+
+EXTERN_C void *NSMapGet(NSMapTable *, const void *key);
+EXTERN_C void NSMapInsert(NSMapTable *, const void *key, const void *value);
+EXTERN_C void NSMapRemove(NSMapTable *, const void *key);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to