Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (262927 => 262928)
--- trunk/Source/_javascript_Core/ChangeLog 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-06-11 22:47:21 UTC (rev 262928)
@@ -1,3 +1,46 @@
+2020-06-11 Saam Barati <[email protected]>
+
+ Replace uses of black/white list with block/allow list
+ https://bugs.webkit.org/show_bug.cgi?id=213084
+
+ Reviewed by Keith Miller.
+
+ We should be using racially neutral names in our code. From Chromium style guide:
+
+ "Terms such as 'blacklist' and 'whitelist' reinforce the notion that
+ black==bad and white==good."
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * Sources.txt:
+ * b3/air/AirLowerAfterRegAlloc.cpp:
+ (JSC::B3::Air::lowerAfterRegAlloc):
+ * dfg/DFGDriver.cpp:
+ (JSC::DFG::ensureGlobalDFGAllowlist):
+ (JSC::DFG::compileImpl):
+ (JSC::DFG::ensureGlobalDFGWhitelist): Deleted.
+ * dfg/DFGTierUpCheckInjectionPhase.cpp:
+ (JSC::DFG::ensureGlobalFTLAllowlist):
+ (JSC::DFG::TierUpCheckInjectionPhase::run):
+ (JSC::DFG::ensureGlobalFTLWhitelist): Deleted.
+ * heap/MachineStackMarker.cpp:
+ * inspector/scripts/codegen/objc_generator.py:
+ (ObjCGenerator.should_generate_types_for_domain):
+ (ObjCGenerator.should_generate_commands_for_domain):
+ (ObjCGenerator.should_generate_events_for_domain):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::ensureGlobalJITAllowlist):
+ (JSC::LLInt::shouldJIT):
+ (JSC::LLInt::ensureGlobalJITWhitelist): Deleted.
+ * runtime/OptionsList.h:
+ * tools/FunctionAllowlist.cpp: Copied from Source/_javascript_Core/tools/FunctionWhitelist.cpp.
+ (JSC::FunctionAllowlist::FunctionAllowlist):
+ (JSC::FunctionAllowlist::contains const):
+ (JSC::FunctionWhitelist::FunctionWhitelist): Deleted.
+ (JSC::FunctionWhitelist::contains const): Deleted.
+ * tools/FunctionAllowlist.h: Copied from Source/_javascript_Core/tools/FunctionWhitelist.h.
+ * tools/FunctionWhitelist.cpp: Removed.
+ * tools/FunctionWhitelist.h: Removed.
+
2020-06-11 Yusuke Suzuki <[email protected]>
[JSC] Return DisposableCallSiteIndex when destroying GCAwareJITStubRoutineWithExceptionHandler
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (262927 => 262928)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2020-06-11 22:47:21 UTC (rev 262928)
@@ -911,6 +911,7 @@
52CD0F5D2242F569004A18A5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
52CD0F5E2242F569004A18A5 /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* _javascript_Core.framework */; };
52CD0F682242F71C004A18A5 /* testdfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52CD0F672242F71C004A18A5 /* testdfg.cpp */; };
+ 52EED7942492B870008F4C93 /* FunctionAllowlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 52EED7932492B868008F4C93 /* FunctionAllowlist.h */; };
52F6C35E1E71EB080081F4CC /* WebAssemblyWrapperFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F6C35C1E71EB080081F4CC /* WebAssemblyWrapperFunction.h */; };
530A66B91FA3E78B0026A545 /* UnifiedSource3-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 530A66B11FA3E77A0026A545 /* UnifiedSource3-mm.mm */; };
530A66BA1FA3E78B0026A545 /* UnifiedSource4-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 530A66B81FA3E77E0026A545 /* UnifiedSource4-mm.mm */; };
@@ -1932,7 +1933,6 @@
FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99B2481C24B6D300C82159 /* JITNegGenerator.h */; };
FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; };
- FEA0C4031CDD7D1D00481991 /* FunctionWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0C4011CDD7D0E00481991 /* FunctionWhitelist.h */; };
FEA3BBA8212B655900E93AD1 /* CallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA3BBA7212B655800E93AD1 /* CallFrameInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEA3BBAC212C97CB00E93AD1 /* DFGCFG.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA3BBAB212C97CB00E93AD1 /* DFGCFG.h */; };
FEB51F6C1A97B688001F921C /* Regress141809.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEB51F6B1A97B688001F921C /* Regress141809.mm */; };
@@ -3592,6 +3592,8 @@
52CD0F642242F569004A18A5 /* testdfg */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testdfg; sourceTree = BUILT_PRODUCTS_DIR; };
52CD0F672242F71C004A18A5 /* testdfg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testdfg.cpp; path = dfg/testdfg.cpp; sourceTree = "<group>"; };
52D1308F221CE03A009C836C /* foo.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = foo.js; sourceTree = "<group>"; };
+ 52EED7922492B868008F4C93 /* FunctionAllowlist.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionAllowlist.cpp; sourceTree = "<group>"; };
+ 52EED7932492B868008F4C93 /* FunctionAllowlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionAllowlist.h; sourceTree = "<group>"; };
52F6C35B1E71EB080081F4CC /* WebAssemblyWrapperFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyWrapperFunction.cpp; path = js/WebAssemblyWrapperFunction.cpp; sourceTree = "<group>"; };
52F6C35C1E71EB080081F4CC /* WebAssemblyWrapperFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyWrapperFunction.h; path = js/WebAssemblyWrapperFunction.h; sourceTree = "<group>"; };
530A63401FA3E31C0026A545 /* SourcesCocoa.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourcesCocoa.txt; sourceTree = "<group>"; };
@@ -5228,8 +5230,6 @@
FE99B2481C24B6D300C82159 /* JITNegGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITNegGenerator.h; sourceTree = "<group>"; };
FEA0861E182B7A0400F6D851 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpoint.h; sourceTree = "<group>"; };
FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerPrimitives.h; sourceTree = "<group>"; };
- FEA0C4001CDD7D0E00481991 /* FunctionWhitelist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionWhitelist.cpp; sourceTree = "<group>"; };
- FEA0C4011CDD7D0E00481991 /* FunctionWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionWhitelist.h; sourceTree = "<group>"; };
FEA3BBA7212B655800E93AD1 /* CallFrameInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrameInlines.h; sourceTree = "<group>"; };
FEA3BBAB212C97CB00E93AD1 /* DFGCFG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGCFG.h; path = dfg/DFGCFG.h; sourceTree = "<group>"; };
FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerARM64.cpp; sourceTree = "<group>"; };
@@ -7744,10 +7744,10 @@
0F4F11E6209BCDA100709654 /* CompilerTimingScope.h */,
FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */,
FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */,
- FEA0C4001CDD7D0E00481991 /* FunctionWhitelist.cpp */,
- FEA0C4011CDD7D0E00481991 /* FunctionWhitelist.h */,
FE1BD0221E72052F00134BC9 /* HeapVerifier.cpp */,
FE1BD0231E72052F00134BC9 /* HeapVerifier.h */,
+ 52EED7922492B868008F4C93 /* FunctionAllowlist.cpp */,
+ 52EED7932492B868008F4C93 /* FunctionAllowlist.h */,
FEC5797423105F4200BCA83F /* Integrity.cpp */,
FEC5797523105F4300BCA83F /* Integrity.h */,
FEC579772310954B00BCA83F /* IntegrityInlines.h */,
@@ -9393,6 +9393,7 @@
A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
0F5874EE194FEB1200AAB2C1 /* DFGMayExit.h in Headers */,
0F2BDC451522801B00CD8910 /* DFGMinifiedGraph.h in Headers */,
+ 52EED7942492B870008F4C93 /* FunctionAllowlist.h in Headers */,
0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */,
E3850B15226ED641009ABF9C /* DFGMinifiedIDInlines.h in Headers */,
0F2BDC461522802000CD8910 /* DFGMinifiedNode.h in Headers */,
@@ -9591,7 +9592,6 @@
FE4BFF2C1AD476E700088F87 /* FunctionOverrides.h in Headers */,
BC18C4050E16F5CD00B34460 /* FunctionPrototype.h in Headers */,
62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */,
- FEA0C4031CDD7D1D00481991 /* FunctionWhitelist.h in Headers */,
E33A94972255323300D42B06 /* FuzzerAgent.h in Headers */,
CECFAD362372DAD000291599 /* FuzzerPredictions.h in Headers */,
2AACE63D18CA5A0300ED0191 /* GCActivityCallback.h in Headers */,
Modified: trunk/Source/_javascript_Core/Sources.txt (262927 => 262928)
--- trunk/Source/_javascript_Core/Sources.txt 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/Sources.txt 2020-06-11 22:47:21 UTC (rev 262928)
@@ -1010,8 +1010,8 @@
tools/CellList.cpp
tools/CompilerTimingScope.cpp
+tools/FunctionAllowlist.cpp
tools/FunctionOverrides.cpp
-tools/FunctionWhitelist.cpp
tools/HeapVerifier.cpp
tools/Integrity.cpp
tools/JSDollarVM.cpp
Modified: trunk/Source/_javascript_Core/b3/air/AirLowerAfterRegAlloc.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/b3/air/AirLowerAfterRegAlloc.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/b3/air/AirLowerAfterRegAlloc.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -111,10 +111,10 @@
// If we run after stack allocation then we cannot use those callee saves that aren't in
// the callee save list. Note that we are only run after stack allocation in -O1, so this
// kind of slop is OK.
- RegisterSet blacklistedCalleeSaves;
+ RegisterSet disallowedCalleeSaves;
if (code.stackIsAllocated()) {
- blacklistedCalleeSaves = RegisterSet::calleeSaveRegisters();
- blacklistedCalleeSaves.exclude(code.calleeSaveRegisters());
+ disallowedCalleeSaves = RegisterSet::calleeSaveRegisters();
+ disallowedCalleeSaves.exclude(code.calleeSaveRegisters());
}
auto getScratches = [&] (RegisterSet set, Bank bank) -> std::array<Arg, 2> {
@@ -122,7 +122,7 @@
for (unsigned i = 0; i < 2; ++i) {
bool found = false;
for (Reg reg : code.regsInPriorityOrder(bank)) {
- if (!set.get(reg) && !blacklistedCalleeSaves.get(reg)) {
+ if (!set.get(reg) && !disallowedCalleeSaves.get(reg)) {
result[i] = Tmp(reg);
set.set(reg);
found = true;
Modified: trunk/Source/_javascript_Core/dfg/DFGDriver.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/dfg/DFGDriver.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/dfg/DFGDriver.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -31,7 +31,7 @@
#include "DFGPlan.h"
#include "DFGThunks.h"
#include "DFGWorklist.h"
-#include "FunctionWhitelist.h"
+#include "FunctionAllowlist.h"
#include "JITCode.h"
#include "Options.h"
#include "ThunkGenerators.h"
@@ -48,15 +48,15 @@
}
#if ENABLE(DFG_JIT)
-static FunctionWhitelist& ensureGlobalDFGWhitelist()
+static FunctionAllowlist& ensureGlobalDFGAllowlist()
{
- static LazyNeverDestroyed<FunctionWhitelist> dfgWhitelist;
- static std::once_flag initializeWhitelistFlag;
- std::call_once(initializeWhitelistFlag, [] {
- const char* functionWhitelistFile = Options::dfgWhitelist();
- dfgWhitelist.construct(functionWhitelistFile);
+ static LazyNeverDestroyed<FunctionAllowlist> dfgAllowlist;
+ static std::once_flag initializeAllowlistFlag;
+ std::call_once(initializeAllowlistFlag, [] {
+ const char* functionAllowlistFile = Options::dfgAllowlist();
+ dfgAllowlist.construct(functionAllowlistFile);
});
- return dfgWhitelist;
+ return dfgAllowlist;
}
static CompilationResult compileImpl(
@@ -65,7 +65,7 @@
Ref<DeferredCompilationCallback>&& callback)
{
if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionsSize())
- || !ensureGlobalDFGWhitelist().contains(codeBlock))
+ || !ensureGlobalDFGAllowlist().contains(codeBlock))
return CompilationFailed;
numCompilations++;
Modified: trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/dfg/DFGTierUpCheckInjectionPhase.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -33,21 +33,21 @@
#include "DFGNaturalLoops.h"
#include "DFGPhase.h"
#include "FTLCapabilities.h"
-#include "FunctionWhitelist.h"
+#include "FunctionAllowlist.h"
#include "JSCJSValueInlines.h"
#include <wtf/NeverDestroyed.h>
namespace JSC { namespace DFG {
-static FunctionWhitelist& ensureGlobalFTLWhitelist()
+static FunctionAllowlist& ensureGlobalFTLAllowlist()
{
- static LazyNeverDestroyed<FunctionWhitelist> ftlWhitelist;
- static std::once_flag initializeWhitelistFlag;
- std::call_once(initializeWhitelistFlag, [] {
- const char* functionWhitelistFile = Options::ftlWhitelist();
- ftlWhitelist.construct(functionWhitelistFile);
+ static LazyNeverDestroyed<FunctionAllowlist> ftlAllowlist;
+ static std::once_flag initializeAllowlistFlag;
+ std::call_once(initializeAllowlistFlag, [] {
+ const char* functionAllowlistFile = Options::ftlAllowlist();
+ ftlAllowlist.construct(functionAllowlistFile);
});
- return ftlWhitelist;
+ return ftlAllowlist;
}
using NaturalLoop = CPSNaturalLoop;
@@ -72,7 +72,7 @@
if (!Options::bytecodeRangeToFTLCompile().isInRange(m_graph.m_profiledBlock->instructionsSize()))
return false;
- if (!ensureGlobalFTLWhitelist().contains(m_graph.m_profiledBlock))
+ if (!ensureGlobalFTLAllowlist().contains(m_graph.m_profiledBlock))
return false;
#if ENABLE(FTL_JIT)
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -1303,7 +1303,7 @@
{
ParallelModeEnabler parallelModeEnabler(*slotVisitor);
- slotVisitor->drainFromShared(SlotVisitor::SlaveDrain);
+ slotVisitor->drainFromShared(SlotVisitor::HelperDrain);
}
{
Modified: trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/heap/MachineStackMarker.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -100,7 +100,7 @@
// acquire a lock. Since 'thread' is suspended, trying to acquire a lock
// will deadlock if 'thread' holds that lock.
// This function, specifically the memory copying, was causing problems with Address Sanitizer in
-// apps. Since we cannot blacklist the system memcpy we must use our own naive implementation,
+// apps. Since we cannot disallow the system memcpy we must use our own naive implementation,
// copyMemory, for ASan to work on either instrumented or non-instrumented builds. This is not a
// significant performance loss as tryCopyOtherThreadStack is only called as part of an O(heapsize)
// operation. As the heap is generally much larger than the stack the performance hit is minimal.
Modified: trunk/Source/_javascript_Core/heap/SlotVisitor.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/heap/SlotVisitor.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/heap/SlotVisitor.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -616,7 +616,7 @@
m_heap.m_numberOfActiveParallelMarkers--;
m_heap.m_numberOfWaitingParallelMarkers++;
- if (sharedDrainMode == MasterDrain) {
+ if (sharedDrainMode == MainDrain) {
while (true) {
if (hasElapsed(timeout))
return SharedDrainResult::TimedOut;
@@ -632,7 +632,7 @@
m_heap.m_markingConditionVariable.waitUntil(m_heap.m_markingMutex, timeout);
}
} else {
- ASSERT(sharedDrainMode == SlaveDrain);
+ ASSERT(sharedDrainMode == HelperDrain);
if (hasElapsed(timeout))
return SharedDrainResult::TimedOut;
@@ -708,7 +708,7 @@
SlotVisitor::SharedDrainResult SlotVisitor::drainInParallel(MonotonicTime timeout)
{
donateAndDrain(timeout);
- return drainFromShared(MasterDrain, timeout);
+ return drainFromShared(MainDrain, timeout);
}
SlotVisitor::SharedDrainResult SlotVisitor::drainInParallelPassively(MonotonicTime timeout)
Modified: trunk/Source/_javascript_Core/heap/SlotVisitor.h (262927 => 262928)
--- trunk/Source/_javascript_Core/heap/SlotVisitor.h 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/heap/SlotVisitor.h 2020-06-11 22:47:21 UTC (rev 262928)
@@ -134,7 +134,7 @@
void drain(MonotonicTime timeout = MonotonicTime::infinity());
void donateAndDrain(MonotonicTime timeout = MonotonicTime::infinity());
- enum SharedDrainMode { SlaveDrain, MasterDrain };
+ enum SharedDrainMode { HelperDrain, MainDrain };
enum class SharedDrainResult { Done, TimedOut };
SharedDrainResult drainFromShared(SharedDrainMode, MonotonicTime timeout = MonotonicTime::infinity());
Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/objc_generator.py (262927 => 262928)
--- trunk/Source/_javascript_Core/inspector/scripts/codegen/objc_generator.py 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/objc_generator.py 2020-06-11 22:47:21 UTC (rev 262928)
@@ -131,9 +131,9 @@
if self.model().framework is Frameworks.Test:
return True
- whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
- whitelist.update(set(['Console', 'Debugger', 'Runtime']))
- return domain.domain_name in whitelist
+ allowlist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+ allowlist.update(set(['Console', 'Debugger', 'Runtime']))
+ return domain.domain_name in allowlist
def should_generate_commands_for_domain(self, domain):
if not len(self.commands_for_domain(domain)):
@@ -142,8 +142,8 @@
if self.model().framework is Frameworks.Test:
return True
- whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
- return domain.domain_name in whitelist
+ allowlist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+ return domain.domain_name in allowlist
def should_generate_events_for_domain(self, domain):
if not len(self.events_for_domain(domain)):
@@ -152,9 +152,9 @@
if self.model().framework is Frameworks.Test:
return True
- whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
- whitelist.add('Console')
- return domain.domain_name in whitelist
+ allowlist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+ allowlist.add('Console')
+ return domain.domain_name in allowlist
# ObjC enum and type names.
Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -37,8 +37,8 @@
#include "Exception.h"
#include "ExceptionFuzz.h"
#include "FrameTracers.h"
+#include "FunctionAllowlist.h"
#include "FunctionCodeBlock.h"
-#include "FunctionWhitelist.h"
#include "GetterSetter.h"
#include "HostCallReturnValue.h"
#include "JITExceptions.h"
@@ -340,21 +340,21 @@
enum EntryKind { Prologue, ArityCheck };
#if ENABLE(JIT)
-static FunctionWhitelist& ensureGlobalJITWhitelist()
+static FunctionAllowlist& ensureGlobalJITAllowlist()
{
- static LazyNeverDestroyed<FunctionWhitelist> baselineWhitelist;
- static std::once_flag initializeWhitelistFlag;
- std::call_once(initializeWhitelistFlag, [] {
- const char* functionWhitelistFile = Options::jitWhitelist();
- baselineWhitelist.construct(functionWhitelistFile);
+ static LazyNeverDestroyed<FunctionAllowlist> baselineAllowlist;
+ static std::once_flag initializeAllowlistFlag;
+ std::call_once(initializeAllowlistFlag, [] {
+ const char* functionAllowlistFile = Options::jitAllowlist();
+ baselineAllowlist.construct(functionAllowlistFile);
});
- return baselineWhitelist;
+ return baselineAllowlist;
}
inline bool shouldJIT(CodeBlock* codeBlock)
{
if (!Options::bytecodeRangeToJITCompile().isInRange(codeBlock->instructionsSize())
- || !ensureGlobalJITWhitelist().contains(codeBlock))
+ || !ensureGlobalJITAllowlist().contains(codeBlock))
return false;
return VM::canUseJIT() && Options::useBaselineJIT();
Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (262927 => 262928)
--- trunk/Source/_javascript_Core/runtime/OptionsList.h 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h 2020-06-11 22:47:21 UTC (rev 262928)
@@ -135,9 +135,9 @@
v(OptionRange, bytecodeRangeToJITCompile, 0, Normal, "bytecode size range to allow compilation on, e.g. 1:100") \
v(OptionRange, bytecodeRangeToDFGCompile, 0, Normal, "bytecode size range to allow DFG compilation on, e.g. 1:100") \
v(OptionRange, bytecodeRangeToFTLCompile, 0, Normal, "bytecode size range to allow FTL compilation on, e.g. 1:100") \
- v(OptionString, jitWhitelist, nullptr, Normal, "file with list of function signatures to allow compilation on") \
- v(OptionString, dfgWhitelist, nullptr, Normal, "file with list of function signatures to allow DFG compilation on") \
- v(OptionString, ftlWhitelist, nullptr, Normal, "file with list of function signatures to allow FTL compilation on") \
+ v(OptionString, jitAllowlist, nullptr, Normal, "file with newline separated list of function signatures to allow compilation on") \
+ v(OptionString, dfgAllowlist, nullptr, Normal, "file with newline separated list of function signatures to allow DFG compilation on") \
+ v(OptionString, ftlAllowlist, nullptr, Normal, "file with newline separated list of function signatures to allow FTL compilation on") \
v(Bool, dumpSourceAtDFGTime, false, Normal, "dumps source code of JS function being DFG compiled") \
v(Bool, dumpBytecodeAtDFGTime, false, Normal, "dumps bytecode of JS function being DFG compiled") \
v(Bool, dumpGraphAfterParsing, false, Normal, nullptr) \
@@ -367,7 +367,7 @@
v(Bool, collectSamplingProfilerDataForJSCShell, false, Normal, "This corresponds to the JSC shell's --sample option.") \
v(Unsigned, samplingProfilerTopFunctionsCount, 12, Normal, "Number of top functions to report when using the command line interface.") \
v(Unsigned, samplingProfilerTopBytecodesCount, 40, Normal, "Number of top bytecodes to report when using the command line interface.") \
- v(OptionString, samplingProfilerPath, nullptr, Normal, "The path to the directory to write sampiling profiler output to. This probably will not work with WK2 unless the path is in the whitelist.") \
+ v(OptionString, samplingProfilerPath, nullptr, Normal, "The path to the directory to write sampiling profiler output to. This probably will not work with WK2 unless the path is in the sandbox.") \
v(Bool, sampleCCode, false, Normal, "Causes the sampling profiler to record profiling data for C frames.") \
\
v(Bool, alwaysGeneratePCToCodeOriginMap, false, Normal, "This will make sure we always generate a PCToCodeOriginMap for JITed code.") \
Copied: trunk/Source/_javascript_Core/tools/FunctionAllowlist.cpp (from rev 262927, trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp) (0 => 262928)
--- trunk/Source/_javascript_Core/tools/FunctionAllowlist.cpp (rev 0)
+++ trunk/Source/_javascript_Core/tools/FunctionAllowlist.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2014-2020 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.
+ */
+
+#include "config.h"
+#include "FunctionAllowlist.h"
+
+#if ENABLE(JIT)
+
+#include "CodeBlock.h"
+#include <stdio.h>
+#include <string.h>
+
+namespace JSC {
+
+FunctionAllowlist::FunctionAllowlist(const char* filename)
+{
+ if (!filename)
+ return;
+
+ FILE* f = fopen(filename, "r");
+ if (!f) {
+ dataLogF("Failed to open file %s. Did you add the file-read-data entitlement to WebProcess.sb?\n", filename);
+ return;
+ }
+
+ m_hasActiveAllowlist = true;
+
+ char* line;
+ char buffer[BUFSIZ];
+ while ((line = fgets(buffer, sizeof(buffer), f))) {
+ if (strstr(line, "//") == line)
+ continue;
+
+ // Get rid of newlines at the ends of the strings.
+ size_t length = strlen(line);
+ if (line[length - 1] == '\n') {
+ line[length - 1] = '\0';
+ length--;
+ }
+
+ // Skip empty lines.
+ if (!length)
+ continue;
+
+ m_entries.add(String(line, length));
+ }
+
+ int result = fclose(f);
+ if (result)
+ dataLogF("Failed to close file %s: %s\n", filename, strerror(errno));
+}
+
+bool FunctionAllowlist::contains(CodeBlock* codeBlock) const
+{
+ if (!m_hasActiveAllowlist)
+ return true;
+
+ if (m_entries.isEmpty())
+ return false;
+
+ String name = String::fromUTF8(codeBlock->inferredName());
+ if (m_entries.contains(name))
+ return true;
+
+ String hash = String::fromUTF8(codeBlock->hashAsStringIfPossible());
+ if (m_entries.contains(hash))
+ return true;
+
+ return m_entries.contains(name + '#' + hash);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
Copied: trunk/Source/_javascript_Core/tools/FunctionAllowlist.h (from rev 262927, trunk/Source/_javascript_Core/tools/FunctionWhitelist.h) (0 => 262928)
--- trunk/Source/_javascript_Core/tools/FunctionAllowlist.h (rev 0)
+++ trunk/Source/_javascript_Core/tools/FunctionAllowlist.h 2020-06-11 22:47:21 UTC (rev 262928)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014-2020 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 <wtf/HashSet.h>
+#include <wtf/text/WTFString.h>
+
+namespace JSC {
+
+class CodeBlock;
+
+class FunctionAllowlist {
+public:
+ explicit FunctionAllowlist(const char*);
+
+ bool contains(CodeBlock*) const;
+
+private:
+ HashSet<String> m_entries;
+ bool m_hasActiveAllowlist { false };
+};
+
+} // namespace JSC
Deleted: trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp (262927 => 262928)
--- trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/tools/FunctionWhitelist.cpp 2020-06-11 22:47:21 UTC (rev 262928)
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014, 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. 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.
- */
-
-#include "config.h"
-#include "FunctionWhitelist.h"
-
-#if ENABLE(JIT)
-
-#include "CodeBlock.h"
-#include <stdio.h>
-#include <string.h>
-
-namespace JSC {
-
-FunctionWhitelist::FunctionWhitelist(const char* filename)
-{
- if (!filename)
- return;
-
- FILE* f = fopen(filename, "r");
- if (!f) {
- dataLogF("Failed to open file %s. Did you add the file-read-data entitlement to WebProcess.sb?\n", filename);
- return;
- }
-
- m_hasActiveWhitelist = true;
-
- char* line;
- char buffer[BUFSIZ];
- while ((line = fgets(buffer, sizeof(buffer), f))) {
- if (strstr(line, "//") == line)
- continue;
-
- // Get rid of newlines at the ends of the strings.
- size_t length = strlen(line);
- if (line[length - 1] == '\n') {
- line[length - 1] = '\0';
- length--;
- }
-
- // Skip empty lines.
- if (!length)
- continue;
-
- m_entries.add(String(line, length));
- }
-
- int result = fclose(f);
- if (result)
- dataLogF("Failed to close file %s: %s\n", filename, strerror(errno));
-}
-
-bool FunctionWhitelist::contains(CodeBlock* codeBlock) const
-{
- if (!m_hasActiveWhitelist)
- return true;
-
- if (m_entries.isEmpty())
- return false;
-
- String name = String::fromUTF8(codeBlock->inferredName());
- if (m_entries.contains(name))
- return true;
-
- String hash = String::fromUTF8(codeBlock->hashAsStringIfPossible());
- if (m_entries.contains(hash))
- return true;
-
- return m_entries.contains(name + '#' + hash);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(JIT)
-
Deleted: trunk/Source/_javascript_Core/tools/FunctionWhitelist.h (262927 => 262928)
--- trunk/Source/_javascript_Core/tools/FunctionWhitelist.h 2020-06-11 22:31:14 UTC (rev 262927)
+++ trunk/Source/_javascript_Core/tools/FunctionWhitelist.h 2020-06-11 22:47:21 UTC (rev 262928)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014, 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. 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 <wtf/HashSet.h>
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
-class CodeBlock;
-
-class FunctionWhitelist {
-public:
- explicit FunctionWhitelist(const char*);
-
- bool contains(CodeBlock*) const;
-
-private:
- HashSet<String> m_entries;
- bool m_hasActiveWhitelist { false };
-};
-
-} // namespace JSC