Make it cheap to #include "JITOperations.h"
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Feb 2016 22:14:59 +0000 (22:14 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Feb 2016 22:14:59 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154836

Reviewed by Mark Lam.

Prior to this change, this header included the whole world even though it did't have any
definitions. This patch turns almost all of the includes into forward declarations. Right
now this header is very cheap to include.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGSpeculativeJIT.h:
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/Repatch.h:
* runtime/CommonSlowPaths.h:
(JSC::encodeResult): Deleted.
(JSC::decodeResult): Deleted.
* runtime/SlowPathReturnType.h: Added.
(JSC::encodeResult):
(JSC::decodeResult):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/JITOperations.h
Source/JavaScriptCore/jit/Repatch.h
Source/JavaScriptCore/runtime/CommonSlowPaths.h
Source/JavaScriptCore/runtime/SlowPathReturnType.h [new file with mode: 0644]

index 7af2947..5fb0147 100644 (file)
@@ -1,3 +1,28 @@
+2016-02-29  Filip Pizlo  <fpizlo@apple.com>
+
+        Make it cheap to #include "JITOperations.h"
+        https://bugs.webkit.org/show_bug.cgi?id=154836
+
+        Reviewed by Mark Lam.
+
+        Prior to this change, this header included the whole world even though it did't have any
+        definitions. This patch turns almost all of the includes into forward declarations. Right
+        now this header is very cheap to include.
+
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * dfg/DFGSpeculativeJIT.h:
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * jit/Repatch.h:
+        * runtime/CommonSlowPaths.h:
+        (JSC::encodeResult): Deleted.
+        (JSC::decodeResult): Deleted.
+        * runtime/SlowPathReturnType.h: Added.
+        (JSC::encodeResult):
+        (JSC::decodeResult):
+
 2016-02-28  Filip Pizlo  <fpizlo@apple.com>
 
         FTL should be able to run everything in Octane/regexp
index 323f7e0..a621e3c 100644 (file)
     <ClInclude Include="..\runtime\SetIteratorPrototype.h" />
     <ClInclude Include="..\runtime\SetPrototype.h" />
     <ClInclude Include="..\runtime\SimpleTypedArrayController.h" />
+    <ClInclude Include="..\runtime\SlowPathReturnType.h" />
     <ClInclude Include="..\runtime\SmallStrings.h" />
     <ClInclude Include="..\runtime\SparseArrayValueMap.h" />
     <ClInclude Include="..\runtime\StackAlignment.h" />
index 1cf681f..790424f 100644 (file)
     <ClInclude Include="..\runtime\SmallStrings.h">
       <Filter>runtime</Filter>
     </ClInclude>
+    <ClInclude Include="..\runtime\SlowPathReturnType.h">
+      <Filter>runtime</Filter>
+    </ClInclude>
     <ClInclude Include="..\runtime\SparseArrayValueMap.h">
       <Filter>runtime</Filter>
     </ClInclude>
index e1f443e..307e52e 100644 (file)
                0F5A52D017ADD717008ECB2D /* CopyToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A52CF17ADD717008ECB2D /* CopyToken.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F5A6283188C98D40072C9DF /* FTLValueRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5A6281188C98D40072C9DF /* FTLValueRange.cpp */; };
                0F5A6284188C98D40072C9DF /* FTLValueRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A6282188C98D40072C9DF /* FTLValueRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0F5B4A331C84F0D600F1B17E /* SlowPathReturnType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B4A321C84F0D600F1B17E /* SlowPathReturnType.h */; };
                0F5D085D1B8CF99D001143B4 /* DFGNodeOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5D085C1B8CF99D001143B4 /* DFGNodeOrigin.cpp */; };
                0F5EF91E16878F7A003E5C25 /* JITThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5EF91B16878F78003E5C25 /* JITThunks.cpp */; };
                0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5EF91C16878F78003E5C25 /* JITThunks.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F5A52CF17ADD717008ECB2D /* CopyToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyToken.h; sourceTree = "<group>"; };
                0F5A6281188C98D40072C9DF /* FTLValueRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLValueRange.cpp; path = ftl/FTLValueRange.cpp; sourceTree = "<group>"; };
                0F5A6282188C98D40072C9DF /* FTLValueRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLValueRange.h; path = ftl/FTLValueRange.h; sourceTree = "<group>"; };
+               0F5B4A321C84F0D600F1B17E /* SlowPathReturnType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowPathReturnType.h; sourceTree = "<group>"; };
                0F5D085C1B8CF99D001143B4 /* DFGNodeOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGNodeOrigin.cpp; path = dfg/DFGNodeOrigin.cpp; sourceTree = "<group>"; };
                0F5EF91B16878F78003E5C25 /* JITThunks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITThunks.cpp; sourceTree = "<group>"; };
                0F5EF91C16878F78003E5C25 /* JITThunks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITThunks.h; sourceTree = "<group>"; };
                                A7299DA017D12848005F5FF9 /* SetPrototype.h */,
                                0F2B66D617B6B5AB00A7AE3F /* SimpleTypedArrayController.cpp */,
                                0F2B66D717B6B5AB00A7AE3F /* SimpleTypedArrayController.h */,
