Skip to content

Commit 03ee1c8

Browse files
committed
[Build Speed] Inlines hygiene: Move inlines out of type definition .h files
https://bugs.webkit.org/show_bug.cgi?id=317098 rdar://179660972 Reviewed by Mike Wyrzykowski. This is preparation for expanding prefix headers. Too many inlines in a header explode precompiled headers and also require lots more symbols to be exported. Also added some clang vtable workarounds where needed. * Source/JavaScriptCore/CMakeLists.txt: Added our new headers. * Source/JavaScriptCore/bytecode/CodeBlock.cpp * Source/JavaScriptCore/bytecode/GetByStatus.cpp * Source/JavaScriptCore/bytecode/RepatchInlines.h: Added missing headers. * Source/JavaScriptCore/bytecode/TypeLocation.h * Source/JavaScriptCore/bytecode/TypeLocationInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp: Added missing headers. * Source/JavaScriptCore/heap/AbstractSlotVisitor.h * Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/heap/SlotVisitor.h * Source/JavaScriptCore/heap/SlotVisitorInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/jit/JITOperations.cpp * Source/JavaScriptCore/parser/Parser.cpp * Source/JavaScriptCore/parser/VariableEnvironment.cpp: Added missing headers. * Source/JavaScriptCore/parser/VariableEnvironment.h * Source/JavaScriptCore/parser/VariableEnvironmentInlines.h * Source/JavaScriptCore/runtime/CacheableIdentifier.h * Source/JavaScriptCore/runtime/CacheableIdentifierInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/runtime/CachedTypes.cpp * Source/JavaScriptCore/runtime/CodeCache.cpp * Source/JavaScriptCore/runtime/CyclicModuleRecord.cpp: Added missing headers. * Source/JavaScriptCore/runtime/DeferredWorkTimer.h * Source/JavaScriptCore/runtime/DeferredWorkTimerInlines.h * Source/JavaScriptCore/runtime/ErrorInstance.h * Source/JavaScriptCore/runtime/ErrorInstanceInlines.h * Source/JavaScriptCore/runtime/Identifier.h * Source/JavaScriptCore/runtime/IdentifierInlines.h * Source/JavaScriptCore/runtime/JSBigInt.h * Source/JavaScriptCore/runtime/JSBigIntInlines.h * Source/JavaScriptCore/runtime/JSCellInlines.h * Source/JavaScriptCore/runtime/JSGlobalObject.h * Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h: * Source/JavaScriptCore/runtime/JSObject.h * Source/JavaScriptCore/runtime/JSObjectInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp * Source/JavaScriptCore/runtime/JSRunLoopTimer.h: Out of line destructor to work around clang vtable bug. * Source/JavaScriptCore/runtime/JSScope.cpp * Source/JavaScriptCore/runtime/JSScope.h * Source/JavaScriptCore/runtime/JSScopeInlines.h * Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h * Source/JavaScriptCore/runtime/LazyClassStructure.h * Source/JavaScriptCore/runtime/LazyClassStructureInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/runtime/ProgramExecutable.cpp: Added missing include. * Source/JavaScriptCore/runtime/PropertyName.h * Source/JavaScriptCore/runtime/PropertyNameInlines.h * Source/JavaScriptCore/runtime/ScopedArgumentsTable.h * Source/JavaScriptCore/runtime/Structure.h * Source/JavaScriptCore/runtime/StructureInlines.h * Source/JavaScriptCore/runtime/SymbolTable.cpp * Source/JavaScriptCore/runtime/SymbolTable.h * Source/JavaScriptCore/runtime/SymbolTableInlines.h: Move function out of line to reduce dependencies. * Source/JavaScriptCore/runtime/TypeProfiler.cpp * Source/JavaScriptCore/runtime/VM.cpp: Added missing include. * Source/WTF/wtf/text/StringImpl.h: Export our destructor so it can be called by WebCore/WebKit prefix header code. * Source/WebCore/bindings/scripts/CodeGeneratorJS.pm: clang vtable workaround for weak handle owners. * Source/WebCore/dom/ContainerNode.cpp * Source/WebCore/dom/ContainerNode.h * Source/WebCore/dom/ContainerNodeInlines.h * Source/WebCore/dom/Element.cpp * Source/WebCore/dom/Element.h * Source/WebCore/dom/ElementInlines.h * Source/WebCore/dom/Node.cpp * Source/WebCore/dom/Node.h * Source/WebCore/dom/NodeInlines.h: Move function out of line to reduce dependencies. * Source/WebCore/html/HTMLElement.cpp * Source/WebCore/html/HTMLElement.h: Added a clang vtable workaround for WebKit includers. * Source/WebCore/platform/network/HTTPHeaderMap.h: Export symbol used by WebKit prefix header. * Source/WebCore/platform/network/ResourceErrorBase.cpp * Source/WebCore/platform/network/ResourceErrorBase.h: Out of line comparison because it is non-trivial and out of line is the easiest way to avoid exporting dependencies. * Source/WebKit/Platform/IPC/MessageSender.cpp * Source/WebKit/Platform/IPC/MessageSender.h: Added clang vtable workaround. Canonical link: https://commits.webkit.org/315226@main
1 parent 6c2b586 commit 03ee1c8

262 files changed

