Skip to content
Permalink
Browse files
[Build-time perf] Forward declare JS TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=231196

Reviewed by Tim Horton.

Source/JavaScriptCore:

Add a new file, Forward.h, containing forward declarations of commonly used JavaScriptCore types. Removed duplicate declarations
of TypedArray classes from TypedArrayAdapters.h and TypedArrays.h.

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/Forward.h: Added.
* runtime/TypedArrayAdaptors.h:
* runtime/TypedArrayAdaptersForwardDeclarations.h: Added.
* runtime/TypedArrays.h:

Source/WebCore:

According to `clang -ftime-trace`, compilation is spending a large amount of time inside TypedArrays.h.
Most of the places where JavaScriptCore/<Type>Array.h is included in a header only needed a forward
declaration, so include the new JavaScriptCore/Forward.h header instead, and move the include of the
<Type>Array.h header into the implementation file.

* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/webaudio/AudioBuffer.h:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/IIRFilterNode.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/WaveShaperDSPKernel.cpp:
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/webxr/WebXRRigidTransform.h:
* Modules/webxr/WebXRView.h:
* css/DOMMatrix.cpp:
* css/DOMMatrixReadOnly.h:
* dom/TextEncoder.h:
* dom/TextEncoderStreamEncoder.h:
* html/ImageData.h:
* html/WebKitMediaKeyError.h:
* html/canvas/WebGLAny.h:
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::elementArrayBuffer const):
* html/canvas/WebGLBuffer.h:
* platform/graphics/LegacyCDMSession.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::cachedKeyForKeyID const):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cocoa/SourceBufferParser.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FilterEffect.h:
* testing/Internals.h:
* testing/LegacyMockCDM.cpp:

Source/WebKit:

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:

Tools:

* TestWebKitAPI/Tests/WebCore/CtapResponseTest.cpp:


Canonical link: https://commits.webkit.org/242557@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Oct 6, 2021
1 parent d7ad21a commit d0ccf6383be05a222e0458aff180d62e5e0dc617
Showing 59 changed files with 285 additions and 81 deletions.
@@ -987,6 +987,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
runtime/ExecutableBaseInlines.h
runtime/Float32Array.h
runtime/Float64Array.h
runtime/Forward.h
runtime/FunctionConstructor.h
runtime/FunctionExecutable.h
runtime/FunctionHasExecutedCache.h
@@ -1178,6 +1179,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
runtime/ToNativeFromValue.h
runtime/TypeError.h
runtime/TypeSet.h
runtime/TypedArrayAdaptersForwardDeclarations.h
runtime/TypedArrayAdaptors.h
runtime/TypedArrayController.h
runtime/TypedArrayInlines.h
@@ -1,3 +1,19 @@
2021-10-06 Jer Noble <jer.noble@apple.com>

[Build-time perf] Forward declare JS TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=231196

Reviewed by Tim Horton.

Add a new file, Forward.h, containing forward declarations of commonly used JavaScriptCore types. Removed duplicate declarations
of TypedArray classes from TypedArrayAdapters.h and TypedArrays.h.

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/Forward.h: Added.
* runtime/TypedArrayAdaptors.h:
* runtime/TypedArrayAdaptersForwardDeclarations.h: Added.
* runtime/TypedArrays.h:

2021-10-06 Mikhail R. Gadelha <mikhail@igalia.com>

