Parser option for brace escape
[hiphop-php.git] / hphp / runtime / base / runtime-option.h
blob538f07f2df140e2859b3a4154e8dcfce9d9ce4c4
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #pragma once
19 #include <folly/dynamic.h>
20 #include <folly/experimental/io/FsUtil.h>
22 #include <unordered_map>
23 #include <algorithm>
24 #include <vector>
25 #include <string>
26 #include <map>
27 #include <set>
28 #include <boost/container/flat_set.hpp>
29 #include <memory>
30 #include <sys/stat.h>
32 #include "hphp/runtime/base/config.h"
33 #include "hphp/runtime/base/typed-value.h"
34 #include "hphp/runtime/base/types.h"
36 #include "hphp/util/compilation-flags.h"
37 #include "hphp/util/functional.h"
38 #include "hphp/util/hash-map.h"
39 #include "hphp/util/sha1.h"
41 #include "hphp/hack/src/parser/positioned_full_trivia_parser_ffi_types_fwd.h"
43 namespace HPHP {
44 ///////////////////////////////////////////////////////////////////////////////
46 struct AccessLogFileData;
47 struct ErrorLogFileData;
48 struct VirtualHost;
49 struct IpBlockMap;
50 struct SatelliteServerInfo;
51 struct FilesMatch;
52 struct Hdf;
53 struct IniSettingMap;
55 constexpr int kDefaultInitialStaticStringTableSize = 500000;
57 using StringToIntMap = std::unordered_map<std::string, int>;
59 enum class JitSerdesMode {
60 // NB: if changing the encoding here, make sure to update isJitSerializing()
61 // and isJitDeserializing() as needed.
63 // Bit 0: serialize
64 // Bit 1: deserialize
65 Off = 0x0,
66 Serialize = 0x1, // 00001
67 SerializeAndExit = 0x5, // 00101
68 Deserialize = 0x2, // 00010
69 DeserializeOrFail = 0x6, // 00110
70 DeserializeOrGenerate = 0xa, // 01010
71 DeserializeAndDelete = 0xe, // 01110
72 DeserializeAndExit = 0x12, // 10010
75 enum class RepoMode {
76 Closed = 0,
77 ReadOnly = 1,
78 ReadWrite = 2,
81 struct RepoOptions {
82 RepoOptions(const RepoOptions&) = default;
83 RepoOptions(RepoOptions&&) = default;
85 using StringMap = std::map<std::string, std::string>;
86 // (Type, HDFName, DV)
87 // (N=no-prefix, P=PHP7, E=Eval, H=Hack.Lang)
88 #define PARSERFLAGS() \
89 N(StringMap, AliasedNamespaces, StringMap{}) \
90 P(bool, UVS, s_PHP7_master) \
91 P(bool, LTRAssign, s_PHP7_master) \
92 H(bool, Hacksperimental, false) \
93 H(bool, DisableLvalAsAnExpression, false) \
94 H(bool, AllowNewAttributeSyntax, false) \
95 H(bool, ConstDefaultFuncArgs, false) \
96 H(bool, ConstStaticProps, false) \
97 H(bool, AbstractStaticProps, false) \
98 H(bool, DisableUnsetClassConst, false) \
99 H(bool, DisallowFuncPtrsInConstants, false) \
100 E(bool, EmitInstMethPointers, false) \
101 H(bool, AllowUnstableFeatures, false) \
102 H(bool, DisallowHashComments, false) \
103 H(bool, EnableXHPClassModifier, true) \
104 H(bool, DisableXHPElementMangling, true) \
105 H(bool, DisableArray, true) \
106 H(bool, DisableArrayCast, true) \
107 H(bool, DisableArrayTypehint, true) \
108 H(bool, EnableEnumClasses, true) \
109 H(bool, DisallowFunAndClsMethPseudoFuncs, false) \
110 H(bool, DisallowDynamicMethCallerArgs, false) \
111 H(bool, DisallowInstMeth, false) \
112 H(bool, EnableReadonlyEnforcement, false) \
113 H(bool, EscapeBrace, false) \
114 /**/
116 /**/
118 #define AUTOLOADFLAGS() \
119 N(std::string, Query, "") \
120 N(std::string, TrustedDBPath, "") \
121 /**/
123 std::string path() const { return m_path; }
124 SHA1 cacheKeySha1() const { return m_sha1; }
125 std::string toJSON() const;
126 folly::dynamic toDynamic() const;
127 std::uint32_t getParserFlags() const;
128 std::uint32_t getCompilerFlags() const;
129 std::uint32_t getFactsFlags() const;
130 hackc_parse_positioned_full_trivia_environment getParserEnvironment() const;
131 std::string getAliasedNamespacesConfig() const;
132 struct stat stat() const { return m_stat; }
133 std::string autoloadQuery() const noexcept { return Query; }
134 std::string trustedDBPath() const noexcept { return TrustedDBPath; }
136 bool operator==(const RepoOptions& o) const {
137 // If we have hash collisions of unequal RepoOptions, we have
138 // bigger problems.
139 return m_sha1 == o.m_sha1;
142 // Getters for the parser options we pass to HackC for extracting facts
143 bool allowNewAttributeSyntax() const noexcept {
144 return AllowNewAttributeSyntax;
146 bool enableXHPClassModifier() const noexcept {
147 return EnableXHPClassModifier;
149 bool disableXHPElementMangling() const noexcept {
150 return DisableXHPElementMangling;
153 static const RepoOptions& defaults();
154 static void setDefaults(const Hdf& hdf, const IniSettingMap& ini);
156 static const RepoOptions& forFile(const char* path);
158 private:
159 RepoOptions() = default;
160 explicit RepoOptions(const char* str, const char* file);
162 void filterNamespaces();
163 void initDefaults(const Hdf& hdf, const IniSettingMap& ini);
164 void calcCacheKey();
166 #define N(t, n, ...) t n;
167 #define P(t, n, ...) t n;
168 #define H(t, n, ...) t n;
169 #define E(t, n, ...) t n;
170 PARSERFLAGS()
171 AUTOLOADFLAGS()
172 #undef N
173 #undef P
174 #undef H
175 #undef E
177 std::string m_path;
178 struct stat m_stat;
180 SHA1 m_sha1;
182 static bool s_init;
183 static RepoOptions s_defaults;
187 * Configurable options set from command line or configurable file at startup
188 * time.
190 struct RuntimeOption {
191 static void Load(
192 IniSettingMap &ini, Hdf& config,
193 const std::vector<std::string>& iniClis = std::vector<std::string>(),
194 const std::vector<std::string>& hdfClis = std::vector<std::string>(),
195 std::vector<std::string>* messages = nullptr,
196 std::string cmd = "");
198 static bool ServerExecutionMode() {
199 return ServerMode;
202 static bool GcSamplingEnabled() {
203 return EvalGCSampleRate > 0;
206 static bool JitSamplingEnabled() {
207 return EvalJit && EvalJitSampleRate > 0;
210 static void ReadSatelliteInfo(
211 const IniSettingMap& ini,
212 const Hdf& hdf,
213 std::vector<std::shared_ptr<SatelliteServerInfo>>& infos,
214 std::string& xboxPassword,
215 std::set<std::string>& xboxPasswords
218 static folly::Optional<folly::fs::path> GetHomePath(
219 const folly::StringPiece user);
221 static std::string GetDefaultUser();
224 * Find a config file corresponding to the given user and parse its
225 * settings into the given ini and hdf objects.
227 * Return true on success and false on failure.
229 static bool ReadPerUserSettings(const folly::fs::path& confFileName,
230 IniSettingMap& ini, Hdf& config);
232 static std::string getTraceOutputFile();
234 static bool ServerMode;
235 static std::string BuildId;
236 static std::string InstanceId;
237 static std::string DeploymentId; // ID for set of instances deployed at once
238 static int64_t ConfigId; // Queryable to verify a specific config was read
239 static std::string PidFile;
241 static std::map<std::string, ErrorLogFileData> ErrorLogs;
242 static std::string LogFile;
243 static std::string LogFileSymLink;
244 static uint16_t LogFilePeriodMultiplier;
246 static int LogHeaderMangle;
247 static bool AlwaysEscapeLog;
248 static bool AlwaysLogUnhandledExceptions;
249 static bool NoSilencer;
250 static int ErrorUpgradeLevel; // Bitmask of errors to upgrade to E_USER_ERROR
251 static bool CallUserHandlerOnFatals;
252 static bool ThrowExceptionOnBadMethodCall;
253 static bool LogNativeStackOnOOM;
254 static int RuntimeErrorReportingLevel;
255 static int ForceErrorReportingLevel; // Bitmask ORed with the reporting level
257 static std::string ServerUser; // run server under this user account
258 static bool AllowRunAsRoot; // Allow running hhvm as root.
260 static int MaxSerializedStringSize;
261 static int64_t NoticeFrequency; // output 1 out of NoticeFrequency notices
262 static int64_t WarningFrequency;
263 static int RaiseDebuggingFrequency;
264 static int64_t SerializationSizeLimit;
266 static std::string AccessLogDefaultFormat;
267 static std::map<std::string, AccessLogFileData> AccessLogs;
269 static std::string AdminLogFormat;
270 static std::string AdminLogFile;
271 static std::string AdminLogSymLink;
273 static std::map<std::string, AccessLogFileData> RPCLogs;
275 static std::string Host;
276 static std::string DefaultServerNameSuffix;
277 static std::string ServerType;
278 static std::string ServerIP;
279 static std::string ServerFileSocket;
280 static const std::string& GetServerPrimaryIPv4();
281 static const std::string& GetServerPrimaryIPv6();
282 static int ServerPort;
283 static int ServerPortFd;
284 static int ServerBacklog;
285 static int ServerConnectionLimit;
286 static int ServerThreadCount;
287 static int ServerQueueCount;
288 static int ServerIOThreadCount;
289 static int ServerHighQueueingThreshold;
290 static bool ServerLegacyBehavior;
291 // Number of worker threads with stack partially on huge pages.
292 static int ServerHugeThreadCount;
293 static int ServerHugeStackKb;
294 static uint32_t ServerLoopSampleRate;
295 static int ServerWarmupThrottleRequestCount;
296 static int ServerWarmupThrottleThreadCount;
297 static int ServerThreadDropCacheTimeoutSeconds;
298 static int ServerThreadJobLIFOSwitchThreshold;
299 static int ServerThreadJobMaxQueuingMilliSeconds;
300 static bool AlwaysDecodePostDataDefault;
301 static bool ServerThreadDropStack;
302 static bool ServerHttpSafeMode;
303 static bool ServerStatCache;
304 static bool ServerFixPathInfo;
305 static bool ServerAddVaryEncoding;
306 static bool ServerLogSettingsOnStartup;
307 static bool ServerLogReorderProps;
308 static bool ServerForkEnabled;
309 static bool ServerForkLogging;
310 static bool ServerWarmupConcurrently;
311 static bool ServerDedupeWarmupRequests;
312 static int ServerWarmupThreadCount;
313 static int ServerExtendedWarmupThreadCount;
314 static unsigned ServerExtendedWarmupRepeat;
315 static unsigned ServerExtendedWarmupDelaySeconds;
316 static std::vector<std::string> ServerWarmupRequests;
317 static std::vector<std::string> ServerExtendedWarmupRequests;
318 static std::string ServerCleanupRequest;
319 static int ServerInternalWarmupThreads;
320 static boost::container::flat_set<std::string> ServerHighPriorityEndPoints;
321 static bool ServerExitOnBindFail;
322 static int PageletServerThreadCount;
323 static int PageletServerHugeThreadCount;
324 static int PageletServerThreadDropCacheTimeoutSeconds;
325 static int PageletServerQueueLimit;
326 static bool PageletServerThreadDropStack;
328 static int RequestTimeoutSeconds;
329 static int PspTimeoutSeconds;
330 static int PspCpuTimeoutSeconds;
331 static int64_t MaxRequestAgeFactor;
332 static int64_t RequestMemoryMaxBytes;
333 // Approximate upper bound for thread heap that is backed by huge pages. This
334 // doesn't include the first slab colocated with thread stack, if any.
335 static int64_t RequestHugeMaxBytes;
336 static int64_t ImageMemoryMaxBytes;
337 static int ServerGracefulShutdownWait;
338 static bool ServerHarshShutdown;
339 static bool ServerEvilShutdown;
340 static bool ServerKillOnTimeout;
341 static bool Server503OnShutdownAbort;
342 static int ServerPreShutdownWait;
343 static int ServerShutdownListenWait;
344 static int ServerShutdownEOMWait;
345 static int ServerPrepareToStopTimeout;
346 static int ServerPartialPostStatusCode;
347 // If `StopOldServer` is set, we try to stop the old server running
348 // on the local host earlier when we initialize, and we do not start
349 // serving requests until we are confident that the system can give
350 // the new server `ServerRSSNeededMb` resident memory, or till
351 // `OldServerWait` seconds passes after an effort to stop the old
352 // server is made.
353 static bool StopOldServer;
354 static int64_t ServerRSSNeededMb;
355 // Threshold of free memory below which the old server is shutdown immediately
356 // upon a memory pressure check.
357 static int64_t ServerCriticalFreeMb;
358 static int OldServerWait;
359 // The percentage of page caches that can be considered as free (0 -
360 // 100). This is experimental.
361 static int CacheFreeFactor;
362 static std::vector<std::string> ServerNextProtocols;
363 static bool ServerEnableH2C;
364 static int BrotliCompressionEnabled;
365 static int BrotliChunkedCompressionEnabled;
366 static int BrotliCompressionMode;
367 // Base 2 logarithm of the sliding window size. Range is 10-24.
368 static int BrotliCompressionLgWindowSize;
369 static int BrotliCompressionQuality;
370 static int ZstdCompressionEnabled;
371 static int ZstdCompressionLevel;
372 static int ZstdChecksumRate;
373 static int GzipCompressionLevel;
374 static int GzipMaxCompressionLevel;
375 static bool EnableKeepAlive;
376 static bool ExposeHPHP;
377 static bool ExposeXFBServer;
378 static bool ExposeXFBDebug;
379 static std::string XFBDebugSSLKey;
380 static int ConnectionTimeoutSeconds;
381 static bool EnableOutputBuffering;
382 static std::string OutputHandler;
383 static bool ImplicitFlush;
384 static bool EnableEarlyFlush;
385 static bool ForceChunkedEncoding;
386 static int64_t MaxPostSize;
387 static int64_t LowestMaxPostSize;
388 static bool AlwaysPopulateRawPostData;
389 static int64_t UploadMaxFileSize;
390 static std::string UploadTmpDir;
391 static bool EnableFileUploads;
392 static bool EnableUploadProgress;
393 static int64_t MaxFileUploads;
394 static int Rfc1867Freq;
395 static std::string Rfc1867Prefix;
396 static std::string Rfc1867Name;
397 static bool ExpiresActive;
398 static int ExpiresDefault;
399 static std::string DefaultCharsetName;
400 static bool ForceServerNameToHeader;
401 static bool PathDebug;
402 static std::vector<std::shared_ptr<VirtualHost>> VirtualHosts;
403 static std::shared_ptr<IpBlockMap> IpBlocks;
404 static std::vector<std::shared_ptr<SatelliteServerInfo>>
405 SatelliteServerInfos;
407 // If a request has a body over this limit, switch to on-demand reading.
408 // -1 for no limit.
409 static int64_t RequestBodyReadLimit;
411 static bool EnableSSL;
412 static int SSLPort;
413 static int SSLPortFd;
414 static std::string SSLCertificateFile;
415 static std::string SSLCertificateKeyFile;
416 static std::string SSLCertificateDir;
417 static std::string SSLTicketSeedFile;
418 static bool TLSDisableTLS1_2;
419 static std::string TLSClientCipherSpec;
420 static bool EnableSSLWithPlainText;
421 // Level of TLS client auth. Valid values are
422 // 0 => disabled (default)
423 // 1 => optional (verify if client presents a cert)
424 // 2 => required (client must present a valid cert)
425 static int SSLClientAuthLevel;
426 // CA file to verify client cert against.
427 static std::string SSLClientCAFile;
428 // [DEPRECATED] Sampling ratio for client auth logging.
429 // Must be an int within [0, 100]. 0 => disabled; 100 => log all connections.
430 static uint32_t SSLClientAuthLoggingSampleRatio;
432 // Which ACL identity and action to check the client against.
433 static std::string ClientAuthAclIdentity;
434 static std::string ClientAuthAclAction;
435 // If true, terminate connection immediately if a client fails ACL,
436 // otherwise log it and let in.
437 static bool ClientAuthFailClose;
439 // On average, sample X connections per ClientAuthLogSampleBase connections,
440 // where X is ClientAuthSuccessLogSampleRatio for client auth successes, and
441 // ClientAuthFailureLogSampleRatio for client auth failures. Set X to 0 to
442 // disable sampling.
443 // For example, if ClientAuthLogSampleBase = 100,
444 // ClientAuthSuccessLogSampleRatio = 0, and
445 // ClientAuthFailureLogSampleRatio = 50, then no (0/100) client auth successes
446 // and half (50/100) of client auth failures will be logged.
447 static uint32_t ClientAuthLogSampleBase;
448 static uint32_t ClientAuthSuccessLogSampleRatio;
449 static uint32_t ClientAuthFailureLogSampleRatio;
451 static int XboxServerThreadCount;
452 static int XboxServerMaxQueueLength;
453 static int XboxServerInfoMaxRequest;
454 static int XboxServerInfoDuration;
455 static std::string XboxServerInfoReqInitFunc;
456 static std::string XboxServerInfoReqInitDoc;
457 static bool XboxServerInfoAlwaysReset;
458 static bool XboxServerLogInfo;
459 static std::string XboxProcessMessageFunc;
460 static std::string XboxPassword;
461 static std::set<std::string> XboxPasswords;
463 static std::string SourceRoot;
464 static std::vector<std::string> IncludeSearchPaths;
467 * Legal root directory expressions in an include expression. For example,
469 * include_once $PHP_ROOT . '/lib.php';
471 * Here, "$PHP_ROOT" is a legal include root. Stores what it resolves to.
473 * RuntimeOption::IncludeRoots["$PHP_ROOT"] = "";
474 * RuntimeOption::IncludeRoots["$LIB_ROOT"] = "lib";
476 static std::map<std::string, std::string> IncludeRoots;
477 static std::map<std::string, std::string> AutoloadRoots;
479 static bool AutoloadEnabled;
480 static std::string AutoloadDBPath;
481 static bool AutoloadRethrowExceptions;
483 static std::string FileCache;
484 static std::string DefaultDocument;
485 static std::string GlobalDocument;
486 static std::string ErrorDocument404;
487 static bool ForbiddenAs404;
488 static std::string ErrorDocument500;
489 static std::string FatalErrorMessage;
490 static std::string FontPath;
491 static bool EnableStaticContentFromDisk;
492 static bool EnableOnDemandUncompress;
493 static bool EnableStaticContentMMap;
495 static bool Utf8izeReplace;
497 static std::string RequestInitFunction;
498 static std::string RequestInitDocument;
499 static std::string AutoPrependFile;
500 static std::string AutoAppendFile;
502 static bool SafeFileAccess;
503 static std::vector<std::string> AllowedDirectories;
504 static std::set<std::string> AllowedFiles;
505 static hphp_string_imap<std::string> StaticFileExtensions;
506 static hphp_string_imap<std::string> PhpFileExtensions;
507 static std::set<std::string> ForbiddenFileExtensions;
508 static std::set<std::string> StaticFileGenerators;
509 static std::vector<std::shared_ptr<FilesMatch>> FilesMatches;
511 static bool WhitelistExec;
512 static bool WhitelistExecWarningOnly;
513 static std::vector<std::string> AllowedExecCmds;
515 static bool UnserializationWhitelistCheck;
516 static bool UnserializationWhitelistCheckWarningOnly;
517 static int64_t UnserializationBigMapThreshold;
519 static std::string TakeoverFilename;
520 static std::string AdminServerIP;
521 static int AdminServerPort;
522 static int AdminThreadCount;
523 static bool AdminServerEnableSSLWithPlainText;
524 static bool AdminServerStatsNeedPassword;
525 static std::string AdminPassword;
526 static std::set<std::string> AdminPasswords;
527 static std::set<std::string> HashedAdminPasswords;
529 static std::string AdminDumpPath;
532 * Options related to reverse proxying. ProxyOriginRaw and ProxyPercentageRaw
533 * may be mutated by background threads and should only be read or written
534 * using the helper functions defined with HttpRequestHandler.
536 static std::string ProxyOriginRaw;
537 static int ProxyPercentageRaw;
538 static int ProxyRetry;
539 static bool UseServeURLs;
540 static std::set<std::string> ServeURLs;
541 static bool UseProxyURLs;
542 static std::set<std::string> ProxyURLs;
543 static std::vector<std::string> ProxyPatterns;
544 static bool AlwaysUseRelativePath;
546 static int HttpDefaultTimeout;
547 static int HttpSlowQueryThreshold;
549 static bool NativeStackTrace;
550 static bool ServerErrorMessage;
551 static bool RecordInput;
552 static bool ClearInputOnSuccess;
553 static std::string ProfilerOutputDir;
554 static std::string CoreDumpEmail;
555 static bool CoreDumpReport;
556 static std::string CoreDumpReportDirectory;
557 static std::string StackTraceFilename;
558 static int StackTraceTimeout;
559 static std::string RemoteTraceOutputDir;
560 static std::set<std::string, stdltistr> TraceFunctions;
562 static bool EnableStats;
563 static bool EnableAPCStats;
564 static bool EnableWebStats;
565 static bool EnableMemoryStats;
566 static bool EnableSQLStats;
567 static bool EnableSQLTableStats;
568 static bool EnableNetworkIOStatus;
569 static std::string StatsXSL;
570 static std::string StatsXSLProxy;
571 static uint32_t StatsSlotDuration;
572 static uint32_t StatsMaxSlot;
574 static bool EnableHotProfiler;
575 static int32_t ProfilerTraceBuffer;
576 static double ProfilerTraceExpansion;
577 static int32_t ProfilerMaxTraceBuffer;
579 static int64_t MaxSQLRowCount;
580 static int64_t SocketDefaultTimeout;
581 static bool LockCodeMemory;
582 static int MaxArrayChain;
583 static bool WarnOnCollectionToArray;
584 static bool UseDirectCopy;
586 static bool DisableSmallAllocator;
588 static std::map<std::string, std::string> ServerVariables;
590 static std::map<std::string, std::string> EnvVariables;
592 // The file name that is used by LightProcess to bind the socket
593 // is the following prefix followed by the pid of the hphp process.
594 static std::string LightProcessFilePrefix;
595 static int LightProcessCount;
597 // Eval options
598 static bool EnableHipHopSyntax;
599 static bool EnableShortTags;
600 static bool EnableXHP;
601 static bool EnableIntrinsicsExtension;
602 static bool CheckSymLink;
603 static bool TrustAutoloaderPath;
604 static bool EnableArgsInBacktraces;
605 static bool EnableZendIniCompat;
606 static bool TimeoutsUseWallTime;
607 static bool CheckFlushOnUserClose;
608 static bool EvalAuthoritativeMode;
609 static int CheckCLIClientCommands;
610 static int CheckIntOverflow;
611 static HackStrictOption StrictArrayFillKeys;
612 static bool LookForTypechecker;
613 static bool AutoTypecheck;
614 static uint32_t EvalInitialStaticStringTableSize;
615 static uint32_t EvalInitialNamedEntityTableSize;
616 static JitSerdesMode EvalJitSerdesMode;
617 static int ProfDataTTLHours;
618 static std::string EvalJitSerdesFile;
619 static std::string ProfDataTag;
620 static bool DumpPreciseProfData;
622 // ENABLED (1) selects PHP7 behavior.
623 static bool PHP7_NoHexNumerics;
624 static bool PHP7_Builtins;
625 static bool PHP7_EngineExceptions;
626 static bool PHP7_Substr;
627 static bool PHP7_DisallowUnsafeCurlUploads;
629 static int64_t HeapSizeMB;
630 static int64_t HeapResetCountBase;
631 static int64_t HeapResetCountMultiple;
632 static int64_t HeapLowWaterMark;
633 static int64_t HeapHighWaterMark;
635 // Disables PHP's call_user_func function.
636 // Valid values are 0 => enabled (default),
637 // 1 => warning, 2 => error.
638 static uint64_t DisableCallUserFunc;
639 // Disables PHP's call_user_func_array function.
640 // Valid values are 0 => enabled (default),
641 // 1 => warning, 2 => error.
642 static uint64_t DisableCallUserFuncArray;
643 // Disables PHP's constant function
644 // valid values are 0 => enabled (default)
645 // 1 => warning, 2 => error
646 static uint64_t DisableConstant;
647 // Disables non-top-level declarations
648 // true => error, false => default behaviour
649 static bool DisableNontoplevelDeclarations;
650 // Disables static closures
651 // true => error, false => default behaviour
652 static bool DisableStaticClosures;
653 // Enables the class-level where constraints
654 // true => allow the feature, false => disable the feature
655 static bool EnableClassLevelWhereClauses;
657 static int GetScannerType();
659 static hphp_string_imap<TypedValue> ConstantFunctions;
661 static const uint32_t kPCREInitialTableSize = 96 * 1024;
663 static std::string ExtensionDir;
664 static std::vector<std::string> Extensions;
665 static std::string DynamicExtensionPath;
666 static std::vector<std::string> DynamicExtensions;
668 static std::vector<std::string> TzdataSearchPaths;
670 #define HAC_CHECK_OPTS \
671 HC(Compare, compare) \
672 HC(ArrayKeyCast, array_key_cast)
674 #define EVALFLAGS() \
675 /* F(type, name, defaultVal) */ \
676 /* \
677 * Maximum number of elements on the VM execution stack. \
678 */ \
679 F(uint64_t, VMStackElms, kEvalVMStackElmsDefault) \
680 /* \
681 * Initial space reserved for the global variable environment (in \
682 * number of global variables). \
683 */ \
684 F(uint32_t, VMInitialGlobalTableSize, \
685 kEvalVMInitialGlobalTableSizeDefault) \
686 F(bool, Jit, evalJitDefault()) \
687 F(bool, JitEvaledCode, true) \
688 F(bool, JitRequireWriteLease, false) \
689 F(uint64_t, JitRelocationSize, kJitRelocationSizeDefault) \
690 F(uint64_t, JitMatureSize, 125 << 20) \
691 F(bool, JitMatureAfterWarmup, false) \
692 F(double, JitMaturityExponent, 1.) \
693 F(bool, JitTimer, kJitTimerDefault) \
694 F(int, JitConcurrently, 1) \
695 F(int, JitThreads, 4) \
696 F(int, JitWorkerThreads, std::max(1, Process::GetCPUCount() / 2)) \
697 F(int, JitWorkerThreadsForSerdes, 0) \
698 F(int, JitWorkerArenas, std::max(1, Process::GetCPUCount() / 4)) \
699 F(bool, JitParallelDeserialize, true) \
700 F(int, JitLdimmqSpan, 8) \
701 F(int, JitPrintOptimizedIR, 0) \
702 F(bool, RecordSubprocessTimes, false) \
703 F(bool, AllowHhas, false) \
704 F(bool, GenerateDocComments, true) \
705 F(bool, DisassemblerDocComments, true) \
706 F(bool, DisassemblerPropDocComments, true) \
707 F(bool, LoadFilepathFromUnitCache, false) \
708 F(bool, FatalOnParserOptionMismatch, true) \
709 F(bool, WarnOnSkipFrameLookup, true) \
710 /* \
711 * 0 - Code coverage cannot be enabled through request param \
712 * 1 - Code coverage can be enabled through request param \
713 * 2 - Code coverage enabled \
714 */ \
715 F(uint32_t, EnableCodeCoverage, 0) \
716 /* Whether to use the embedded hackc binary */ \
717 F(bool, HackCompilerUseEmbedded, facebook) \
718 /* Whether to trust existing versions of the extracted compiler */ \
719 F(bool, HackCompilerTrustExtract, true) \
720 /* When using an embedded hackc, extract it to the ExtractPath or the
721 ExtractFallback. */ \
722 F(string, HackCompilerExtractPath, "/var/run/hackc_%{schema}") \
723 F(string, HackCompilerFallbackPath, "/tmp/hackc_%{schema}_XXXXXX") \
724 /* Arguments to run embedded hackc binary with */ \
725 F(string, HackCompilerArgs, hackCompilerArgsDefault()) \
726 /* The command to invoke to spawn hh_single_compile in server mode. */\
727 F(string, HackCompilerCommand, hackCompilerCommandDefault()) \
728 /* The number of hh_single_compile daemons to keep alive. */ \
729 F(uint64_t, HackCompilerWorkers, Process::GetCPUCount()) \
730 /* The number of hh_single_compile daemons to keep alive during a \
731 * repo build after the files in the tree are parsed--set to 0 to \
732 * disable resizing the pool of compilers */ \
733 F(uint64_t, HackCompilerSecondaryWorkers, 2) \
734 /* The number of times to retry after an infra failure communicating
735 with a compiler process. */ \
736 F(uint64_t, HackCompilerMaxRetries, 0) \
737 /* Whether to log extern compiler performance */ \
738 F(bool, LogExternCompilerPerf, false) \
739 /* Whether to write verbose log messages to the error log and include
740 the hhas from failing units in the fatal error messages produced by
741 bad hh_single_compile units. */ \
742 F(bool, HackCompilerVerboseErrors, true) \
743 /* Whether the HackC compiler should inherit the compiler config of the
744 HHVM process that launches it. */ \
745 F(bool, HackCompilerInheritConfig, true) \
746 /* Use compiler pool to get hhas from hh_single_compile process */ \
747 F(bool, HackCompilerUseCompilerPool, true) \
748 /* When using embedded data, extract it to the ExtractPath or the
749 * ExtractFallback. */ \
750 F(string, EmbeddedDataExtractPath, "/var/run/hhvm_%{type}_%{buildid}") \
751 F(string, EmbeddedDataFallbackPath, "/tmp/hhvm_%{type}_%{buildid}_XXXXXX") \
752 /* Whether to trust existing versions of extracted embedded data. */ \
753 F(bool, EmbeddedDataTrustExtract, true) \
754 F(bool, LogThreadCreateBacktraces, false) \
755 F(bool, FailJitPrologs, false) \
756 F(bool, UseHHBBC, !getenv("HHVM_DISABLE_HHBBC")) \
757 /* Equivalent to setting the --test-compression HHBBC-only flag. */ \
758 F(bool, HHBBCTestCompression, false) \
759 F(bool, EnablePerRepoOptions, true) \
760 F(bool, CachePerRepoOptionsPath, true) \
761 F(bool, RaiseOnCaseInsensitiveLookup,true) \
762 F(bool, EnableHhbcByRef, true) \
763 F(bool, LogHackcMemStats, false) \
764 F(uint32_t, RaiseOnCaseInsensitiveLookupSampleRate, 1) \
766 CheckPropTypeHints:
767 0 - No checks or enforcement of property type hints.
768 1 - Raises E_WARNING if a property type hint fails.
769 2 - Raises E_RECOVERABLE_ERROR if regular property type hint fails, raises
770 E_WARNING if soft property type hint fails. If a regular property type
771 hint fails, it's possible for execution to resume normally if the user
772 error handler doesn't throw and returns something other than boolean
773 false.
774 3 - Same as 2, except if a regular property type hint fails the runtime will
775 not allow execution to resume normally; if the user error handler
776 returns something other than boolean false, the runtime will throw a
777 fatal error.
778 */ \
779 F(int32_t, CheckPropTypeHints, 1) \
780 /* Enables enforcing upper-bounds for generic types
781 1 => warning, 2 => error
782 */ \
783 F(int32_t, EnforceGenericsUB, 1) \
784 /* WarnOnTooManyArguments:
785 * 0 -> no warning, 1 -> warning, 2 -> exception
786 */ \
787 F(uint32_t, WarnOnTooManyArguments, 0) \
788 /* GetClassBadArgument:
789 * 0 -> no warning, 1 -> warning, 2 -> exception
790 */ \
791 F(uint32_t, GetClassBadArgument, 0) \
792 /* WarnOnIncDecInvalidType:
793 * 0 - No restrictions on types that can be incremented or decremented
794 * 1 - Warn when incrementing or decrementing non numeric types
795 * 2 - Throw when incrementing or decrementing non numeric types
796 */ \
797 F(uint32_t, WarnOnIncDecInvalidType, 0) \
798 F(bool, EnableImplicitContext, false) \
799 F(bool, MoreAccurateMemStats, true) \
800 F(bool, AllowScopeBinding, false) \
801 F(bool, JitNoGdb, true) \
802 F(bool, SpinOnCrash, false) \
803 F(uint32_t, DumpRingBufferOnCrash, 0) \
804 F(bool, PerfPidMap, true) \
805 F(bool, PerfPidMapIncludeFilePath, true) \
806 F(bool, PerfJitDump, false) \
807 F(string, PerfJitDumpDir, "/tmp") \
808 F(bool, PerfDataMap, false) \
809 F(bool, KeepPerfPidMap, false) \
810 F(uint32_t, ThreadTCMainBufferSize, 6 << 20) \
811 F(uint32_t, ThreadTCColdBufferSize, 6 << 20) \
812 F(uint32_t, ThreadTCFrozenBufferSize,4 << 20) \
813 F(uint32_t, ThreadTCDataBufferSize, 256 << 10) \
814 F(uint32_t, RDSSize, 64 << 20) \
815 F(uint32_t, HHBCArenaChunkSize, 10 << 20) \
816 F(bool, ProfileBC, false) \
817 F(bool, ProfileHeapAcrossRequests, false) \
818 F(bool, ProfileHWEnable, true) \
819 F(string, ProfileHWEvents, std::string("")) \
820 F(bool, ProfileHWExcludeKernel, false) \
821 F(bool, ProfileHWFastReads, false) \
822 F(bool, ProfileHWStructLog, false) \
823 F(int32_t, ProfileHWExportInterval, 30) \
824 F(string, ReorderProps, reorderPropsDefault()) \
825 F(bool, JitAlwaysInterpOne, false) \
826 F(int32_t, JitNopInterval, 0) \
827 F(uint32_t, JitMaxTranslations, 10) \
828 F(uint32_t, JitMaxProfileTranslations, 30) \
829 F(uint32_t, JitTraceletLiveLocsLimit, 2000) \
830 F(uint32_t, JitTraceletEagerGuardsLimit, 0) \
831 F(uint32_t, JitTraceletGuardsLimit, 5) \
832 F(uint64_t, JitGlobalTranslationLimit, -1) \
833 F(int64_t, JitMaxRequestTranslationTime, -1) \
834 F(uint32_t, JitMaxRegionInstrs, 1347) \
835 F(uint32_t, JitMaxLiveRegionInstrs, 50) \
836 F(uint32_t, JitMaxAwaitAllUnroll, 8) \
837 F(bool, JitProfileWarmupRequests, false) \
838 F(uint32_t, JitProfileRequests, profileRequestsDefault()) \
839 F(uint32_t, JitProfileBCSize, profileBCSizeDefault()) \
840 F(uint32_t, JitResetProfCountersRequest, resetProfCountersDefault()) \
841 F(uint32_t, JitRetranslateAllRequest, retranslateAllRequestDefault()) \
842 F(uint32_t, JitRetranslateAllSeconds, retranslateAllSecondsDefault()) \
843 F(bool, JitRerunRetranslateAll, false) \
844 F(bool, JitBuildOutliningHashes, false) \
845 F(bool, JitPGOLayoutSplitHotCold, pgoLayoutSplitHotColdDefault()) \
846 F(bool, JitPGOVasmBlockCounters, true) \
847 F(bool, JitPGOVasmBlockCountersForceSaveSF, false) \
848 F(bool, JitPGOVasmBlockCountersForceSaveGP, false) \
849 F(uint32_t, JitPGOVasmBlockCountersMaxOpMismatches, 12) \
850 F(uint32_t, JitPGOVasmBlockCountersMinEntryValue, \
851 ServerExecutionMode() ? 200 : 0) \
852 F(double, JitPGOVasmBlockCountersHotWeightMultiplier, 0) \
853 F(bool, JitLayoutSeparateZeroWeightBlocks, false) \
854 F(bool, JitLayoutPrologueSplitHotCold, layoutPrologueSplitHotColdDefault()) \
855 F(bool, JitLayoutProfileSplitHotCold, true) \
856 F(uint64_t, JitLayoutMinHotThreshold, 0) \
857 F(uint64_t, JitLayoutMinColdThreshold, 0) \
858 F(double, JitLayoutHotThreshold, 0.01) \
859 F(double, JitLayoutColdThreshold, 0.0005) \
860 F(int32_t, JitLayoutMainFactor, 1000) \
861 F(int32_t, JitLayoutColdFactor, 5) \
862 F(bool, JitLayoutExtTSP, true) \
863 F(double, JitLayoutMaxMergeRatio, 1000000) \
864 F(bool, JitLayoutPruneCatchArcs, true) \
865 F(bool, JitAHotSizeRoundUp, true) \
866 F(uint32_t, GdbSyncChunks, 128) \
867 F(bool, JitKeepDbgFiles, false) \
868 /* despite the unfortunate name, this enables function renaming and
869 * interception in the interpreter as well as the jit, and also
870 * implies all functions may be used with fb_intercept */ \
871 F(bool, JitEnableRenameFunction, EvalJitEnableRenameFunction) \
872 F(bool, JitUseVtuneAPI, false) \
873 F(bool, TraceCommandLineRequest, true) \
875 F(bool, JitDisabledByHphpd, false) \
876 F(uint32_t, JitWarmupStatusBytes, ((25 << 10) + 1)) \
877 F(uint32_t, JitWarmupMaxCodeGenRate, 20000) \
878 F(uint32_t, JitWarmupRateSeconds, 64) \
879 F(uint32_t, JitWarmupMinFillFactor, 10) \
880 F(uint32_t, JitWriteLeaseExpiration, 1500) /* in microseconds */ \
881 F(int, JitRetargetJumps, 1) \
882 /* Sync VM reg state for all native calls. */ \
883 F(bool, JitForceVMRegSync, false) \
884 /* Log the profile used to optimize array-like gets and sets. */ \
885 F(bool, LogArrayAccessProfile, false) \
886 /* Log the profile used to target iterator specialization. */ \
887 F(bool, LogArrayIterProfile, false) \
888 /* We use PGO to target specialization for "foreach" iterator loops. \
889 * We specialize if the chosen specialization covers this fraction \
890 * of profiled loops. If the value is > 1.0, we won't specialize. */ \
891 F(double, ArrayIterSpecializationRate, 0.99) \
892 F(bool, HHIRSimplification, true) \
893 F(bool, HHIRGenOpts, true) \
894 F(bool, HHIRRefcountOpts, true) \
895 F(bool, HHIREnableGenTimeInlining, true) \
896 F(uint32_t, HHIRInliningCostFactorMain, 100) \
897 F(uint32_t, HHIRInliningCostFactorCold, 32) \
898 F(uint32_t, HHIRInliningCostFactorFrozen, 10) \
899 F(uint32_t, HHIRInliningVasmCostLimit, 10500) \
900 F(uint32_t, HHIRInliningMinVasmCostLimit, 10000) \
901 F(uint32_t, HHIRInliningMaxVasmCostLimit, 40000) \
902 F(uint32_t, HHIRAlwaysInlineVasmCostLimit, 4800) \
903 F(uint32_t, HHIRInliningMaxDepth, 1000) \
904 F(double, HHIRInliningVasmCallerExp, .5) \
905 F(double, HHIRInliningVasmCalleeExp, .5) \
906 F(double, HHIRInliningDepthExp, 0) \
907 F(uint32_t, HHIRInliningMaxReturnDecRefs, 24) \
908 F(uint32_t, HHIRInliningMaxReturnLocals, 40) \
909 F(uint32_t, HHIRInliningMaxInitObjProps, 12) \
910 F(bool, HHIRInliningIgnoreHints, !debug) \
911 F(bool, HHIRInliningUseStackedCost, true) \
912 F(bool, HHIRInliningUseLayoutBlocks, false) \
913 F(bool, HHIRInlineFrameOpts, true) \
914 F(bool, HHIRPartialInlineFrameOpts, true) \
915 F(bool, HHIRAlwaysInterpIgnoreHint, !debug) \
916 F(bool, HHIRGenerateAsserts, false) \
917 F(bool, HHIRDeadCodeElim, true) \
918 F(bool, HHIRGlobalValueNumbering, true) \
919 F(bool, HHIRPredictionOpts, true) \
920 F(bool, HHIRMemoryOpts, true) \
921 F(bool, AssemblerFoldDefaultValues, true) \
922 F(uint64_t, AssemblerMaxScalarSize, 2147483648) /* 2GB */ \
923 F(uint32_t, HHIRLoadElimMaxIters, 10) \
924 /* Temporarily only enable in debug builds so the optimizations get
925 * tested */ \
926 F(bool, HHIRLoadEnableTeardownOpts, false) \
927 F(uint32_t, HHIRLoadStackTeardownMaxDecrefs, 8) \
928 F(uint32_t, HHIRLoadThrowMaxDecrefs, 64) \
929 F(bool, HHIRStorePRE, true) \
930 F(bool, HHIROutlineGenericIncDecRef, true) \
931 /* How many elements to inline for packed- or mixed-array inits. */ \
932 F(uint32_t, HHIRMaxInlineInitPackedElements, 8) \
933 F(uint32_t, HHIRMaxInlineInitMixedElements, 4) \
934 F(uint32_t, HHIRMaxInlineInitStructElements, 8) \
935 F(double, HHIROffsetArrayProfileThreshold, 0.85) \
936 F(double, HHIRSmallArrayProfileThreshold, 0.8) \
937 F(double, HHIRMissingArrayProfileThreshold, 0.8) \
938 F(double, HHIRExitArrayProfileThreshold, 0.98) \
939 F(double, HHIROffsetExitArrayProfileThreshold, 1.2) /* disabled */ \
940 F(double, HHIRIsTypeStructProfileThreshold, 0.95) \
941 /* Register allocation flags */ \
942 F(bool, HHIREnablePreColoring, true) \
943 F(bool, HHIREnableCoalescing, true) \
944 F(bool, HHIRAllocSIMDRegs, true) \
945 F(bool, JitStressTestLiveness, false) \
946 /* Region compiler flags */ \
947 F(string, JitRegionSelector, regionSelectorDefault()) \
948 F(bool, JitPGO, pgoDefault()) \
949 F(string, JitPGORegionSelector, "hotcfg") \
950 F(uint64_t, JitPGOThreshold, pgoThresholdDefault()) \
951 F(bool, JitPGOOnly, false) \
952 F(bool, JitPGOUsePostConditions, true) \
953 F(bool, JitPGOUseAddrCountedCheck, false) \
954 F(uint32_t, JitPGOUnlikelyIncRefCountedPercent, 2) \
955 F(uint32_t, JitPGOUnlikelyIncRefIncrementPercent, 5) \
956 F(uint32_t, JitPGOUnlikelyDecRefReleasePercent, 5) \
957 F(uint32_t, JitPGOUnlikelyDecRefCountedPercent, 2) \
958 F(uint32_t, JitPGOUnlikelyDecRefPersistPercent, 5) \
959 F(uint32_t, JitPGOUnlikelyDecRefSurvivePercent, 5) \
960 F(uint32_t, JitPGOUnlikelyDecRefDecrementPercent, 5) \
961 F(double, JitPGODecRefNZReleasePercentCOW, \
962 ServerExecutionMode() ? 0.5 : 0) \
963 F(double, JitPGODecRefNZReleasePercent, \
964 ServerExecutionMode() ? 5 : 0) \
965 F(double, JitPGODecRefNopDecPercentCOW, \
966 ServerExecutionMode() ? 0.5 : 0) \
967 F(double, JitPGODecRefNopDecPercent, ServerExecutionMode() ? 5 : 0) \
968 F(bool, JitPGOArrayGetStress, false) \
969 F(double, JitPGOMinBlockCountPercent, 0.025) \
970 F(double, JitPGOMinArcProbability, 0.0) \
971 F(uint32_t, JitPGOMaxFuncSizeDupBody, 80) \
972 F(uint32_t, JitPGORelaxPercent, 100) \
973 F(double, JitPGOCalledFuncCheckThreshold, 50) \
974 F(double, JitPGOCalledFuncExitThreshold, 99.9) \
975 F(bool, JitPGODumpCallGraph, false) \
976 F(bool, JitPGOOptCodeCallGraph, true) \
977 F(bool, JitPGORacyProfiling, false) \
978 F(bool, JitPGOHFSortPlus, false) \
979 F(uint32_t, JitLiveThreshold, ServerExecutionMode() ? 1000 : 0) \
980 F(uint32_t, JitProfileThreshold, ServerExecutionMode() ? 200 : 0) \
981 F(uint32_t, JitSrcKeyThreshold, 0) \
982 F(uint64_t, FuncCountHint, 10000) \
983 F(uint64_t, PGOFuncCountHint, 1000) \
984 F(bool, RegionRelaxGuards, true) \
985 /* DumpBytecode =1 dumps user php, =2 dumps systemlib & user php */ \
986 F(int32_t, DumpBytecode, 0) \
987 /* DumpHhas =1 dumps user php, =2 dumps systemlib & user php */ \
988 F(int32_t, DumpHhas, 0) \
989 F(string, DumpHhasToFile, "") \
990 F(bool, DumpTC, false) \
991 F(string, DumpTCPath, "/tmp") \
992 F(bool, DumpTCAnchors, false) \
993 F(uint32_t, DumpIR, 0) \
994 F(uint32_t, DumpIRJson, 0) \
995 F(bool, DumpTCAnnotationsForAllTrans,debug) \
996 /* DumpInlDecision 0=none ; 1=refuses ; 2=refuses+accepts */ \
997 F(uint32_t, DumpInlDecision, 0) \
998 F(uint32_t, DumpRegion, 0) \
999 F(bool, DumpCallTargets, false) \
1000 F(bool, DumpLayoutCFG, false) \
1001 F(bool, DumpVBC, false) \
1002 F(bool, DumpArrAccProf, false) \
1003 F(bool, DumpAst, false) \
1004 F(bool, DumpTargetProfiles, false) \
1005 F(bool, MapTgtCacheHuge, false) \
1006 F(bool, NewTHPHotText, false) \
1007 F(bool, FileBackedColdArena, useFileBackedArenaDefault()) \
1008 F(string, ColdArenaFileDir, "/tmp") \
1009 F(uint32_t, LowArenaMinAddr, 1u << 30) \
1010 F(uint32_t, MaxHotTextHugePages, hotTextHugePagesDefault()) \
1011 F(uint32_t, MaxLowMemHugePages, hugePagesSoundNice() ? 8 : 0) \
1012 F(uint32_t, MaxHighArenaHugePages, 0) \
1013 F(uint32_t, Num1GPagesForSlabs, 0) \
1014 F(uint32_t, Num2MPagesForSlabs, 0) \
1015 F(uint32_t, Num1GPagesForReqHeap, 0) \
1016 F(uint32_t, Num2MPagesForReqHeap, 0) \
1017 F(uint32_t, NumReservedSlabs, 0) \
1018 F(uint32_t, Num1GPagesForA0, 0) \
1019 F(uint32_t, Num2MPagesForA0, 0) \
1020 F(bool, BigAllocUseLocalArena, true) \
1021 F(bool, JsonParserUseLocalArena, true) \
1022 F(bool, XmlParserUseLocalArena, true) \
1023 F(bool, LowStaticArrays, true) \
1024 F(bool, RecycleAProf, true) \
1025 F(int64_t, HeapPurgeWindowSize, 5 * 1000000) \
1026 F(uint64_t, HeapPurgeThreshold, 128 * 1024 * 1024) \
1027 /* GC Options: See heap-collect.cpp for more details */ \
1028 F(bool, EagerGC, eagerGcDefault()) \
1029 F(bool, FilterGCPoints, true) \
1030 F(bool, Quarantine, eagerGcDefault()) \
1031 F(bool, HeapAllocSampleNativeStack, false) \
1032 F(bool, LogKilledRequests, true) \
1033 F(uint32_t, GCSampleRate, 0) \
1034 F(uint32_t, HeapAllocSampleRequests, 0) \
1035 F(uint32_t, HeapAllocSampleBytes, 256 * 1024) \
1036 F(uint32_t, SlabAllocAlign, 64) \
1037 F(uint32_t, MemTrackStart, 3500) \
1038 F(uint32_t, MemTrackEnd, 3700) \
1039 F(int64_t, GCMinTrigger, 64L<<20) \
1040 F(double, GCTriggerPct, 0.5) \
1041 F(bool, TwoPhaseGC, false) \
1042 F(bool, EnableGC, enableGcDefault()) \
1043 /* End of GC Options */ \
1044 F(bool, Verify, (getenv("HHVM_VERIFY") || \
1045 !EvalHackCompilerCommand.empty())) \
1046 F(bool, VerifyOnly, false) \
1047 F(bool, FatalOnVerifyError, !RepoAuthoritative) \
1048 F(bool, AbortBuildOnVerifyError, true) \
1049 F(bool, AbortBuildOnCompilerError, true) \
1050 F(uint32_t, StaticContentsLogRate, 100) \
1051 F(uint32_t, LogUnitLoadRate, 0) \
1052 F(uint32_t, MaxDeferredErrors, 50) \
1053 F(bool, JitAlignMacroFusionPairs, alignMacroFusionPairs()) \
1054 F(bool, JitAlignUniqueStubs, true) \
1055 F(uint32_t, SerDesSampleRate, 0) \
1056 F(bool, JitSerdesModeForceOff, false) \
1057 F(bool, JitDesUnitPreload, false) \
1058 F(std::set<std::string>, JitSerdesDebugFunctions, {}) \
1059 F(uint32_t, JitSerializeOptProfSeconds, ServerExecutionMode() ? 300 : 0)\
1060 F(uint32_t, JitSerializeOptProfRequests, 0) \
1061 F(int, SimpleJsonMaxLength, 2 << 20) \
1062 F(uint32_t, JitSampleRate, 0) \
1063 F(uint32_t, TraceServerRequestRate, 0) \
1064 /* Tracing Options */ \
1065 /* Base tracing sample rate for all requests */ \
1066 F(uint32_t, TracingSampleRate, 0) \
1067 /* Tracing sample rate for first N requests */ \
1068 F(uint32_t, TracingPerRequestCount, 0) \
1069 F(uint32_t, TracingPerRequestSampleRate, 0) \
1070 /* Tracing sample rate for first N requests per URL */ \
1071 F(uint32_t, TracingFirstRequestsCount, 0) \
1072 F(uint32_t, TracingFirstRequestsSampleRate, 0) \
1073 /* Empty string disables any Artillery tracing */ \
1074 F(std::string, ArtilleryTracePolicy, "") \
1075 /* Opaque tag to add to each trace. Useful for aggregation */ \
1076 F(std::string, TracingTagId, "") \
1077 /* Log the sizes and metadata for all translations in the TC broken
1078 * down by function and inclusive/exclusive size for inlined regions.
1079 * When set to "" TC size data will be sampled on a per function basis
1080 * as determined by JitSampleRate. When set to a non-empty string all
1081 * translations will be logged, and run_key column will be logged with
1082 * the value of this option. */ \
1083 F(string, JitLogAllInlineRegions, "") \
1084 F(bool, JitProfileGuardTypes, false) \
1085 F(uint32_t, JitFilterLease, 1) \
1086 F(uint32_t, PCRETableSize, kPCREInitialTableSize) \
1087 F(uint64_t, PCREExpireInterval, 2 * 60 * 60) \
1088 F(string, PCRECacheType, std::string("static")) \
1089 F(bool, EnableCompactBacktrace, true) \
1090 F(bool, EnableNuma, (numa_num_nodes > 1) && ServerExecutionMode()) \
1091 /* Use 1G pages for jemalloc metadata. */ \
1092 F(bool, EnableArenaMetadata1GPage, false) \
1093 /* Use 1G pages for jemalloc metadata (NUMA arenas if applicable). */ \
1094 F(bool, EnableNumaArenaMetadata1GPage, false) \
1095 /* Reserved space on 1G pages for jemalloc metadata (arena0). */ \
1096 F(uint64_t, ArenaMetadataReservedSize, 216 << 20) \
1097 F(bool, EnableCallBuiltin, true) \
1098 F(bool, EnableReusableTC, reuseTCDefault()) \
1099 F(bool, LogServerRestartStats, false) \
1100 /* Extra bytes added to each area (Hot/Cold/Frozen) of a translation. \
1101 * If we don't end up using a reusable TC, we'll drop the padding. */ \
1102 F(uint32_t, ReusableTCPadding, 128) \
1103 F(int64_t, StressUnitCacheFreq, 0) \
1104 /* Perf warning sampling rates. The SelectHotCFG warning is noisy. */ \
1105 F(int64_t, PerfWarningSampleRate, 1) \
1106 F(int64_t, SelectHotCFGSampleRate, 100) \
1107 F(int64_t, FunctionCallSampleRate, 0) \
1108 F(double, InitialLoadFactor, 1.0) \
1109 /* Controls emitting checks for bespoke arrays and using logging \
1110 * arrays at runtime. \
1112 * 0 - Disable bespokes. We assume that all array-likes have their \
1113 * standard (aka "vanilla") layouts. \
1114 * 1 - Test bespokes. We emit checks for vanilla layouts and produce \
1115 * logging arrays based on the request ID. If rid % 2 == 1, then \
1116 * a logging array is generated. \
1117 * 2 - Production bespokes. We emit checks as in (1), and produce \
1118 * logging arrays based on per creation site sampling with the \
1119 * sample rate specified by EmitLoggingArraySampleRate. If the \
1120 * sample rate is 0, logging arrays are never constructed. \
1121 * Logging arrays are only created before RTA has begun. */ \
1122 F(int32_t, BespokeArrayLikeMode, 0) \
1123 F(uint64_t, BespokeEscalationSampleRate, 0) \
1124 F(uint64_t, EmitLoggingArraySampleRate, 17) \
1125 F(string, ExportLoggingArrayDataPath, "") \
1126 /* Should we use structs? If so, how big can they get? Due to how we \
1127 * represent structs, we can't make any with more than 255 keys. */ \
1128 F(bool, EmitBespokeStructDicts, true) \
1129 F(uint8_t, BespokeStructDictMaxNumKeys, 64) \
1130 /* Should we use monotypes? */ \
1131 F(bool, EmitBespokeMonotypes, false) \
1132 /* Choice of layout selection algorithms: \
1134 * 0 - Default layout selection algorithm based on profiling. \
1135 * May use a mix of vanilla and bespoke array-likes. \
1136 * 1 - Specialize all sources and sinks on vanilla layouts. \
1137 * 2 - Specialize sources on vanilla, but sinks on top. */ \
1138 F(int32_t, BespokeArraySpecializationMode, 0) \
1139 /* We will use specialized layouts for a given array if they cover \
1140 * the given percent of operations logged during profiling. */ \
1141 F(double, BespokeArraySourceSpecializationThreshold, 95.0) \
1142 F(double, BespokeArraySinkSpecializationThreshold, 95.0) \
1143 /* Raise notices on various array operations which may present \
1144 * compatibility issues with Hack arrays. \
1146 * The various *Notices options independently control separate \
1147 * subsets of notices. The Check* options are subordinate to the \
1148 * HackArrCompatNotices option, and control whether various runtime \
1149 * checks are made; they do not affect any optimizations. */ \
1150 F(bool, HackArrCompatNotices, false) \
1151 F(bool, HackArrCompatCheckCompare, false) \
1152 F(bool, HackArrCompatFBSerializeHackArraysNotices, false) \
1153 /* Raise notices on intish-cast (which may use an is_array check) */ \
1154 F(bool, HackArrCompatIntishCastNotices, false) \
1155 /* Raise notices when is_vec or is_dict is called with a v/darray */ \
1156 F(bool, HackArrCompatIsVecDictNotices, false) \
1157 F(bool, HackArrCompatSerializeNotices, false) \
1158 /* Raise notices when fb_compact_*() would change behavior */ \
1159 F(bool, HackArrCompatCompactSerializeNotices, false) \
1160 /* Raise notices when we cast a marked dvarray to a vec or a marked \
1161 * darray to a dict (implicitly clearing the legacy mark). */ \
1162 F(bool, HackArrCompatCastMarkedArrayNotices, false) \
1163 /* When this flag is on, var_export outputs d/varrays. */ \
1164 F(bool, HackArrDVArrVarExport, false) \
1165 /* This is the flag for "unification", meaning that darrays are \
1166 * replaced by dicts and varrays by vecs. */ \
1167 F(bool, HackArrDVArrs, true) \
1168 /* Raise a notice for `$dict is shape` and `$vec is tuple`. */ \
1169 F(bool, HackArrIsShapeTupleNotices, false) \
1170 /* Notice on array serialization behavior, even if array provenance \
1171 * is disabled. If we see these notices, we're missing markings. */ \
1172 F(bool, RaiseArraySerializationNotices, false) \
1173 /* Dead flags. Will clean up when we clean them up in GlobalData. */ \
1174 F(bool, ArrayProvenance, false) \
1175 F(bool, LogArrayProvenance, false) \
1176 F(uint32_t, LogArrayProvenanceSampleRatio, 1000) \
1177 F(uint32_t, ArrayProvenanceLargeEnumLimit, 256) \
1178 F(uint32_t, LogArrayProvenanceDiagnosticsSampleRate, 0) \
1179 /* Raise a notice when the result of appending to a dict or darray \
1180 * is affected by removing keys from that array-like. */ \
1181 F(bool, DictDArrayAppendNotices, true) \
1182 /* Warn if is expression are used with type aliases that cannot be |
1183 * resolved */ \
1184 F(bool, IsExprEnableUnresolvedWarning, false) \
1185 /* Raise a notice if a Class type is passed to is_string */ \
1186 F(bool, ClassIsStringNotices, false) \
1187 /* Raise a notice if a Class type is passed to function that expects a
1188 string */ \
1189 F(bool, ClassStringHintNotices, false) \
1190 /* When this options is on, classname type-hints accepts classes */ \
1191 F(bool, ClassPassesClassname, false) \
1192 /* Raise notice if a Class type is passed to a classname type-hint */ \
1193 F(bool, ClassnameNotices, false) \
1194 /* Raise a notice if a ClsMeth type is passed to is_vec/is_array */ \
1195 F(bool, IsVecNotices, false) \
1196 /* Raise a notice if a ClsMeth type is passed to a function that
1197 * expects a vec/varray */ \
1198 F(bool, VecHintNotices, false) \
1199 /* Switches on miscellaneous junk. */ \
1200 F(bool, NoticeOnCreateDynamicProp, false) \
1201 F(bool, NoticeOnReadDynamicProp, false) \
1202 F(bool, NoticeOnImplicitInvokeToString, false) \
1203 F(bool, FatalOnConvertObjectToString, false) \
1204 F(bool, NoticeOnBuiltinDynamicCalls, false) \
1205 F(bool, RxPretendIsEnabled, false) \
1206 /* Raise warning when class pointers are used as strings. */ \
1207 F(bool, RaiseClassConversionWarning, false) \
1208 F(bool, EmitClsMethPointers, true) \
1209 F(bool, FoldLazyClassKeys, true) \
1210 /* EmitClassPointers:
1211 * 0 => convert Foo::class to string "Foo"
1212 * 1 => convert Foo::class to class pointer
1213 * 2 => convert Foo::class to lazy class */ \
1214 F(int32_t, EmitClassPointers, 0) \
1215 /* When this flag is on, var_dump for
1216 * classes and lazy classes outputs string(...). */ \
1217 F(bool, ClassAsStringVarDump, true) \
1218 /* When this flag is on, var_export for
1219 * classes and lazy classes outputs a string. */ \
1220 F(bool, ClassAsStringVarExport, false) \
1221 /* When this flag is on, gettype for
1222 * classes and lazy classes outputs string. */ \
1223 F(bool, ClassAsStringGetType, true) \
1224 /* false to skip type refinement for ClsMeth type at HHBBC. */ \
1225 F(bool, IsCompatibleClsMethType, false) \
1226 /* Raise warning if a ClsMeth type is compared to other types. */ \
1227 F(bool, RaiseClsMethComparisonWarning, false) \
1228 /* Raise warning when ClsMethDataRef is used as varray/vec. */ \
1229 F(bool, RaiseClsMethConversionWarning, false) \
1230 /* Raise warning when strings are used as classes. */ \
1231 F(bool, RaiseStrToClsConversionWarning, false) \
1232 F(bool, EmitMethCallerFuncPointers, false) \
1233 /* trigger E_USER_WARNING error when getClassName()/getMethodName()
1234 * is used on __SystemLib\MethCallerHelper */ \
1235 F(bool, NoticeOnMethCallerHelperUse, false) \
1236 /* \
1237 * Control dynamic calls to functions and dynamic constructs of \
1238 * classes which haven't opted into being called that way. \
1240 * 0 - Do nothing \
1241 * 1 - Warn if meth_caller is apc serialized \
1242 * 2 - Throw exception if meth_caller is apc serialized \
1243 */ \
1244 F(int32_t, ForbidMethCallerAPCSerialize, 0) \
1245 F(bool, NoticeOnCollectionToBool, false) \
1246 F(bool, NoticeOnSimpleXMLBehavior, false) \
1247 /* Enables Hack records. */ \
1248 F(bool, HackRecords, false) \
1249 /* \
1250 * Control dynamic calls to functions and dynamic constructs of \
1251 * classes which haven't opted into being called that way. \
1253 * 0 - Do nothing \
1254 * 1 - Warn if target is not annotated \
1255 * 2 - Throw exception if target is not annotated; warn if dynamic \
1256 * callsite is using a raw string or array (depending on \
1257 * ForbidDynamicCallsWithAttr setting) \
1258 * 3 - Throw exception \
1259 */ \
1260 F(int32_t, ForbidDynamicCallsToFunc, 0) \
1261 F(int32_t, ForbidDynamicCallsToClsMeth, 0) \
1262 F(int32_t, ForbidDynamicCallsToInstMeth, 0) \
1263 F(int32_t, ForbidDynamicConstructs, 0) \
1264 /* \
1265 * Keep logging dynamic calls according to options above even if \
1266 * __DynamicallyCallable attribute is present at declaration. \
1267 */ \
1268 F(bool, ForbidDynamicCallsWithAttr, true) \
1269 /* Toggles logging for expressions of type $var::name() */ \
1270 F(bool, LogKnownMethodsAsDynamicCalls, true) \
1271 /* \
1272 * Don't allow unserializing to __PHP_Incomplete_Class \
1273 * 0 - Nothing \
1274 * 1 - Warn \
1275 * 2 - Throw exception \
1276 */ \
1277 F(int32_t, ForbidUnserializeIncompleteClass, 0) \
1278 /* \
1279 * Map from coeffect name to enforcement level \
1280 * e.g. {'pure' => 2, 'rx' => 1} \
1281 */ \
1282 F(StringToIntMap, CoeffectEnforcementLevels, {}) \
1283 F(uint32_t, CoeffectViolationWarningSampleRate, 1) \
1284 F(uint32_t, ContextConstantWarningSampleRate, 1) \
1285 /* \
1286 * 0 - Nothing \
1287 * 1 - Warn \
1288 * 2 - Fail unit verification (i.e. fail to load it) \
1289 */ \
1290 F(int32_t, RxVerifyBody, 0) \
1291 F(int32_t, PureVerifyBody, 0) \
1292 F(bool, RxIsEnabled, EvalRxPretendIsEnabled) \
1293 /* \
1294 * Controls behavior on reflection to default value expressions \
1295 * that throw during evaluation \
1296 * 0 - Nothing \
1297 * 1 - Warn and retain current behavior \
1298 * 2 - Return null for parameter value \
1299 */ \
1300 F(int32_t, FixDefaultArgReflection, 1) \
1301 F(int32_t, ServerOOMAdj, 0) \
1302 F(std::string, PreludePath, "") \
1303 F(uint32_t, NonSharedInstanceMemoCaches, 10) \
1304 F(bool, UseGraphColor, true) \
1305 F(std::vector<std::string>, IniGetHide, std::vector<std::string>()) \
1306 F(std::string, UseRemoteUnixServer, "no") \
1307 F(std::string, UnixServerPath, "") \
1308 F(uint32_t, UnixServerWorkers, Process::GetCPUCount()) \
1309 F(bool, UnixServerQuarantineApc, false) \
1310 F(bool, UnixServerQuarantineUnits, false) \
1311 F(bool, UnixServerVerifyExeAccess, false) \
1312 F(bool, UnixServerFailWhenBusy, false) \
1313 F(std::vector<std::string>, UnixServerAllowedUsers, \
1314 std::vector<std::string>()) \
1315 F(std::vector<std::string>, UnixServerAllowedGroups, \
1316 std::vector<std::string>()) \
1317 /* Options for testing */ \
1318 F(bool, TrashFillOnRequestExit, false) \
1319 /****************** \
1320 | ARM Options. | \
1321 *****************/ \
1322 F(bool, JitArmLse, armLseDefault()) \
1323 /******************** \
1324 | Profiling flags. | \
1325 ********************/ \
1326 /* Whether to maintain the address-to-VM-object mapping. */ \
1327 F(bool, EnableReverseDataMap, true) \
1328 /* Turn on perf-mem-event sampling roughly every this many requests. \
1329 * To maintain the same overall sampling rate, the ratio between the \
1330 * request and sample frequencies should be kept constant. */ \
1331 F(uint32_t, PerfMemEventRequestFreq, 0) \
1332 /* Sample this many memory instructions per second. This should be \
1333 * kept low to avoid the risk of collecting a sample while we're \
1334 * processing a previous sample. */ \
1335 F(uint32_t, PerfMemEventSampleFreq, 80) \
1336 /* Sampling frequency for TC branch profiling. */ \
1337 F(uint32_t, ProfBranchSampleFreq, 0) \
1338 /* Sampling frequency for profiling packed array accesses. */ \
1339 F(uint32_t, ProfPackedArraySampleFreq, 0) \
1340 F(bool, UseXedAssembler, false) \
1341 /* Record the first N units loaded via StructuredLog::log() */ \
1342 F(uint64_t, RecordFirstUnits, 0) \
1343 /* More aggresively reuse already compiled units based on SHA1 */ \
1344 F(bool, CheckUnitSHA1, true) \
1345 F(bool, ReuseUnitsByHash, false) \
1346 F(bool, StressUnitSerde, false) \
1347 /* Arbitrary string to force different unit-cache hashes */ \
1348 F(std::string, UnitCacheBreaker, "") \
1349 /* When dynamic_fun is called on a function not marked as
1350 __DynamicallyCallable:
1352 0 - do nothing
1353 1 - raise a warning
1354 2 - throw */ \
1355 F(uint64_t, DynamicFunLevel, 1) \
1356 /* When dynamic_class_meth is called on a method not marked as
1357 __DynamicallyCallable:
1359 0 - do nothing
1360 1 - raise a warning
1361 2 - throw */ \
1362 F(uint64_t, DynamicClsMethLevel, 1) \
1363 /* When dynamic_meth_caller is called on a static method or
1364 a method not marked as __DynamicallyCallable:
1366 0 - do nothing
1367 1 - raise a warning
1368 2 - throw */ \
1369 F(uint64_t, DynamicMethCallerLevel, 1) \
1370 F(bool, APCSerializeFuncs, true) \
1371 F(bool, APCSerializeClsMeth, true) \
1372 /* When set:
1373 * - `is_array` becomes equivalent to `is_any_array` or
1374 * `isTvArrayLike` instead of being a strict PHP array check.
1375 */ \
1376 F(bool, EnablePerFileCoverage, false) \
1377 F(bool, LogOnIsArrayFunction, false) \
1378 /* Unit prefetching options */ \
1379 F(uint32_t, UnitPrefetcherMaxThreads, 0) \
1380 F(uint32_t, UnitPrefetcherMinThreads, 0) \
1381 F(uint32_t, UnitPrefetcherIdleThreadTimeoutSecs, 60) \
1382 /* Delete any Unit not used in last N seconds */ \
1383 F(uint32_t, IdleUnitTimeoutSecs, 0) \
1384 /* Don't reap total Units below threshold */ \
1385 F(uint32_t, IdleUnitMinThreshold, 0) \
1386 /* 0 nothing, 1 notice, 2 error */ \
1387 F(int32_t, NoticeOnCoerceForStrConcat, 0) \
1388 /* 0 nothing, 1 notice, 2 error */ \
1389 F(int32_t, NoticeOnCoerceForBitOp, 0) \
1390 /* 0 nothing, 1 notice, 2 error */ \
1391 F(int32_t, NoticeOnCoerceForIncDec, 0) \
1392 /* 0 nothing, 1 notice, 2 error */ \
1393 F(int32_t, NoticeOnCoerceForMath, 0) \
1394 F(string, TaoMigrationOverride, std::string("")) \
1395 F(string, SRRouteMigrationOverride, std::string("")) \
1396 /* */
1398 private:
1399 using string = std::string;
1401 // Custom settings. This should be accessed via the GetServerCustomSetting
1402 // APIs.
1403 static std::map<std::string, std::string> CustomSettings;
1405 public:
1406 #define F(type, name, unused) \
1407 static type Eval ## name;
1408 EVALFLAGS()
1409 #undef F
1411 static bool RecordCodeCoverage;
1412 static std::string CodeCoverageOutputFile;
1414 // Repo (hhvm bytecode repository) options
1415 static RepoMode RepoLocalMode;
1416 static std::string RepoLocalPath;
1417 static RepoMode RepoCentralMode;
1418 static std::string RepoCentralPath;
1419 static int32_t RepoCentralFileMode;
1420 static std::string RepoCentralFileUser;
1421 static std::string RepoCentralFileGroup;
1422 static bool RepoAllowFallbackPath;
1423 static std::string RepoJournal;
1424 static bool RepoCommit;
1425 static bool RepoDebugInfo;
1426 static bool RepoAuthoritative;
1427 static int64_t RepoLocalReadaheadRate;
1428 static bool RepoLitstrLazyLoad;
1429 static bool RepoLocalReadaheadConcurrent;
1430 static uint32_t RepoBusyTimeoutMS;
1432 // pprof/hhprof options
1433 static bool HHProfEnabled;
1434 static bool HHProfActive;
1435 static bool HHProfAccum;
1436 static bool HHProfRequest;
1437 static bool TrackPerUnitMemory;
1439 // Sandbox options
1440 static bool SandboxMode;
1441 static std::string SandboxPattern;
1442 static std::string SandboxHome;
1443 static std::string SandboxFallback;
1444 static std::string SandboxConfFile;
1445 static std::map<std::string, std::string> SandboxServerVariables;
1446 static bool SandboxFromCommonRoot;
1447 static std::string SandboxDirectoriesRoot;
1448 static std::string SandboxLogsRoot;
1449 static std::string SandboxDefaultUserFile;
1450 static std::string SandboxHostAlias;
1452 // Debugger options
1453 static bool EnableHphpdDebugger;
1454 static bool EnableVSDebugger;
1455 static int VSDebuggerListenPort;
1456 static std::string VSDebuggerDomainSocketPath;
1457 static bool VSDebuggerNoWait;
1458 static bool EnableDebuggerColor;
1459 static bool EnableDebuggerPrompt;
1460 static bool EnableDebuggerServer;
1461 static bool EnableDebuggerUsageLog;
1462 static bool DebuggerDisableIPv6;
1463 static std::string DebuggerServerIP;
1464 static int DebuggerServerPort;
1465 static int DebuggerDefaultRpcPort;
1466 static std::string DebuggerDefaultRpcAuth;
1467 static std::string DebuggerRpcHostDomain;
1468 static int DebuggerDefaultRpcTimeout;
1469 static std::string DebuggerDefaultSandboxPath;
1470 static std::string DebuggerStartupDocument;
1471 static int DebuggerSignalTimeout;
1472 static std::string DebuggerAuthTokenScriptBin;
1473 static std::string DebuggerSessionAuthScriptBin;
1475 // Mail options
1476 static std::string SendmailPath;
1477 static std::string MailForceExtraParameters;
1479 // preg stack depth and debug support options
1480 static int64_t PregBacktraceLimit;
1481 static int64_t PregRecursionLimit;
1482 static bool EnablePregErrorLog;
1484 // SimpleXML options
1485 static bool SimpleXMLEmptyNamespaceMatchesAll;
1487 // Cookie options
1488 static bool AllowDuplicateCookies;
1490 #ifdef FACEBOOK
1491 // fb303 server
1492 static bool EnableFb303Server;
1493 static int Fb303ServerPort;
1494 static std::string Fb303ServerIP;
1495 static int Fb303ServerThreadStackSizeMb;
1496 static int Fb303ServerWorkerThreads;
1497 static int Fb303ServerPoolThreads;
1498 #endif
1500 // Xenon options
1501 static double XenonPeriodSeconds;
1502 static uint32_t XenonRequestFreq;
1503 static bool XenonForceAlwaysOn;
1505 // Strobelight options
1506 static bool StrobelightEnabled;
1508 static bool SetProfileNullThisObject;
1510 static_assert(sizeof(RuntimeOption) == 1, "no instance variables");
1512 using RO = RuntimeOption;
1514 inline bool isJitDeserializing() {
1515 auto const m = RuntimeOption::EvalJitSerdesMode;
1516 return static_cast<std::underlying_type<JitSerdesMode>::type>(m) & 0x2;
1519 inline bool isJitSerializing() {
1520 auto const m = RuntimeOption::EvalJitSerdesMode;
1521 return static_cast<std::underlying_type<JitSerdesMode>::type>(m) & 0x1;
1524 inline bool unitPrefetchingEnabled() {
1525 return RO::EvalUnitPrefetcherMaxThreads > 0;
1528 uintptr_t lowArenaMinAddr();
1530 ///////////////////////////////////////////////////////////////////////////////