Lines changed: 1778 additions & 706 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
728728
bytecode/ToThisStatus.h
729729
bytecode/TrackedReferences.h
730730
bytecode/TypeLocation.h
731+
bytecode/TypeLocationInlines.h
731732
bytecode/UnlinkedCodeBlock.h
732733
bytecode/UnlinkedEvalCodeBlock.h
733734
bytecode/UnlinkedFunctionCodeBlock.h
@@ -827,6 +828,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
827828
heap/GCOwnedDataScope.h
828829
heap/GCRequest.h
829830
heap/GCSegmentedArray.h
831+
heap/GCSegmentedArrayInlines.h
830832
heap/Handle.h
831833
heap/HandleBlock.h
832834
heap/HandleForward.h
@@ -1017,6 +1019,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
10171019
parser/SourceTaintedOrigin.h
10181020
parser/UnlinkedSourceCode.h
10191021
parser/VariableEnvironment.h
1022+
parser/VariableEnvironmentInlines.h
10201023

10211024
profiler/ProfilerBytecode.h
10221025
profiler/ProfilerBytecodeSequence.h
@@ -1273,6 +1276,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
12731276
runtime/JSRemoteFunction.h
12741277
runtime/JSRunLoopTimer.h
12751278
runtime/JSScope.h
1279+
runtime/JSScopeInlines.h
12761280
runtime/JSSegmentedVariableObject.h
12771281
runtime/JSSentinel.h
12781282
runtime/JSSentinelInlines.h
@@ -1306,7 +1310,9 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
13061310
runtime/KeyAtomStringCache.h
13071311
runtime/KeyAtomStringCacheInlines.h
13081312
runtime/LazyClassStructure.h
1313+
runtime/LazyClassStructureInlines.h
13091314
runtime/LazyProperty.h
1315+
runtime/LazyPropertyInlines.h
13101316
runtime/LeafExecutable.h
13111317
runtime/Lookup.h
13121318
runtime/MachineContext.h
@@ -1353,6 +1359,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
13531359
runtime/PropertyDescriptor.h
13541360
runtime/PropertyName.h
13551361
runtime/PropertyNameArray.h
1362+
runtime/PropertyNameInlines.h
13561363
runtime/PropertyOffset.h
13571364
runtime/PropertySlot.h
13581365
runtime/PropertyStorage.h

‎Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj‎

Lines changed: 18 additions & 2 deletions
Large diffs are not rendered by default.

‎Source/JavaScriptCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ profiler/ProfilerEvent.cpp
106106
runtime/ArrayBufferView.cpp
107107
runtime/ArrayBufferView.h
108108
runtime/AtomicsObject.cpp
109-
runtime/CacheableIdentifier.h
110109
runtime/CacheableIdentifierInlines.h
111110
runtime/CodeCache.cpp
112111
runtime/CodeCache.h

‎Source/JavaScriptCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ runtime/StringPrototype.cpp
9898
runtime/Structure.cpp
9999
runtime/StructureInlines.h
100100
runtime/SymbolTable.h
101+
runtime/SymbolTableInlines.h
101102
runtime/TypeSet.cpp
102103
runtime/VMTraps.cpp
103104
runtime/WaiterListManager.h

‎Source/JavaScriptCore/bytecode/CodeBlock.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#include "SlotVisitorInlines.h"
8282
#include "SourceProvider.h"
8383
#include "StackVisitor.h"
84+
#include "SymbolTableInlines.h"
8485
#include "TypeLocationCache.h"
8586
#include "TypeProfiler.h"
8687
#include "VMInlines.h"

‎Source/JavaScriptCore/bytecode/GetByStatus.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "IntrinsicGetterAccessCase.h"
3838
#include "ModuleNamespaceAccessCase.h"
3939
#include "PropertyInlineCache.h"
40+
#include "PropertyNameInlines.h"
4041
#include <wtf/ListDump.h>
4142

4243
namespace JSC {

‎Source/JavaScriptCore/bytecode/RepatchInlines.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "CallLinkInfo.h"
2929
#include "ErrorInstance.h"
30+
#include "ErrorInstanceInlines.h"
3031
#include "ExceptionHelpers.h"
3132
#include "FrameTracers.h"
3233
#include "FunctionCodeBlock.h"

‎Source/JavaScriptCore/bytecode/TypeLocation.h‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ typedef intptr_t GlobalVariableID;
3939

4040
class TypeLocation {
4141
public:
42-
TypeLocation()
43-
: m_instructionTypeSet(TypeSet::create())
44-
, m_globalTypeSet(nullptr)
45-
, m_divotForFunctionOffsetIfReturnStatement(UINT_MAX)
46-
, m_lastSeenType(TypeNothing)
47-
{
48-
}
42+
TypeLocation();
4943

5044
GlobalVariableID m_globalVariableID;
5145
RefPtr<TypeSet> m_instructionTypeSet;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (C) 2014 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
25+
26+
#pragma once
27+
28+
#include <JavaScriptCore/TypeLocation.h>
29+
30+
namespace JSC {
31+
32+
inline TypeLocation::TypeLocation()
33+
: m_instructionTypeSet(TypeSet::create())
34+
, m_globalTypeSet(nullptr)
35+
, m_divotForFunctionOffsetIfReturnStatement(UINT_MAX)
36+
, m_lastSeenType(TypeNothing)
37+
{
38+
}
39+
40+
} // namespace JSC

‎Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "PrivateFieldPutKind.h"
4949
#include "StrongInlines.h"
5050
#include "SuperSampler.h"
51+
#include "SymbolTableInlines.h"
5152
#include "TopExceptionScope.h"
5253
#include "UnlinkedCodeBlock.h"
5354
#include "UnlinkedEvalCodeBlock.h"
@@ -56,6 +57,7 @@
5657
#include "UnlinkedModuleProgramCodeBlock.h"
5758
#include "UnlinkedProgramCodeBlock.h"
5859
#include "VMTrapsInlines.h"
60+
#include "VariableEnvironmentInlines.h"
5961
#include <wtf/BitVector.h>
6062
#include <wtf/HashSet.h>
6163
#include <wtf/StdLibExtras.h>

0 commit comments

Comments
 (0)