Skip to content

Commit 40f9622

Browse files
committed
TZone: Implement TZone Allocation on JavaScriptCore Types
https://bugs.webkit.org/show_bug.cgi?id=268673 rdar://122213822 Reviewed by Keith Miller. This patch implements TZone selection in bmalloc through the newly added TZoneHeapManager class. The macro that defines a TZone allocated type puts the type name, type size and type aligment in a static bmalloc_type. That static object is now placed in a newly added __DATA_CONST$__tzone_descs section. At startup time, each dylib / framework will register their types by passing this new section's start and end location to the TZoneHeapManager::registerTZoneTypes() method. When allocating a type for the first time, TZoneHeapManager will allocate if needed for all buckets for the same size and alignment. Then the manager will compute which of those bucket to use the current type. This is computed by a process start up seed and the size and type. The JavaScript types have been annotated and all JavaScript tests run. DumpRenderTree has been modified as well. This patch has TZone allocation turned off via BUSE_TZONE in bmalloc/BPlatform.h and USE_TZONE_MALLOC in wtc/PlatformUse.h The BUSE_TZONE macro was added to work around a linker bug where unused exported functions end up being eliminated. * Source/JavaScriptCore/API/tests/testapi.c: (main): * Source/JavaScriptCore/API/tests/testapi.cpp: (WTFTZoneInit): * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/Sources.txt: * Source/JavaScriptCore/assembler/testmasm.cpp: (main): * Source/JavaScriptCore/b3/air/testair.cpp: (main): * Source/JavaScriptCore/b3/testb3.h: * Source/JavaScriptCore/b3/testb3_1.cpp: (main): * Source/JavaScriptCore/dfg/testdfg.cpp: (main): * Source/JavaScriptCore/jit/JITOpaqueByproducts.h: * Source/JavaScriptCore/jsc.cpp: (main): (jscmain): * Source/JavaScriptCore/runtime/RegisterTZoneTypes.cpp: Added. (JSC::registerTZoneTypes): * Source/JavaScriptCore/runtime/RegisterTZoneTypes.h: Added. * Source/JavaScriptCore/wasm/WasmCallee.h: * Source/WTF/WTF.xcodeproj/project.pbxproj: * Source/WTF/wtf/CMakeLists.txt: * Source/WTF/wtf/PlatformUse.h: * Source/WTF/wtf/TZoneMalloc.h: * Source/WTF/wtf/TZoneMallocInitialization.h: Copied from Source/WTF/wtf/TZoneMalloc.h. * Source/WTF/wtf/TZoneMallocInlines.h: * Source/bmalloc/CMakeLists.txt: * Source/bmalloc/bmalloc.xcodeproj/project.pbxproj: * Source/bmalloc/bmalloc/BPlatform.h: * Source/bmalloc/bmalloc/Map.h: (bmalloc::Map::contains): * Source/bmalloc/bmalloc/TZoneHeap.cpp: * Source/bmalloc/bmalloc/TZoneHeap.h: (bmalloc::api::roundUpToMulipleOf8): (bmalloc::api::TZoneHeap::provideHeap): * Source/bmalloc/bmalloc/TZoneHeapInlines.h: * Source/bmalloc/bmalloc/TZoneHeapManager.cpp: Added. (bmalloc::api::TZoneHeapManager::init): (bmalloc::api::TZoneHeapManager::initTypenameTemplate): (bmalloc::api::TZoneHeapManager::registerTZoneTypes): (bmalloc::api::nameForType): (bmalloc::api::nameForTypeUpdateIndex): (bmalloc::api::TZoneHeapManager::closeRegistration): (bmalloc::api::TZoneHeapManager::ensureInstance): (bmalloc::api::TZoneHeapManager::populateBucketsForSizeClass): (bmalloc::api::TZoneHeapManager::heapRefForTZoneType): * Source/bmalloc/bmalloc/TZoneHeapManager.h: Added. (bmalloc::api::TZoneHeapManager::SizeAndAlign::SizeAndAlign): (bmalloc::api::TZoneHeapManager::SizeAndAlign::size const): (bmalloc::api::TZoneHeapManager::SizeAndAlign::alignment const): (bmalloc::api::TZoneHeapManager::SizeAndAlign::key const): (bmalloc::api::TZoneHeapManager::SizeAndAlign::hash): (bmalloc::api::TZoneHeapManager::SizeAndAlign::operator== const): (bmalloc::api::TZoneHeapManager::SizeAndAlign::operator bool const): (bmalloc::api::TZoneHeapManager::TZoneHeapManager): (bmalloc::api::TZoneHeapManager::getInstance): (bmalloc::api::TZoneHeapManager::mutex): (bmalloc::api::TZoneHeapManager::bucketCountForTypeCount): (bmalloc::api::TZoneHeapManager::tzoneBucketForKey): * Tools/DumpRenderTree/mac/DumpRenderTree.mm: (DumpRenderTreeMain): Canonical link: https://commits.webkit.org/274606@main
1 parent 9cfcb5f commit 40f9622

