Skip to content

Commit 423f593

Browse files
committed
Re-land "[Build speed] Reduce JSC includes in WebCore JS bindings"
Unreviewed, re-landing. This re-lands commit 5cdc5c9. Added some missing #includes. Originally-landed-as: 312470@main (5cdc5c9). rdar://175995348 Canonical link: https://commits.webkit.org/312487@main
1 parent 7e51750 commit 423f593

274 files changed

Lines changed: 1857 additions & 1383 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/API/JSContext.mm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#import "JavaScriptCore.h"
4545
#import "ObjcRuntimeExtras.h"
4646
#import "StrongInlines.h"
47+
#import "TopExceptionScope.h"
4748
#import <wtf/RetainPtr.h>
4849
#import <wtf/WeakObjCPtr.h>
4950

‎Source/JavaScriptCore/API/JSContextRef.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "IntegrityInlines.h"
3434
#include "JSAPIGlobalObject.h"
3535
#include "JSAPIWrapperObject.h"
36+
#include "JSCJSValueInlines.h"
3637
#include "JSCallbackObject.h"
3738
#include "JSClassRef.h"
3839
#include "JSObjectInlines.h"

‎Source/JavaScriptCore/API/JSScript.mm‎

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

2626
#import "config.h"
2727
#import "JSBase.h"
28+
#import "JSValueRef.h"
2829
#import "JSScriptInternal.h"
2930

3031
#import "APICast.h"

‎Source/JavaScriptCore/API/JSScriptSourceProvider.mm‎

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

2626
#import "config.h"
2727
#import "JSBase.h"
28+
#import "JSValueRef.h"
2829
#import "JSScriptSourceProvider.h"
2930

3031
#if JSC_OBJC_API_ENABLED

‎Source/JavaScriptCore/API/JSVirtualMachine.mm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#import <mutex>
4141
#import <wtf/Lock.h>
4242
#import <wtf/RetainPtr.h>
43+
#import <wtf/cocoa/TypeCastsCocoa.h>
4344

4445
static NSMapTable *globalWrapperCache = 0;
4546

‎Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "JSWeakObjectMapRefPrivate.h"
2828