Fix wrong edge type from get-by-val in 32 bits
@@ -1785,6 +1785,8 @@
C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
C4F4B6F61A05C984005CAB76 /* objc_generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
CD1F9B3A270B9AAD00617EB6 /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B39270B9AAD00617EB6 /* Forward.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD1F9B3C270C0C1A00617EB6 /* TypedArrayAdaptersForwardDeclarations.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B3B270C0C1A00617EB6 /* TypedArrayAdaptersForwardDeclarations.h */; settings = {ATTRIBUTES = (Private, ); }; };
CE20BD05237D3E230046E520 /* FileBasedFuzzerAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CE20BD03237D3AD40046E520 /* FileBasedFuzzerAgentBase.h */; };
CE20BD07237D3E480046E520 /* PredictionFileCreatingFuzzerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = CE20BD01237D3AD40046E520 /* PredictionFileCreatingFuzzerAgent.h */; };
CEAE7D7B889B477BA93ABA6C /* ScriptFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8852151A9C3842389B3215B7 /* ScriptFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5022,6 +5024,8 @@
C4F4B6D61A05C76F005CAB76 /* generate_cpp_protocol_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_protocol_types_implementation.py; sourceTree = "<group>"; };
C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_protocol_types_implementation.py; sourceTree = "<group>"; };
C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = objc_generator_templates.py; sourceTree = "<group>"; };
CD1F9B39270B9AAD00617EB6 /* Forward.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Forward.h; sourceTree = "<group>"; };
CD1F9B3B270C0C1A00617EB6 /* TypedArrayAdaptersForwardDeclarations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedArrayAdaptersForwardDeclarations.h; sourceTree = "<group>"; };
CE20BD01237D3AD40046E520 /* PredictionFileCreatingFuzzerAgent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PredictionFileCreatingFuzzerAgent.h; sourceTree = "<group>"; };
CE20BD02237D3AD40046E520 /* PredictionFileCreatingFuzzerAgent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PredictionFileCreatingFuzzerAgent.cpp; sourceTree = "<group>"; };
CE20BD03237D3AD40046E520 /* FileBasedFuzzerAgentBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileBasedFuzzerAgentBase.h; sourceTree = "<group>"; };
@@ -6277,10 +6281,10 @@
0F24E53B17EA9F5900ABB217 /* AssemblyHelpers.cpp */,
0F24E53C17EA9F5900ABB217 /* AssemblyHelpers.h */,
6B767E7A26791F270017F8D1 /* AssemblyHelpersSpoolers.h */,
723998F6265DBCDB0057867F /* BaselineJITPlan.cpp */,
723998F5265DBCDB0057867F /* BaselineJITPlan.h */,
52DD000726E039B40054E408 /* BaselineJITCode.cpp */,
52DD000626E039B30054E408 /* BaselineJITCode.h */,
723998F6265DBCDB0057867F /* BaselineJITPlan.cpp */,
723998F5265DBCDB0057867F /* BaselineJITPlan.h */,
0F64B26F1A784BAF006E4E66 /* BinarySwitch.cpp */,
0F64B2701A784BAF006E4E66 /* BinarySwitch.h */,
65B8392D1BACA9D30044E824 /* CachedRecovery.cpp */,
@@ -7482,6 +7486,7 @@
531EE7B922DE6BBB0030DA81 /* FinalizationRegistryPrototype.h */,
A7A8AF2917ADB5F3005AB174 /* Float32Array.h */,
A7A8AF2A17ADB5F3005AB174 /* Float64Array.h */,
CD1F9B39270B9AAD00617EB6 /* Forward.h */,
BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */,
BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */,
147341DC1DC2CE9600AA29BA /* FunctionExecutable.cpp */,
@@ -8040,6 +8045,7 @@
FE2E6A7A1D6EA5FE0060F896 /* ThrowScope.cpp */,
FE3422111D6B818C0032BE88 /* ThrowScope.h */,
0F55989717C86C5600A1E543 /* ToNativeFromValue.h */,
CD1F9B3B270C0C1A00617EB6 /* TypedArrayAdaptersForwardDeclarations.h */,
0F2B66D817B6B5AB00A7AE3F /* TypedArrayAdaptors.h */,
0F2B66D917B6B5AB00A7AE3F /* TypedArrayController.cpp */,
0F2B66DA17B6B5AB00A7AE3F /* TypedArrayController.h */,
@@ -9496,6 +9502,7 @@
53D444DC1DAF08AB00B92784 /* B3WasmAddressValue.h in Headers */,
5341FC721DAC343C00E7E4D7 /* B3WasmBoundsCheckValue.h in Headers */,
0F2C63B21E60AE4700C13839 /* B3Width.h in Headers */,
52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */,
723998F7265DBCDB0057867F /* BaselineJITPlan.h in Headers */,
52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
@@ -9631,7 +9638,6 @@
5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
535C24611F78928E006EC40E /* create_regex_tables in Headers */,
9959E92B1BD17FA4001AA413 /* cssmin.py in Headers */,
E386FD7B26E867B800E4C28B /* TemporalPlainTimeConstructor.h in Headers */,
2A111246192FCE79005EE18D /* CustomGetterSetter.h in Headers */,
0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
@@ -9735,10 +9741,8 @@
0F2017821DCADD4200EA5950 /* DFGFlowMap.h in Headers */,
0F9D339717FFC4E60073C2BC /* DFGFlushedAt.h in Headers */,
A7D89CF817A0B8CC00773AD8 /* DFGFlushFormat.h in Headers */,
52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */,
0F2DD8151AB3D8BE00BBB8E8 /* DFGForAllKills.h in Headers */,
0F69CC89193AC60A0045759E /* DFGFrozenValue.h in Headers */,
E386FD7E26E867B800E4C28B /* TemporalPlainTime.h in Headers */,
86EC9DC61328DF82002B2AD7 /* DFGGenerationInfo.h in Headers */,
86EC9DC81328DF82002B2AD7 /* DFGGraph.h in Headers */,
0F2FCCFA18A60070001A27F8 /* DFGGraphSafepoint.h in Headers */,
@@ -9895,6 +9899,7 @@
531EE7BA22DE6BBB0030DA81 /* FinalizationRegistryPrototype.h in Headers */,
A7A8AF3817ADB5F3005AB174 /* Float32Array.h in Headers */,
A7A8AF3917ADB5F3005AB174 /* Float64Array.h in Headers */,
CD1F9B3A270B9AAD00617EB6 /* Forward.h in Headers */,
0F24E54317EA9F5900ABB217 /* FPRInfo.h in Headers */,
E34EDBF71DB5FFC900DC87A5 /* FrameTracers.h in Headers */,
0F5513A61D5A682C00C32BD8 /* FreeList.h in Headers */,
@@ -10281,7 +10286,6 @@
0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
0F2B66F317B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h in Headers */,
0F2B66F417B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h in Headers */,
E386FD7F26E867B800E4C28B /* TemporalPlainTimePrototype.h in Headers */,
0F2B66F517B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h in Headers */,
53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */,
0F2B66F617B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */,
@@ -10743,6 +10747,9 @@
A3C7EDBA26B0DB38004C34C5 /* TemporalDurationConstructor.h in Headers */,
A3C7EDB626B0DB38004C34C5 /* TemporalDurationPrototype.h in Headers */,
F6F150212693D450004B98EF /* TemporalObject.lut.h in Headers */,
E386FD7E26E867B800E4C28B /* TemporalPlainTime.h in Headers */,
E386FD7B26E867B800E4C28B /* TemporalPlainTimeConstructor.h in Headers */,
E386FD7F26E867B800E4C28B /* TemporalPlainTimePrototype.h in Headers */,
E30E8A5626DE2E4800DA4915 /* TemporalTimeZone.h in Headers */,
E30E8A5726DE2E4800DA4915 /* TemporalTimeZoneConstructor.h in Headers */,
E30E8A5426DE2E4800DA4915 /* TemporalTimeZonePrototype.h in Headers */,
@@ -10756,6 +10763,7 @@
0F55989817C86C5800A1E543 /* ToNativeFromValue.h in Headers */,
0F2D4DE919832DAC007D4B19 /* ToThisStatus.h in Headers */,
0F952ABD1B487A7700C367C5 /* TrackedReferences.h in Headers */,
CD1F9B3C270C0C1A00617EB6 /* TypedArrayAdaptersForwardDeclarations.h in Headers */,
0F2B670617B6B5AB00A7AE3F /* TypedArrayAdaptors.h in Headers */,
0F2B670817B6B5AB00A7AE3F /* TypedArrayController.h in Headers */,
0F4B94DC17B9F07500DD03A4 /* TypedArrayInlines.h in Headers */,
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2021 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. AND ITS CONTRIBUTORS ``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 ITS 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.
*/

