[COCOA] Disable HAVE_DTRACE at build time
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 May 2016 04:55:34 +0000 (04:55 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 May 2016 04:55:34 +0000 (04:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157433
<rdar://problem/26148841>

Reviewed by Mark Lam.

Source/JavaScriptCore:

Drop DTRACE-related code from JSC since it is very old and seems
unused.

* JavaScriptCore.xcodeproj/project.pbxproj:
* PlatformMac.cmake:
* heap/Heap.cpp:
(JSC::Heap::collectImpl): Deleted.
(JSC::Heap::didFinishCollection): Deleted.
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::willExecute): Deleted.
(JSC::ProfileGenerator::didExecute): Deleted.
* runtime/Tracing.d: Removed.
* runtime/Tracing.h: Removed.

Source/WTF:

Disable HAVE_DTRACE on COCOA since it is mostly unused and has a performance
impact, at least on iOS.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/PlatformMac.cmake
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/profiler/ProfileGenerator.cpp
Source/JavaScriptCore/runtime/Tracing.d [deleted file]
Source/JavaScriptCore/runtime/Tracing.h [deleted file]
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebKit2/Platform/IPC/MessageRecorder.cpp
Source/WebKit2/UIProcess/ViewGestureController.cpp

index 260ba9a..f974a77 100644 (file)
@@ -1,3 +1,25 @@
+2016-05-08  Chris Dumez  <cdumez@apple.com>
+
+        [COCOA] Disable HAVE_DTRACE at build time
+        https://bugs.webkit.org/show_bug.cgi?id=157433
+        <rdar://problem/26148841>
+
+        Reviewed by Mark Lam.
+
+        Drop DTRACE-related code from JSC since it is very old and seems
+        unused.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * PlatformMac.cmake:
+        * heap/Heap.cpp:
+        (JSC::Heap::collectImpl): Deleted.
+        (JSC::Heap::didFinishCollection): Deleted.
+        * profiler/ProfileGenerator.cpp:
+        (JSC::ProfileGenerator::willExecute): Deleted.
+        (JSC::ProfileGenerator::didExecute): Deleted.
+        * runtime/Tracing.d: Removed.
+        * runtime/Tracing.h: Removed.
+
 2016-05-07  Mark Lam  <mark.lam@apple.com>
 
         Add JSC options bytecodeRangeToJITCompile and jitWhitelist.
index fb08ace..7a3bbf5 100644 (file)
@@ -53,7 +53,6 @@
                        buildConfigurationList = 65FB3F7709D11EBD00F49DEB /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
                        buildPhases = (
                                65FB3F6509D11E9100F49DEB /* Generate Derived Sources */,
-                               5D35DEE10C7C140B008648B2 /* Generate DTrace header */,
                        );
                        dependencies = (
                        );
                53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */; };
                539FB8BA1C99DA7C00940FA1 /* JSArrayInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 539FB8B91C99DA7C00940FA1 /* JSArrayInlines.h */; };
                53F6BF6D1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; };
                5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
                5DBB151B131D0B310056AD36 /* testapi.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 14D857740A4696C80032146C /* testapi.js */; };
                5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; };
                53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedArrayViewPrototype.cpp; sourceTree = "<group>"; };
                53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InternalFunctionAllocationProfile.h; sourceTree = "<group>"; };
                593D43CCA0BBE06D89C59707 /* MapDataInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapDataInlines.h; sourceTree = "<group>"; };
-               5D53726D0E1C546B0021E549 /* Tracing.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Tracing.d; sourceTree = "<group>"; };
-               5D53726E0E1C54880021E549 /* Tracing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tracing.h; sourceTree = "<group>"; };
-               5D53727D0E1C55EC0021E549 /* TracingDtrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TracingDtrace.h; sourceTree = "<group>"; };
                5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
                5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = "<group>"; };
                5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
                                996B73121BD9FA2C00331B84 /* StringIteratorPrototype.lut.h */,
                                996B73131BD9FA2C00331B84 /* SymbolConstructor.lut.h */,
                                996B73141BD9FA2C00331B84 /* SymbolPrototype.lut.h */,
-                               5D53727D0E1C55EC0021E549 /* TracingDtrace.h */,
                                65A946141C8E9F6F00A7209A /* YarrCanonicalizeUnicode.cpp */,
                        );
                        name = "Derived Sources";
                                0FA2C17917D7CF84009D015F /* TestRunnerUtils.cpp */,
                                0FA2C17A17D7CF84009D015F /* TestRunnerUtils.h */,
                                0F55989717C86C5600A1E543 /* ToNativeFromValue.h */,