+                               0F5B4A321C84F0D600F1B17E /* SlowPathReturnType.h */,
                                93303FE80E6A72B500786E6A /* SmallStrings.cpp */,
                                93303FEA0E6A72C000786E6A /* SmallStrings.h */,
                                0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */,
                                BC18C46B0E16F5CD00B34460 /* SymbolTable.h in Headers */,
                                A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
                                70ECA6081AFDBEA200449739 /* TemplateRegistry.h in Headers */,
+                               0F5B4A331C84F0D600F1B17E /* SlowPathReturnType.h in Headers */,
                                70ECA6091AFDBEA200449739 /* TemplateRegistryKey.h in Headers */,
                                0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
                                0FA2C17C17D7CF84009D015F /* TestRunnerUtils.h in Headers */,
index 74b034a..9188a83 100644 (file)
@@ -39,6 +39,7 @@
 #include "JITOperations.h"
 #include "MarkedAllocator.h"
 #include "PutKind.h"
+#include "SpillRegistersMode.h"
 #include "ValueRecovery.h"
 #include "VirtualRegister.h"
 
index 5b74565..80f09f0 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(JIT)
 
 #include "ArrayConstructor.h"
+#include "CommonSlowPaths.h"
 #include "DFGCompilationMode.h"
 #include "DFGDriver.h"
 #include "DFGOSREntry.h"
@@ -42,6 +43,7 @@
 #include "GetterSetter.h"
 #include "HostCallReturnValue.h"
 #include "JIT.h"
+#include "JITExceptions.h"
 #include "JITToDFGDeferredCompilationCallback.h"
 #include "JSCInlines.h"
 #include "JSGeneratorFunction.h"
index 81a73ea..71bb0c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #if ENABLE(JIT)
 