#pragma once

#include "TypedArrayAdaptersForwardDeclarations.h"

namespace JSC {
class ArrayBuffer;
}

using JSC::ArrayBuffer;
@@ -0,0 +1,67 @@
/*
* Copyright (C) 2021 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. AND ITS CONTRIBUTORS ``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 ITS 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.
*/

#pragma once

namespace JSC {

struct Int8Adaptor;
struct Int16Adaptor;
struct Int32Adaptor;
struct Uint8Adaptor;
struct Uint8ClampedAdaptor;
struct Uint16Adaptor;
struct Uint32Adaptor;
struct Float32Adaptor;
struct Float64Adaptor;
struct BigInt64Adaptor;
struct BigUint64Adaptor;

template<typename Adaptor> class GenericTypedArrayView;
typedef GenericTypedArrayView<Int8Adaptor> Int8Array;
typedef GenericTypedArrayView<Int16Adaptor> Int16Array;
typedef GenericTypedArrayView<Int32Adaptor> Int32Array;
typedef GenericTypedArrayView<Uint8Adaptor> Uint8Array;
typedef GenericTypedArrayView<Uint8ClampedAdaptor> Uint8ClampedArray;
typedef GenericTypedArrayView<Uint16Adaptor> Uint16Array;
typedef GenericTypedArrayView<Uint32Adaptor> Uint32Array;
typedef GenericTypedArrayView<Float32Adaptor> Float32Array;
typedef GenericTypedArrayView<Float64Adaptor> Float64Array;
typedef GenericTypedArrayView<BigInt64Adaptor> BigInt64Array;
typedef GenericTypedArrayView<BigUint64Adaptor> BigUint64Array;

}