30 files changed

Lines changed: 872 additions & 81 deletions

Source/JavaScriptCore/API/tests/testapi.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
#include "JSScriptRefPrivate.h"
4242
#include "JSStringRefPrivate.h"
4343
#include "JSWeakPrivate.h"
44+
#if USE(TZONE_MALLOC)
45+
#include <_simple.h>
46+
#endif
4447
#if !OS(WINDOWS)
4548
#include <libgen.h>
4649
#endif
@@ -79,6 +82,10 @@
7982
void testObjectiveCAPI(const char*);
8083
#endif
8184

85+
#if USE(TZONE_MALLOC)
86+
void WTFTZoneInit(const char*);
87+
#endif
88+
8289
void configureJSCForTesting(void);
8390
int testCAPIViaCpp(const char* filter);
8491

@@ -1430,7 +1437,13 @@ static bool samplingProfilerTest(void)
14301437
return false;
14311438
}
14321439

1433-
int main(int argc, char* argv[])
1440+
#if USE(TZONE_MALLOC)
1441+
#define TZONE_EXTRA_MAIN_ARGS , const char** envp, const char **darwinEnvp
1442+
#else
1443+
#define TZONE_EXTRA_MAIN_ARGS
1444+
#endif
1445+
1446+
int main(int argc, char* argv[] TZONE_EXTRA_MAIN_ARGS)
14341447
{
14351448
#if OS(WINDOWS)
14361449
// Cygwin calls SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
@@ -1439,6 +1452,11 @@ int main(int argc, char* argv[])
14391452
SetErrorMode(0);
14401453
#endif
14411454

1455+
#if USE(TZONE_MALLOC)
1456+
UNUSED_PARAM(envp);
1457+
const char* boothash = _simple_getenv(darwinEnvp, "executable_boothash");
1458+
WTFTZoneInit(boothash);
1459+
#endif
14421460
configureJSCForTesting();
14431461

14441462
#if !OS(WINDOWS)

Source/JavaScriptCore/API/tests/testapi.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,25 @@
2828
#include "APICast.h"
2929
#include "JSGlobalObjectInlines.h"
3030
#include "MarkedJSValueRefArray.h"
31+
#include "RegisterTZoneTypes.h"
3132
#include <JavaScriptCore/JSContextRefPrivate.h>
3233
#include <JavaScriptCore/JSObjectRefPrivate.h>
3334
#include <JavaScriptCore/JavaScript.h>
3435
#include <wtf/DataLog.h>
3536
#include <wtf/Expected.h>
3637
#include <wtf/Noncopyable.h>
3738
#include <wtf/NumberOfCores.h>
39+
#include <wtf/TZoneMallocInitialization.h>
3840
#include <wtf/Vector.h>
3941
#include <wtf/text/StringCommon.h>
4042

4143
#if PLATFORM(COCOA)
4244
#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
4345
#endif
4446

47+
#if USE(TZONE_MALLOC)
48+
extern "C" void WTFTZoneInit(const char *);
49+
#endif
4550
extern "C" void configureJSCForTesting();
4651
extern "C" int testCAPIViaCpp(const char* filter);
4752
extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef);
@@ -742,6 +747,15 @@ void TestAPI::testJSObjectSetOnGlobalObjectSubclassDefinition()
742747
check(JSEvaluateScript(context, propertyName, globalObject, nullptr, 1, nullptr) == newObject, "Setting a property on a custom global object should set the property");
743748
}
744749