2929
#include "APICast.h"
30+
#include "JSCJSValueInlines.h"
3031
#include "JSCallbackObject.h"
3132
#include "JSGlobalObjectInlines.h"
3233
#include "JSWeakObjectMapRefInternal.h"

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
10411041
runtime/BufferMemoryHandle.h
10421042
runtime/Butterfly.h
10431043
runtime/ButterflyInlines.h
1044+
runtime/ButterflyInlinesLight.h
10441045
runtime/BytecodeCacheError.h
10451046
runtime/CachePayload.h
10461047
runtime/CacheableIdentifier.h
@@ -1158,6 +1159,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
11581159
runtime/JSArrayBufferPrototype.h
11591160
runtime/JSArrayBufferView.h
11601161
runtime/JSArrayBufferViewInlines.h
1162+
runtime/JSArrayBufferViewInlinesLight.h
11611163
runtime/JSArrayInlines.h
11621164
runtime/JSArrayIterator.h
11631165
runtime/JSArrayBuffer.h
@@ -1205,6 +1207,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
12051207
runtime/JSGenericTypedArrayView.h
12061208
runtime/JSGenericTypedArrayViewConstructor.h
12071209
runtime/JSGenericTypedArrayViewInlines.h
1210+
runtime/JSGenericTypedArrayViewInlinesLight.h
12081211
runtime/JSGenericTypedArrayViewPrototype.h
12091212
runtime/JSGenericTypedArrayViewPrototypeInlines.h
12101213
runtime/JSGlobalLexicalEnvironment.h
@@ -1382,6 +1385,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
13821385
runtime/StructureCreateInlines.h
13831386
runtime/StructureID.h
13841387
runtime/StructureInlines.h
1388+
runtime/StructureInlinesLight.h
13851389
runtime/StructureRareData.h
13861390
runtime/StructureRareDataInlines.h
13871391
runtime/StructureTransitionTable.h

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C417B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; };
187187
0F2B66F317B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */; };
188188
0F2B66F417B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
189+
FC601BAFB07E4D888C5AA7AD /* JSGenericTypedArrayViewInlinesLight.h in Headers */ = {isa = PBXBuildFile; fileRef = C1FD0F0D73794C72BFF37F4C /* JSGenericTypedArrayViewInlinesLight.h */; settings = {ATTRIBUTES = (Private, ); }; };
190+
E2A9D8474FB84C3B91DA47B1 /* JSArrayBufferViewInlinesLight.h in Headers */ = {isa = PBXBuildFile; fileRef = A6B8D2E1CD3A47F8BB29B6AE /* JSArrayBufferViewInlinesLight.h */; settings = {ATTRIBUTES = (Private, ); }; };
191+
B4C7A5933E61498DAF3D7C12 /* StructureInlinesLight.h in Headers */ = {isa = PBXBuildFile; fileRef = D8E1F0A2B3C94D7E8F1A2B3C /* StructureInlinesLight.h */; settings = {ATTRIBUTES = (Private, ); }; };
189192
0F2B66F517B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
190193
0F2B66F617B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C817B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
191194
0F2B66F717B6B5AB00A7AE3F /* JSInt8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C917B6B5AB00A7AE3F /* JSInt8Array.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -485,6 +488,7 @@
485488
0FB7F39615ED8E4600F167B2 /* ArrayStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
486489
0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */; settings = {ATTRIBUTES = (Private, ); }; };
487490
0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
491+
796C0603368743C78E7F9859 /* ButterflyInlinesLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B9420DB4ACC4A7D83B1C8AE /* ButterflyInlinesLight.h */; settings = {ATTRIBUTES = (Private, ); }; };
488492
0FB7F39915ED8E4600F167B2 /* IndexingHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */; settings = {ATTRIBUTES = (Private, ); }; };
489493
0FB7F39A15ED8E4600F167B2 /* IndexingHeaderInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
490494
0FB7F39B15ED8E4600F167B2 /* IndexingType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2945,6 +2949,9 @@
29452949
0F2B66C417B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewConstructor.h; sourceTree = "<group>"; };
29462950
0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewConstructorInlines.h; sourceTree = "<group>"; };
29472951
0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewInlines.h; sourceTree = "<group>"; };
2952+
C1FD0F0D73794C72BFF37F4C /* JSGenericTypedArrayViewInlinesLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewInlinesLight.h; sourceTree = "<group>"; };
2953+
A6B8D2E1CD3A47F8BB29B6AE /* JSArrayBufferViewInlinesLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferViewInlinesLight.h; sourceTree = "<group>"; };
2954+
D8E1F0A2B3C94D7E8F1A2B3C /* StructureInlinesLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureInlinesLight.h; sourceTree = "<group>"; };
29482955
0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewPrototype.h; sourceTree = "<group>"; };
29492956
0F2B66C817B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGenericTypedArrayViewPrototypeInlines.h; sourceTree = "<group>"; };
29502957
0F2B66C917B6B5AB00A7AE3F /* JSInt8Array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInt8Array.h; sourceTree = "<group>"; };
@@ -3454,6 +3461,7 @@
34543461
0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayStorage.h; sourceTree = "<group>"; };
34553462
0FB7F38B15ED8E3800F167B2 /* Butterfly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Butterfly.h; sourceTree = "<group>"; };
34563463
0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButterflyInlines.h; sourceTree = "<group>"; };
3464+
7B9420DB4ACC4A7D83B1C8AE /* ButterflyInlinesLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButterflyInlinesLight.h; sourceTree = "<group>"; };
34573465
0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingHeader.h; sourceTree = "<group>"; };
34583466
0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingHeaderInlines.h; sourceTree = "<group>"; };
34593467
0FB7F38F15ED8E3800F167B2 /* IndexingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexingType.h; sourceTree = "<group>"; };
@@ -8554,6 +8562,7 @@
85548562
9E729409190F0306001A91B5 /* BundlePath.mm */,
85558563
0FB7F38B15ED8E3800F167B2 /* Butterfly.h */,
85568564
0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */,
8565+
7B9420DB4ACC4A7D83B1C8AE /* ButterflyInlinesLight.h */,
85578566
1435952022A521CA00E8086D /* BytecodeCacheError.cpp */,
85588567
1435951F22A521CA00E8086D /* BytecodeCacheError.h */,
85598568
FE8DE54E23AC3A8E005C9142 /* CacheableIdentifier.cpp */,
@@ -8882,6 +8891,7 @@
88828891
0F2B66BA17B6B5AB00A7AE3F /* JSArrayBufferView.cpp */,
88838892
0F2B66BB17B6B5AB00A7AE3F /* JSArrayBufferView.h */,
88848893
0F2B66BC17B6B5AB00A7AE3F /* JSArrayBufferViewInlines.h */,
8894+
A6B8D2E1CD3A47F8BB29B6AE /* JSArrayBufferViewInlinesLight.h */,
88858895
539FB8B91C99DA7C00940FA1 /* JSArrayInlines.h */,
88868896
539DD7F323C1BBA900905F13 /* JSArrayIterator.cpp */,
88878897
539DD7F423C1BBA900905F13 /* JSArrayIterator.h */,
@@ -8970,6 +8980,7 @@
89708980
0F2B66C417B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h */,
89718981
0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */,
89728982
0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */,
8983+
C1FD0F0D73794C72BFF37F4C /* JSGenericTypedArrayViewInlinesLight.h */,
89738984
91C3265D2BFFB2BF009C7E2B /* JSGenericTypedArrayViewPrototype.cpp */,
89748985
0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */,
89758986
53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */,
@@ -9409,6 +9420,7 @@
94099420
0FD2C92516D01EE900C7803F /* StructureCreateInlines.h */,
94109421
537FEEC82742BDA300C9EFEE /* StructureID.h */,
94119422
0FD2C92316D01EE900C7803F /* StructureInlines.h */,
9423+
D8E1F0A2B3C94D7E8F1A2B3C /* StructureInlinesLight.h */,
94129424
C2F0F2D016BAEEE900187C19 /* StructureRareData.cpp */,
94139425
C2FE18A316BAEC4000AF3061 /* StructureRareData.h */,
94149426
C20BA92C16BB1C1500B3AEA2 /* StructureRareDataInlines.h */,
@@ -11180,6 +11192,7 @@
1118011192
9E72940B190F0514001A91B5 /* BundlePath.h in Headers */,
1118111193
0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
1118211194
0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
11195+
796C0603368743C78E7F9859 /* ButterflyInlinesLight.h in Headers */,
1118311196
C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
1118411197
1435952122A521CD00E8086D /* BytecodeCacheError.h in Headers */,
1118511198
0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */,
@@ -11909,6 +11922,7 @@
1190911922
A38D250E25800D440042BFDD /* JSArrayBufferPrototypeInlines.h in Headers */,
1191011923
0F2B66E917B6B5AB00A7AE3F /* JSArrayBufferView.h in Headers */,
1191111924
0F2B66EA17B6B5AB00A7AE3F /* JSArrayBufferViewInlines.h in Headers */,
11925+
E2A9D8474FB84C3B91DA47B1 /* JSArrayBufferViewInlinesLight.h in Headers */,
1191211926
539FB8BA1C99DA7C00940FA1 /* JSArrayInlines.h in Headers */,
1191311927
539DD7F523C1BBB500905F13 /* JSArrayIterator.h in Headers */,
1191411928
8CF21B932DD9D68A00355A6C /* JSAsyncDisposableStack.h in Headers */,
@@ -11988,6 +12002,7 @@
1198812002
0F2B66F217B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h in Headers */,
1198912003
0F2B66F317B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h in Headers */,
1199012004
0F2B66F417B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h in Headers */,
12005+
FC601BAFB07E4D888C5AA7AD /* JSGenericTypedArrayViewInlinesLight.h in Headers */,
1199112006
0F2B66F517B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h in Headers */,
1199212007
53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */,
1199312008
0F2B66F617B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */,
@@ -12526,6 +12541,7 @@
1252612541
0FD2C92616D01EE900C7803F /* StructureCreateInlines.h in Headers */,
1252712542
537FEEC92742BDA300C9EFEE /* StructureID.h in Headers */,
1252812543
0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */,
12544+
B4C7A5933E61498DAF3D7C12 /* StructureInlinesLight.h in Headers */,
1252912545
C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */,
1253012546
C20BA92D16BB1C1500B3AEA2 /* StructureRareDataInlines.h in Headers */,
1253112547
0F9332A514CA7DDD0085F3C6 /* StructureSet.h in Headers */,