using JSC::Int8Array;
using JSC::Int16Array;
using JSC::Int32Array;
using JSC::Uint8Array;
using JSC::Uint8ClampedArray;
using JSC::Uint16Array;
using JSC::Uint32Array;
using JSC::Float32Array;
using JSC::Float64Array;
using JSC::BigInt64Array;
using JSC::BigUint64Array;
@@ -28,6 +28,7 @@
#include "JSBigInt.h"
#include "JSCJSValue.h"
#include "MathCommon.h"
#include "TypedArrayAdaptersForwardDeclarations.h"
#include "TypedArrayType.h"
#include <wtf/MathExtras.h>

@@ -208,31 +209,6 @@ struct BigIntTypedArrayAdaptor {
}
};

struct Int8Adaptor;
struct Int16Adaptor;
struct Int32Adaptor;
struct Uint8Adaptor;
struct Uint8ClampedAdaptor;
struct Uint16Adaptor;
struct Uint32Adaptor;
struct Float32Adaptor;
struct Float64Adaptor;
struct BigInt64Adaptor;
struct BigUint64Adaptor;

template<typename Adaptor> class GenericTypedArrayView;
typedef GenericTypedArrayView<Int8Adaptor> Int8Array;
typedef GenericTypedArrayView<Int16Adaptor> Int16Array;
typedef GenericTypedArrayView<Int32Adaptor> Int32Array;
typedef GenericTypedArrayView<Uint8Adaptor> Uint8Array;
typedef GenericTypedArrayView<Uint8ClampedAdaptor> Uint8ClampedArray;
typedef GenericTypedArrayView<Uint16Adaptor> Uint16Array;
typedef GenericTypedArrayView<Uint32Adaptor> Uint32Array;
typedef GenericTypedArrayView<Float32Adaptor> Float32Array;
typedef GenericTypedArrayView<Float64Adaptor> Float64Array;
typedef GenericTypedArrayView<BigInt64Adaptor> BigInt64Array;
typedef GenericTypedArrayView<BigUint64Adaptor> BigUint64Array;