750+
#if USE(TZONE_MALLOC)
751+
void WTFTZoneInit(const char* seed)
752+
{
753+
WTF_TZONE_INIT(seed);
754+
JSC::registerTZoneTypes();
755+
WTF_TZONE_REGISTRATION_DONE();
756+
}
757+
#endif
758+
745759
void configureJSCForTesting()
746760
{
747761
JSC::Config::configureForTesting();

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@
942942
44F93E0E2AE71FBD00FFA37C /* JavaScriptCoreFramework.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44F93E0D2AE71F9F00FFA37C /* JavaScriptCoreFramework.cpp */; };
943943
451539B912DC994500EF7AC4 /* Yarr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451539B812DC994500EF7AC4 /* Yarr.h */; settings = {ATTRIBUTES = (Private, ); }; };
944944
4615E46A2B5849F4001D4D53 /* WasmBBQJIT32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4615E4672B5833FB001D4D53 /* WasmBBQJIT32_64.cpp */; };
945-
4615E46B2B5849F4001D4D53 /* WasmBBQJIT64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */; };
945+
4615E46B2B5849F4001D4D53 /* WasmBBQJIT64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */; };
946946
473DA4A4764C45FE871B0485 /* DefinePropertyAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 169948EDE68D4054B01EF797 /* DefinePropertyAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
947947
4B1F22F62900BFC700CB5E66 /* Width.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBA4CD428FF5FE5003EBFC4 /* Width.h */; settings = {ATTRIBUTES = (Private, ); }; };
948948
4B46940328984FA800512FDF /* MacroAssemblerARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */; };
@@ -1242,6 +1242,7 @@
12421242
641DF80E2890C7D500F9895F /* WasmSIMDOpcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 641DF80D2890C7D500F9895F /* WasmSIMDOpcodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
12431243
642D20D42B476A250030545E /* WasmSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14AB0C92231747B7000250BC /* WasmSlowPaths.cpp */; };
12441244
642D20D52B476A2E0030545E /* WasmIPIntSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53091F972ABE1F570076CBC4 /* WasmIPIntSlowPaths.cpp */; };
1245+
65072B082B6C3DEA0065065C /* RegisterTZoneTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 65072B062B6C3DEA0065065C /* RegisterTZoneTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
12451246
6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
12461247
651122FD14046A4C002B101D /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
12471248
651122FE14046A4C002B101D /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
@@ -1250,7 +1251,6 @@
12501251
65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; };
12511252
653BC43F26D013A600D8BE20 /* YarrJITRegisters.h in Headers */ = {isa = PBXBuildFile; fileRef = 653BC43E26D013A600D8BE20 /* YarrJITRegisters.h */; settings = {ATTRIBUTES = (Private, ); }; };
12521253
65570F5A1AA4C3EA009B3C23 /* Regress141275.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65570F591AA4C00A009B3C23 /* Regress141275.mm */; };
1253-
6571E9822B23F4D0009DF224 /* JITTZoneImpls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6571E9812B23F4D0009DF224 /* JITTZoneImpls.cpp */; };
12541254
657CF45919BF6662004ACBF2 /* JSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = 657CF45719BF6662004ACBF2 /* JSCallee.h */; settings = {ATTRIBUTES = (Private, ); }; };
12551255
658824AF1E5CFDB000FB7359 /* ConfigFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 658824AE1E5CFDB000FB7359 /* ConfigFile.h */; settings = {ATTRIBUTES = (Private, ); }; };
12561256
658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 658D3A5519638268003C45D6 /* VMEntryRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3963,9 +3963,9 @@
39633963
451539B812DC994500EF7AC4 /* Yarr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Yarr.h; path = yarr/Yarr.h; sourceTree = "<group>"; };
39643964
45E12D8806A49B0F00E9DF84 /* jsc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsc.cpp; sourceTree = "<group>"; tabWidth = 4; };
39653965
4615E4662B5833FB001D4D53 /* WasmBBQJIT64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmBBQJIT64.h; sourceTree = "<group>"; };
3966-
4615E4672B5833FB001D4D53 /* WasmBBQJIT32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmBBQJIT32_64.cpp; sourceTree = "<group>"; };
3967-
4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmBBQJIT64.cpp; sourceTree = "<group>"; };
3968-
4615E4692B5833FC001D4D53 /* WasmBBQJIT32_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmBBQJIT32_64.h; sourceTree = "<group>"; };
3966+
4615E4672B5833FB001D4D53 /* WasmBBQJIT32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmBBQJIT32_64.cpp; sourceTree = "<group>"; };
3967+
4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmBBQJIT64.cpp; sourceTree = "<group>"; };
3968+
4615E4692B5833FC001D4D53 /* WasmBBQJIT32_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmBBQJIT32_64.h; sourceTree = "<group>"; };
39693969
4B78E098294427D2003C6682 /* B3SIMDValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3SIMDValue.cpp; path = b3/B3SIMDValue.cpp; sourceTree = "<group>"; };
39703970
4B78E099294427D2003C6682 /* B3Const128Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3Const128Value.h; path = b3/B3Const128Value.h; sourceTree = "<group>"; };
39713971
4B78E09A294427D2003C6682 /* B3SIMDValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3SIMDValue.h; path = b3/B3SIMDValue.h; sourceTree = "<group>"; };
@@ -4356,6 +4356,8 @@
43564356
62EC9BB41B7EB07C00303AD1 /* CallFrameShuffleData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallFrameShuffleData.cpp; sourceTree = "<group>"; };
43574357
62EC9BB51B7EB07C00303AD1 /* CallFrameShuffleData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrameShuffleData.h; sourceTree = "<group>"; };
43584358
641DF80D2890C7D500F9895F /* WasmSIMDOpcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmSIMDOpcodes.h; sourceTree = "<group>"; };
4359+
65072B052B6C3DEA0065065C /* RegisterTZoneTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterTZoneTypes.cpp; sourceTree = "<group>"; };
4360+
65072B062B6C3DEA0065065C /* RegisterTZoneTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterTZoneTypes.h; sourceTree = "<group>"; };
43594361
6507D2970E871E4A00D7D896 /* JSTypeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypeInfo.h; sourceTree = "<group>"; };
43604362
651122E5140469BA002B101D /* testRegExp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testRegExp.cpp; sourceTree = "<group>"; };
43614363
6511230514046A4C002B101D /* testRegExp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testRegExp; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -7687,9 +7689,9 @@
76877689
FED5FA3329A0859C00798A7F /* WasmBBQJIT.cpp */,
76887690
FED5FA3229A0859C00798A7F /* WasmBBQJIT.h */,
76897691
4615E4672B5833FB001D4D53 /* WasmBBQJIT32_64.cpp */,
7690-
4615E4692B5833FC001D4D53 /* WasmBBQJIT32_64.h */,
7691-
4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */,
7692-
4615E4662B5833FB001D4D53 /* WasmBBQJIT64.h */,
7692+
4615E4692B5833FC001D4D53 /* WasmBBQJIT32_64.h */,
7693+
4615E4682B5833FB001D4D53 /* WasmBBQJIT64.cpp */,
7694+
4615E4662B5833FB001D4D53 /* WasmBBQJIT64.h */,
76937695
53CA73071EA533D80076049D /* WasmBBQPlan.cpp */,
76947696
53CA73081EA533D80076049D /* WasmBBQPlan.h */,
76957697
AD4B1DF71DF244D70071AE32 /* WasmBinding.cpp */,
@@ -8636,6 +8638,8 @@
86368638
84925A9A22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.cpp */,
86378639
84925A9B22B30CBA00D1DFFF /* RegExpStringIteratorPrototype.h */,
86388640
276B38A22A71D1B600252F4E /* RegExpStringIteratorPrototypeInlines.h */,
8641+
65072B052B6C3DEA0065065C /* RegisterTZoneTypes.cpp */,
8642+
65072B062B6C3DEA0065065C /* RegisterTZoneTypes.h */,
86398643
FE9F3FBA2613C87C0069E89F /* ResourceExhaustion.cpp */,
86408644
FE9F3FB82613C7880069E89F /* ResourceExhaustion.h */,
86418645
70B0A9D01A9B66200001306A /* RuntimeFlags.h */,
@@ -11583,6 +11587,7 @@
1158311587
623A37EC1B87A7C000754209 /* RegisterMap.h in Headers */,
1158411588
0FC314121814559100033232 /* RegisterSet.h in Headers */,
1158511589
0FD0E5F01E46BF250006AB08 /* RegisterState.h in Headers */,
11590+
65072B082B6C3DEA0065065C /* RegisterTZoneTypes.h in Headers */,
1158611591
A57D23EE1891B5540031C7FA /* RegularExpression.h in Headers */,
1158711592
0F7CF94F1DBEEE880098CC12 /* ReleaseHeapAccessScope.h in Headers */,
1158811593
99D6A1161BEAD34D00E25C37 /* RemoteAutomationTarget.h in Headers */,
@@ -13135,7 +13140,7 @@
1313513140
538F15EF268FBBB600D601C4 /* UnifiedSource155.cpp in Sources */,
1313613141
E3C091E929B07D4C00CD6D97 /* WasmBBQJIT.cpp in Sources */,
1313713142
4615E46A2B5849F4001D4D53 /* WasmBBQJIT32_64.cpp in Sources */,
13138-
4615E46B2B5849F4001D4D53 /* WasmBBQJIT64.cpp in Sources */,
13143+
4615E46B2B5849F4001D4D53 /* WasmBBQJIT64.cpp in Sources */,
1313913144
642D20D52B476A2E0030545E /* WasmIPIntSlowPaths.cpp in Sources */,
1314013145
642D20D42B476A250030545E /* WasmSlowPaths.cpp in Sources */,
1314113146
E31135C9281B5B0000C1A4A9 /* ZydisFormatterATT.c in Sources */,
@@ -13173,7 +13178,6 @@
1317313178
buildActionMask = 2147483647;
1317413179
files = (
1317513180
44F93E0E2AE71FBD00FFA37C /* JavaScriptCoreFramework.cpp in Sources */,
13176-
6571E9822B23F4D0009DF224 /* JITTZoneImpls.cpp in Sources */,
1317713181
);
1317813182
runOnlyForDeploymentPostprocessing = 0;
1317913183
};