-                               5D53726D0E1C546B0021E549 /* Tracing.d */,
-                               5D53726E0E1C54880021E549 /* Tracing.h */,
                                0F2B66D817B6B5AB00A7AE3F /* TypedArrayAdaptors.h */,
                                0F2B66D917B6B5AB00A7AE3F /* TypedArrayController.cpp */,
                                0F2B66DA17B6B5AB00A7AE3F /* TypedArrayController.h */,
                                2684D4381C00161C0081D663 /* AirLiveness.h in Headers */,
                                0F55989817C86C5800A1E543 /* ToNativeFromValue.h in Headers */,
                                0F2D4DE919832DAC007D4B19 /* ToThisStatus.h in Headers */,
-                               5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
                                0F952ABD1B487A7700C367C5 /* TrackedReferences.h in Headers */,
                                0F2B670617B6B5AB00A7AE3F /* TypedArrayAdaptors.h in Headers */,
                                0F338E131BF0276C0013C88F /* B3OpaqueByproducts.h in Headers */,
                        shellPath = /bin/sh;
                        shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n    touch \"$SRCROOT/Info.plist\";\nfi;\n";
                };
-               5D35DEE10C7C140B008648B2 /* Generate DTrace header */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                               "$(SRCROOT)/runtime/Tracing.d",
-                       );
-                       name = "Generate DTrace header";
-                       outputPaths = (
-                               "$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h",
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "set -e\n\nTRACING_D=\"$SRCROOT/runtime/Tracing.d\";\nTRACING_H=\"$BUILT_PRODUCTS_DIR/DerivedSources/JavaScriptCore/TracingDtrace.h\";\n\nif [[ \"$TRACING_D\" -nt \"$TRACING_H\" ]];\nthen\n\tdtrace -h -o \"$TRACING_H\" -s \"$TRACING_D\";\nfi;\n";
-               };
                5D5D8ABF0E0D0B0300F9C692 /* Create /usr/local/bin/jsc symlink */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;
index db7db32..8717c4a 100644 (file)
@@ -23,21 +23,11 @@ list(APPEND JavaScriptCore_LIBRARIES
     ${SECURITY_LIBRARY}
 )
 
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/TracingDtrace.h
-    DEPENDS ${JAVASCRIPTCORE_DIR}/runtime/Tracing.d
-    WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
-    COMMAND dtrace -h -o "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/TracingDtrace.h" -s "${JAVASCRIPTCORE_DIR}/runtime/Tracing.d"
-    VERBATIM)
-
 list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
     ${WTF_DIR}
     ${JAVASCRIPTCORE_DIR}/disassembler/udis86
     ${JAVASCRIPTCORE_DIR}/icu
 )
-list(APPEND JavaScriptCore_HEADERS
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/TracingDtrace.h
-)
 
 set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-compatibility_version 1 -current_version ${WEBKIT_MAC_VERSION}")
 
index 06deb8d..6d8de76 100644 (file)
@@ -46,7 +46,6 @@
 #include "JSVirtualMachineInternal.h"
 #include "SamplingProfiler.h"
 #include "ShadowChicken.h"
-#include "Tracing.h"
 #include "TypeProfilerLog.h"
 #include "UnlinkedCodeBlock.h"
 #include "VM.h"
@@ -1148,7 +1147,6 @@ NEVER_INLINE void Heap::collectImpl(HeapOperation collectionType, void* stackOri
     ASSERT(vm()->currentThreadIsHoldingAPILock());
     RELEASE_ASSERT(vm()->atomicStringTable() == wtfThreadData().atomicStringTable());
     ASSERT(m_isSafeToCollect);
-    JAVASCRIPTCORE_GC_BEGIN();
     RELEASE_ASSERT(m_operationInProgress == NoOperation);
 
     suspendCompilerThreads();
@@ -1175,7 +1173,6 @@ NEVER_INLINE void Heap::collectImpl(HeapOperation collectionType, void* stackOri
         m_verifier->gatherLiveObjects(HeapVerifier::Phase::AfterMarking);
         m_verifier->verify(HeapVerifier::Phase::AfterMarking);
     }
-    JAVASCRIPTCORE_GC_MARKED();
 
     if (vm()->typeProfiler())
         vm()->typeProfiler()->invalidateTypeSetCache();
@@ -1480,7 +1477,6 @@ void Heap::didFinishCollection(double gcStartTime)
 
     RELEASE_ASSERT(m_operationInProgress == EdenCollection || m_operationInProgress == FullCollection);
     m_operationInProgress = NoOperation;
-    JAVASCRIPTCORE_GC_END();
 
     for (auto* observer : m_observers)
         observer->didGarbageCollect(operation);
index f3b8f3c..25f8a43 100644 (file)
@@ -35,7 +35,6 @@
 #include "JSCInlines.h"
 #include "Profile.h"
 #include "StackVisitor.h"
-#include "Tracing.h"
 
 namespace JSC {
 
@@ -135,12 +134,6 @@ void ProfileGenerator::endCallEntry(ProfileNode* node)
 
 void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
 {
-    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
-        CString name = callIdentifier.functionName().utf8();
-        CString url = callIdentifier.url().utf8();
-        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.lineNumber(), callIdentifier.columnNumber());
-    }
-
     if (!m_origin)
         return;
 
@@ -166,12 +159,6 @@ void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentif
 
 void ProfileGenerator::didExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
 {
-    if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
-        CString name = callIdentifier.functionName().utf8();
-        CString url = callIdentifier.url().utf8();
-        JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.lineNumber(), callIdentifier.columnNumber());
-    }
-
     if (!m_origin)
         return;
 