‎Source/JavaScriptCore/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ inspector/JSJavaScriptCallFrame.cpp
4444
inspector/agents/InspectorDebuggerAgent.cpp
4545
interpreter/CallFrame.cpp
4646
interpreter/CallFrame.h
47-
interpreter/CallFrameInlines.h
4847
interpreter/Interpreter.cpp
4948
jit/JITOperations.cpp
5049
jit/JITThunks.cpp

‎Source/JavaScriptCore/bytecode/CodeBlock.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#pragma once
3131

32+
#include <JavaScriptCore/CallFrameInlines.h>
3233
#include <JavaScriptCore/CodeBlockHash.h>
3334
#include <JavaScriptCore/DirectEvalCodeCache.h>
3435
#include <JavaScriptCore/ICStatusMap.h>
@@ -1078,6 +1079,22 @@ void ScriptExecutable::prepareForExecution(VM& vm, JSFunction* function, JSScope
10781079

10791080
void setPrinter(Printer::PrintRecord&, CodeBlock*);
10801081

1082+
WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
1083+
inline Register& CallFrame::r(VirtualRegister reg)
1084+
{
1085+
if (reg.isConstant())
1086+
SUPPRESS_MEMORY_UNSAFE_CAST return *reinterpret_cast<Register*>(&this->codeBlock()->constantRegister(reg));
1087+
return this[reg.offset()];
1088+
}
1089+
WTF_ALLOW_UNSAFE_BUFFER_USAGE_END
1090+
1091+
inline JSCell* CallFrame::codeOwnerCell() const
1092+
{
1093+
if (callee().isNativeCallee())
1094+
return codeOwnerCellSlow();
1095+
return codeBlock();
1096+
}
1097+
10811098
} // namespace JSC
10821099

10831100
namespace WTF {

0 commit comments

Comments
 (0)