Source/JavaScriptCore/Sources.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ runtime/RegExpMatchesArray.cpp
10201020
runtime/RegExpObject.cpp
10211021
runtime/RegExpPrototype.cpp
10221022
runtime/RegExpStringIteratorPrototype.cpp
1023+
runtime/RegisterTZoneTypes.cpp
10231024
runtime/ResourceExhaustion.cpp
10241025
runtime/RuntimeTZoneImpls.cpp
10251026
runtime/RuntimeType.cpp

Source/JavaScriptCore/assembler/testmasm.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "InitializeThreading.h"
3333
#include "LinkBuffer.h"
3434
#include "ProbeContext.h"
35+
#include "RegisterTZoneTypes.h"
3536
#include "StackAlignment.h"
3637
#include <limits>
3738
#include <wtf/Compiler.h>
@@ -40,6 +41,7 @@
4041
#include <wtf/Lock.h>
4142
#include <wtf/NumberOfCores.h>
4243
#include <wtf/PtrTag.h>
44+
#include <wtf/TZoneMallocInitialization.h>
4345
#include <wtf/Threading.h>
4446
#include <wtf/WTFProcess.h>
4547
#include <wtf/text/StringCommon.h>
@@ -6305,8 +6307,15 @@ static void run(const char*)
63056307