template<typename Adaptor> class JSGenericTypedArrayView;
using JSInt8Array = JSGenericTypedArrayView<Int8Adaptor>;
using JSInt16Array = JSGenericTypedArrayView<Int16Adaptor>;
@@ -27,19 +27,3 @@

#include "GenericTypedArrayView.h"
#include "TypedArrayAdaptors.h"

namespace JSC {

typedef GenericTypedArrayView<Int8Adaptor> Int8Array;
typedef GenericTypedArrayView<Int16Adaptor> Int16Array;
typedef GenericTypedArrayView<Int32Adaptor> Int32Array;
typedef GenericTypedArrayView<Uint8Adaptor> Uint8Array;
typedef GenericTypedArrayView<Uint8ClampedAdaptor> Uint8ClampedArray;
typedef GenericTypedArrayView<Uint16Adaptor> Uint16Array;
typedef GenericTypedArrayView<Uint32Adaptor> Uint32Array;
typedef GenericTypedArrayView<Float32Adaptor> Float32Array;
typedef GenericTypedArrayView<Float64Adaptor> Float64Array;
typedef GenericTypedArrayView<BigInt64Adaptor> BigInt64Array;
typedef GenericTypedArrayView<BigUint64Adaptor> BigUint64Array;

} // namespace JSC
@@ -1,3 +1,63 @@
2021-10-06 Jer Noble <jer.noble@apple.com>

[Build-time perf] Forward declare JS TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=231196

Reviewed by Tim Horton.

According to `clang -ftime-trace`, compilation is spending a large amount of time inside TypedArrays.h.
Most of the places where JavaScriptCore/<Type>Array.h is included in a header only needed a forward
declaration, so include the new JavaScriptCore/Forward.h header instead, and move the include of the
<Type>Array.h header into the implementation file.

* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/webaudio/AudioBuffer.h:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/IIRFilterNode.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/WaveShaperDSPKernel.cpp:
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/webxr/WebXRRigidTransform.h:
* Modules/webxr/WebXRView.h:
* css/DOMMatrix.cpp:
* css/DOMMatrixReadOnly.h:
* dom/TextEncoder.h:
* dom/TextEncoderStreamEncoder.h:
* html/ImageData.h:
* html/WebKitMediaKeyError.h:
* html/canvas/WebGLAny.h:
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::elementArrayBuffer const):
* html/canvas/WebGLBuffer.h:
* platform/graphics/LegacyCDMSession.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::cachedKeyForKeyID const):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::cachedKeyForKeyID const):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cocoa/SourceBufferParser.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FilterEffect.h:
* testing/Internals.h:
* testing/LegacyMockCDM.cpp:

2021-10-05 Basuke Suzuki <basuke.suzuki@sony.com>

[PlayStation] Fix build break after r283441
@@ -28,7 +28,6 @@
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)

#include "LegacyCDMSession.h"
#include <JavaScriptCore/Uint8Array.h>
#include <wtf/Forward.h>
#include <wtf/Function.h>
#include <wtf/text/WTFString.h>
@@ -37,6 +37,7 @@
#include "WebKitMediaKeyError.h"
#include "WebKitMediaKeyMessageEvent.h"
#include "WebKitMediaKeys.h"
#include <JavaScriptCore/Uint8Array.h>
#include <wtf/FileSystem.h>
#include <wtf/IsoMallocInlines.h>

0 comments on commit d0ccf63

Please sign in to comment.