-#include "CallFrame.h"
-#include "CommonSlowPaths.h"
-#include "JITExceptions.h"
-#include "JSArray.h"
-#include "JSCJSValue.h"
-#include "MacroAssembler.h"
-#include "PutKind.h"
-#include "SpillRegistersMode.h"
-#include "StructureStubInfo.h"
-
+#include "MacroAssemblerCodeRef.h"
+#include "PropertyOffset.h"
+#include "SlowPathReturnType.h"
+#include "TypedArrayType.h"
+#include <wtf/text/UniquedStringImpl.h>
 
 namespace JSC {
 
 class ArrayAllocationProfile;
+class ArrayProfile;
+class CallLinkInfo;
+class CodeBlock;
+class ExecState;
+class JSArray;
+class JSFunction;
+class JSLexicalEnvironment;
+class JSScope;
+class Register;
+class StructureStubInfo;
+class SymbolTable;
+class WatchpointSet;
+
+struct ByValInfo;
+struct InlineCallFrame;
+
+typedef ExecState CallFrame;
 
 #if CALLING_CONVENTION_IS_STDCALL
 #define JIT_OPERATION CDECL
index dcb37df..443e944 100644 (file)
@@ -31,6 +31,7 @@
 #include "CCallHelpers.h"
 #include "CallVariant.h"
 #include "JITOperations.h"
+#include "PutKind.h"
 
 namespace JSC {
 
index f00d870..98fe5db 100644 (file)
@@ -30,6 +30,7 @@
 #include "CodeSpecializationKind.h"
 #include "ExceptionHelpers.h"
 #include "JSStackInlines.h"
+#include "SlowPathReturnType.h"
 #include "StackAlignment.h"
 #include "Symbol.h"
 #include "VM.h"
@@ -175,57 +176,6 @@ inline void tryCacheGetFromScopeGlobal(
 class ExecState;
 struct Instruction;
 
-#if USE(JSVALUE64)
-// According to C++ rules, a type used for the return signature of function with C linkage (i.e.
-// 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
-// warnings, or worse, a change in the ABI used to return these types.
-struct SlowPathReturnType {
-    void* a;
-    void* b;
-};
-
-inline SlowPathReturnType encodeResult(void* a, void* b)
-{
-    SlowPathReturnType result;
-    result.a = a;
-    result.b = b;
-    return result;
-}
-
-inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)
-{
-    a = result.a;
-    b = result.b;
-}
-
-#else // USE(JSVALUE32_64)
-typedef int64_t SlowPathReturnType;
-
-typedef union {
-    struct {
-        void* a;
-        void* b;
-    } pair;
-    int64_t i;
-} SlowPathReturnTypeEncoding;
-
-inline SlowPathReturnType encodeResult(void* a, void* b)
-{
-    SlowPathReturnTypeEncoding u;
-    u.pair.a = a;
-    u.pair.b = b;
-    return u.i;
-}
-
-inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)
-{
-    SlowPathReturnTypeEncoding u;
-    u.i = result;
-    a = u.pair.a;
-    b = u.pair.b;
-}
-#endif // USE(JSVALUE32_64)
-    
 #define SLOW_PATH
     
 #define SLOW_PATH_DECL(name) \
diff --git a/Source/JavaScriptCore/runtime/SlowPathReturnType.h b/Source/JavaScriptCore/runtime/SlowPathReturnType.h
new file mode 100644 (file)
index 0000000..27cfb95
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2016 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 SlowPathReturnType_h
+#define SlowPathReturnType_h
+
+#include <wtf/StdLibExtras.h>
+
+namespace JSC {
+
+#if USE(JSVALUE64)
+// According to C++ rules, a type used for the return signature of function with C linkage (i.e.
+// 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler
+// warnings, or worse, a change in the ABI used to return these types.
+struct SlowPathReturnType {
+    void* a;
+    void* b;
+};
+
+inline SlowPathReturnType encodeResult(void* a, void* b)
+{
+    SlowPathReturnType result;
+    result.a = a;
+    result.b = b;
+    return result;
+}
+
+inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)
+{
+    a = result.a;
+    b = result.b;
+}
+
+#else // USE(JSVALUE32_64)
+typedef int64_t SlowPathReturnType;
+
+typedef union {
+    struct {
+        void* a;
+        void* b;
+    } pair;
+    int64_t i;
+} SlowPathReturnTypeEncoding;
+
+inline SlowPathReturnType encodeResult(void* a, void* b)
+{
+    SlowPathReturnTypeEncoding u;
+    u.pair.a = a;
+    u.pair.b = b;
+    return u.i;
+}
+
+inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)
+{
+    SlowPathReturnTypeEncoding u;
+    u.i = result;
+    a = u.pair.a;
+    b = u.pair.b;
+}
+#endif // USE(JSVALUE32_64)
+
+} // namespace JSC
+
+#endif // SlowPathReturnType_h