63066308
#endif // ENABLE(JIT)
63076309

6308-
int main(int argc, char** argv)
6310+
int main(int argc, char** argv WTF_TZONE_EXTRA_MAIN_ARGS)
63096311
{
6312+
#if USE(TZONE_MALLOC)
6313+
const char* boothash = _simple_getenv(darwinEnvp, "executable_boothash");
6314+
WTF_TZONE_INIT(boothash);
6315+
JSC::registerTZoneTypes();
6316+
WTF_TZONE_REGISTRATION_DONE();
6317+
#endif
6318+
63106319
const char* filter = nullptr;
63116320
switch (argc) {
63126321
case 1:

Source/JavaScriptCore/b3/air/testair.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@
4141
#include "Options.h"
4242
#include "ProbeContext.h"
4343
#include "PureNaN.h"
44+
#include "RegisterTZoneTypes.h"
4445
#include <regex>
4546
#include <string>
4647
#include <wtf/DataLog.h>
4748
#include <wtf/Lock.h>
4849
#include <wtf/NumberOfCores.h>
4950
#include <wtf/StdMap.h>
51+
#include <wtf/TZoneMallocInitialization.h>
5052
#include <wtf/Threading.h>
5153
#include <wtf/WTFProcess.h>
5254
#include <wtf/text/StringCommon.h>
@@ -2776,8 +2778,15 @@ static void run(const char*)
27762778

27772779
#endif // ENABLE(B3_JIT)
27782780

2779-
int main(int argc, char** argv)
2781+
int main(int argc, char** argv WTF_TZONE_EXTRA_MAIN_ARGS)
27802782
{
2783+
#if USE(TZONE_MALLOC)
2784+
const char* boothash = _simple_getenv(darwinEnvp, "executable_boothash");
2785+
WTF_TZONE_INIT(boothash);
2786+
JSC::registerTZoneTypes();
2787+
WTF_TZONE_REGISTRATION_DONE();
2788+
#endif
2789+
27812790
const char* filter = nullptr;
27822791
switch (argc) {
27832792
case 1:

Source/JavaScriptCore/b3/testb3.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#include <wtf/Lock.h>
7979
#include <wtf/NumberOfCores.h>
8080
#include <wtf/StdList.h>
81+
#include <wtf/TZoneMallocInitialization.h>
8182
#include <wtf/Threading.h>
8283
#include <wtf/WTFProcess.h>
8384
#include <wtf/text/StringCommon.h>

Source/JavaScriptCore/b3/testb3_1.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#include "config.h"
2727
#include "testb3.h"
2828

29+
#include "RegisterTZoneTypes.h"
30+
#include <wtf/TZoneMallocInitialization.h>
31+
2932
#if ENABLE(B3_JIT) && !CPU(ARM)
3033

3134
Lock crashLock;
@@ -935,8 +938,15 @@ extern const JSC::JITOperationAnnotation startOfJITOperationsInTestB3 __asm("sec
935938
extern const JSC::JITOperationAnnotation endOfJITOperationsInTestB3 __asm("section$end$__DATA_CONST$__jsc_ops");
936939
#endif
937940

938-
int main(int argc, char** argv)
941+
int main(int argc, char** argv WTF_TZONE_EXTRA_MAIN_ARGS)
939942
{
943+
#if USE(TZONE_MALLOC)
944+
const char* boothash = _simple_getenv(darwinEnvp, "executable_boothash");
945+
WTF_TZONE_INIT(boothash);
946+
JSC::registerTZoneTypes();
947+
WTF_TZONE_REGISTRATION_DONE();
948+
#endif
949+
940950
TestConfig config;
941951
for (int i = 1; i < argc; i++) {
942952
if (!strcmp(argv[i], "-filter")) {

Source/JavaScriptCore/dfg/testdfg.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
// The above are needed before DFGAbstractValue.h
3030
#include "DFGAbstractValue.h"
3131
#include "InitializeThreading.h"
32+
#include "RegisterTZoneTypes.h"
3233
#include <wtf/DataLog.h>
34+
#include <wtf/TZoneMallocInitialization.h>
35+
#include <wtf/Threading.h>
3336
#include <wtf/WTFProcess.h>
3437
#include <wtf/text/StringCommon.h>
3538

@@ -98,8 +101,15 @@ static void run(const char*)
98101

99102
#endif // ENABLE(DFG_JIT)
100103

101-
int main(int argc, char** argv)
104+
int main(int argc, char** argv WTF_TZONE_EXTRA_MAIN_ARGS)
102105
{
106+
#if USE(TZONE_MALLOC)
107+
const char* boothash = _simple_getenv(darwinEnvp, "executable_boothash");
108+
WTF_TZONE_INIT(boothash);
109+
JSC::registerTZoneTypes();
110+
WTF_TZONE_REGISTRATION_DONE();
111+
#endif
112+
103113
const char* filter = nullptr;
104114
switch (argc) {
105115
case 1:

Source/JavaScriptCore/jit/JITOpaqueByproducts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace JSC {
3636

3737
class OpaqueByproducts {
3838
WTF_MAKE_NONCOPYABLE(OpaqueByproducts)
39-
WTF_MAKE_TZONE_ALLOCATED(OpaqueByproducts);
39+
WTF_MAKE_TZONE_ALLOCATED_EXPORT(OpaqueByproducts, JS_EXPORT_PRIVATE);
4040
public:
4141
OpaqueByproducts();
4242
JS_EXPORT_PRIVATE ~OpaqueByproducts();

0 commit comments

Comments
 (0)