diff --git a/Source/JavaScriptCore/runtime/Tracing.d b/Source/JavaScriptCore/runtime/Tracing.d
deleted file mode 100644 (file)
index ec13625..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-provider JavaScriptCore
-{
-    probe gc__begin();
-    probe gc__marked();
-    probe gc__end();
-
-    probe profile__will_execute(int, char*, char*, int, int);
-    probe profile__did_execute(int, char*, char*, int, int);
-};
-
-#pragma D attributes Unstable/Unstable/Common provider JavaScriptCore provider
-#pragma D attributes Private/Private/Unknown provider JavaScriptCore module
-#pragma D attributes Private/Private/Unknown provider JavaScriptCore function
-#pragma D attributes Unstable/Unstable/Common provider JavaScriptCore name
-#pragma D attributes Unstable/Unstable/Common provider JavaScriptCore args
diff --git a/Source/JavaScriptCore/runtime/Tracing.h b/Source/JavaScriptCore/runtime/Tracing.h
deleted file mode 100644 (file)
index 69ead92..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef Tracing_h
-#define Tracing_h
-
-#if HAVE(DTRACE)
-#include "TracingDtrace.h"
-#else
-
-#define JAVASCRIPTCORE_GC_BEGIN()
-#define JAVASCRIPTCORE_GC_BEGIN_ENABLED() 0
-
-#define JAVASCRIPTCORE_GC_END()
-#define JAVASCRIPTCORE_GC_END_ENABLED() 0
-
-#define JAVASCRIPTCORE_GC_MARKED()
-#define JAVASCRIPTCORE_GC_MARKED_ENABLED() 0
-
-#define JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(arg0, arg1, arg2, arg3, arg4)
-#define JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED() 0
-
-#define JAVASCRIPTCORE_PROFILE_DID_EXECUTE(arg0, arg1, arg2, arg3, arg4)
-#define JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED() 0
-
-#endif
-
-#endif // Tracing_h
index 06f3aa6..11ca140 100644 (file)
@@ -1,5 +1,18 @@
 2016-05-08  Chris Dumez  <cdumez@apple.com>
 
+        [COCOA] Disable HAVE_DTRACE at build time
+        https://bugs.webkit.org/show_bug.cgi?id=157433
+        <rdar://problem/26148841>
+
+        Reviewed by Mark Lam.
+
+        Disable HAVE_DTRACE on COCOA since it is mostly unused and has a performance
+        impact, at least on iOS.
+
+        * wtf/Platform.h:
+
+2016-05-08  Chris Dumez  <cdumez@apple.com>
+
         [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
         https://bugs.webkit.org/show_bug.cgi?id=157465
 
index cd38085..1ac146c 100644 (file)
 #define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1
 #define ENABLE_USER_MESSAGE_HANDLERS 1
 #define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
-#define HAVE_DTRACE 1
+#define HAVE_DTRACE 0
 
 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 #define HAVE_AVKIT 1
index ef3ee07..463966a 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "MessageRecorder.h"
 
+#if HAVE(DTRACE)
+
 #include "Connection.h"
 #include "MessageDecoder.h"
 #include "MessageEncoder.h"
@@ -114,3 +116,5 @@ MessageRecorder::MessageProcessingToken::~MessageProcessingToken()
 }
 
 }
+
+#endif // HAVE(DTRACE)
index 135151f..bc26152 100644 (file)
@@ -32,6 +32,7 @@
 #import "WebPageProxy.h"
 #import "WebProcessProxy.h"
 #import <wtf/MathExtras.h>
+#import <wtf/NeverDestroyed.h>
 
 using namespace WebCore;