Skip to content

Commit e8d2554

Browse files
WizKidfacebook-github-bot
authored andcommitted
Move Jit configs to configs.specification
Summary: - This moves all configs that starts with JIT to configs.specification Reviewed By: ricklavoie Differential Revision: D53293344 fbshipit-source-id: f45ccca69b4a1d3bca33bc960e0de98cd5f73163
1 parent b580e10 commit e8d2554

Some content is hidden

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

82 files changed

+634
-499
lines changed

hphp/compiler/compiler.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ CONFIGS_FOR_REPOGLOBALDATA()
513513
gd.ActiveDeployment = RO::EvalActiveDeployment;
514514
gd.ModuleLevelTraits = RO::EvalModuleLevelTraits;
515515
gd.TreatCaseTypesAsMixed = RO::EvalTreatCaseTypesAsMixed;
516-
gd.JitEnableRenameFunction = RO::EvalJitEnableRenameFunction;
517516
gd.RenamableFunctions = RO::RenamableFunctions;
518517
gd.NonInterceptableFunctions = RO::NonInterceptableFunctions;
519518
gd.StrictUtf8Mode = RuntimeOption::EvalStrictUtf8Mode;
@@ -773,7 +772,7 @@ int prepareOptions(CompilerOptions &po, int argc, char **argv) {
773772
Option::Load(ini, config);
774773
RuntimeOption::RepoAuthoritative = false;
775774
RuntimeOption::RepoPath = "";
776-
RuntimeOption::EvalJit = false;
775+
Cfg::Jit::Enabled = false;
777776
RuntimeOption::EvalLowStaticArrays = false;
778777

779778
std::vector<std::string> badnodes;

hphp/compiler/option.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <vector>
2424

2525
#include "hphp/runtime/base/config.h"
26+
#include "hphp/runtime/base/configs/configs-load.h"
2627
#include "hphp/runtime/base/ini-setting.h"
2728
#include "hphp/runtime/base/preg.h"
2829
#include "hphp/runtime/base/variable-unserializer.h"
@@ -132,6 +133,8 @@ void Option::Load(const IniSetting::Map& ini, Hdf &config) {
132133
Logger::FError("Invalid ConstantFunction: '{}'\n", str);
133134
}
134135

136+
Cfg::LoadForCompiler(ini, config);
137+
135138
{
136139
// Repo
137140
Config::Bind(RuntimeOption::RepoDebugInfo,
@@ -142,9 +145,6 @@ void Option::Load(const IniSetting::Map& ini, Hdf &config) {
142145
Config::Bind(RuntimeOption::EvalCheckPropTypeHints, ini, config,
143146
"CheckPropTypeHints", RuntimeOption::EvalCheckPropTypeHints);
144147

145-
Config::Bind(RuntimeOption::EvalJitEnableRenameFunction,
146-
ini, config, "JitEnableRenameFunction",
147-
RuntimeOption::EvalJitEnableRenameFunction);
148148
Config::Bind(RuntimeOption::EvalHackArrCompatSerializeNotices,
149149
ini, config, "HackArrCompatSerializeNotices",
150150
RuntimeOption::EvalHackArrCompatSerializeNotices);

hphp/doc/coding-conventions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ for (auto const& thing : thingVec) {
453453
with the beginning of the current parenthesis/brace nesting level. For
454454
example, here are some long expressions, formatted appropriately:
455455
```cpp
456-
if (RuntimeOption::EvalJitRegionSelector != "" &&
456+
if (Cfg::Jit::RegionSelector != "" &&
457457
(Cfg::HHIR::RefcountOpts ||
458458
RuntimeOption::EvalHHITExtraOptPass) &&
459459
Func::numLoadedFuncs() < 600) {

hphp/doc/configs.specification

+147
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,152 @@ The format can be found in hphp/runtime/base/configs/generate-script.rs
187187
- bool HHIR.AllocSIMDRegs = true, UNKNOWN
188188
- uint32_t HHIR.SpecializedDestructorThreshold = 80, UNKNOWN
189189

190+
# Jit (Eval.Jit)
191+
192+
- bool Jit.Enabled = true (Eval.Jit), UNKNOWN
193+
- bool Jit.EvaledCode = true, UNKNOWN
194+
- bool Jit.RequireWriteLease = false, UNKNOWN
195+
- uint64_t Jit.RelocationSize = 1 << 20, UNKNOWN
196+
- uint64_t Jit.MatureSize = 125 << 20, UNKNOWN
197+
- bool Jit.MatureAfterWarmup = false, UNKNOWN
198+
- double Jit.MaturityExponent = 1.0, UNKNOWN
199+
- double Jit.MaturityProfWeight = 1.0, UNKNOWN
200+
- bool Jit.Timer, UNKNOWN
201+
- int Jit.Threads = 4, UNKNOWN
202+
- int Jit.WorkerThreads, UNKNOWN
203+
- int Jit.WorkerThreadsForSerdes = 0, UNKNOWN
204+
- int Jit.WorkerArenas, UNKNOWN
205+
- bool Jit.ParallelDeserialize = true, UNKNOWN
206+
- int Jit.LdimmqSpan = 8, UNKNOWN
207+
- int Jit.PrintOptimizedIR = 0, UNKNOWN
208+
- int Jit.Concurrently = 1, UNKNOWN
209+
- bool Jit.PGORacyProfiling = false, UNKNOWN
210+
- bool Jit.AlwaysInterpOne = false, UNKNOWN
211+
- uint32_t Jit.NopInterval = 0, UNKNOWN
212+
- uint32_t Jit.MaxTranslations = 10, UNKNOWN
213+
- uint32_t Jit.MaxProfileTranslations = 30, UNKNOWN
214+
- uint32_t Jit.TraceletLiveLocsLimit = 2000, UNKNOWN
215+
- uint32_t Jit.TraceletEagerGuardsLimit = 0, UNKNOWN
216+
- uint32_t Jit.TraceletGuardsLimit = 5, UNKNOWN
217+
- uint64_t Jit.GlobalTranslationLimit = -1, UNKNOWN
218+
- int64_t Jit.MaxRequestTranslationTime = -1, UNKNOWN
219+
- uint32_t Jit.MaxRegionInstrs = 3000, UNKNOWN
220+
- uint32_t Jit.MaxLiveRegionInstrs = 50, UNKNOWN
221+
- uint32_t Jit.MaxAwaitAllUnroll = 8, UNKNOWN
222+
- bool Jit.ProfileWarmupRequests = false, UNKNOWN
223+
- uint32_t Jit.ProfileRequests, UNKNOWN
224+
- uint32_t Jit.ProfileBCSize, UNKNOWN
225+
- uint32_t Jit.ResetProfCountersRequest, UNKNOWN
226+
- uint32_t Jit.RetranslateAllRequest, UNKNOWN
227+
- uint32_t Jit.RetranslateAllSeconds, UNKNOWN
228+
- bool Jit.RerunRetranslateAll = false, UNKNOWN
229+
- bool Jit.BuildOutliningHashes = false, UNKNOWN
230+
- bool Jit.PGOLayoutSplitHotCold, UNKNOWN
231+
- bool Jit.PGOVasmBlockCounters = true, UNKNOWN
232+
- bool Jit.PGOVasmBlockCountersOptPrologue = true, UNKNOWN
233+
- uint32_t Jit.PGOVasmBlockCountersMaxOpMismatches = 12, UNKNOWN
234+
- uint32_t Jit.PGOVasmBlockCountersMinEntryValue, UNKNOWN
235+
- double Jit.PGOVasmBlockCountersHotWeightMultiplier = 0, UNKNOWN
236+
- bool Jit.LayoutSeparateZeroWeightBlocks = false, UNKNOWN
237+
- bool Jit.LayoutPrologueSplitHotCold, UNKNOWN
238+
- bool Jit.LayoutProfileSplitHotCold = true, UNKNOWN
239+
- uint64_t Jit.LayoutMinHotThreshold = 0, UNKNOWN
240+
- uint64_t Jit.LayoutMinColdThreshold = 0, UNKNOWN
241+
- double Jit.LayoutHotThreshold = 0.01, UNKNOWN
242+
- double Jit.LayoutColdThreshold = 0.0005, UNKNOWN
243+
- int32_t Jit.LayoutMainFactor = 1000, UNKNOWN
244+
- int32_t Jit.LayoutColdFactor = 5, UNKNOWN
245+
- bool Jit.LayoutExtTSP = true, UNKNOWN
246+
- bool Jit.LayoutExtTSPForPrologues = false, UNKNOWN
247+
- double Jit.LayoutExtTSPMaxMergeDensityRatio = 25, UNKNOWN
248+
- double Jit.LayoutMaxMergeRatio = 1000000, UNKNOWN
249+
- bool Jit.LayoutPruneCatchArcs = true, UNKNOWN
250+
- bool Jit.KeepDbgFiles = false, UNKNOWN
251+
- uint32_t Jit.EnableRenameFunction = 0, UNKNOWN, globaldata|compileroption(JitEnableRenameFunction)|unitcacheflag
252+
253+
This controls function renaming.
254+
0 - Renaming not allowed
255+
1 - All functions can be renamed
256+
2 - Functions in RenamableFunctions config list can be renamed
257+
258+
- uint32_t Jit.InterceptFunctionLogRate = 1000, UNKNOWN
259+
- bool Jit.UseVtuneAPI = false, UNKNOWN
260+
- bool Jit.DisabledByHphpd = false, UNKNOWN
261+
- bool Jit.DisabledByVSDebug = true, UNKNOWN
262+
- uint32_t Jit.WarmupStatusBytes = ((25 << 10) + 1), UNKNOWN
263+
- uint32_t Jit.WarmupMaxCodeGenRate = 20000, UNKNOWN
264+
- uint32_t Jit.WarmupRateSeconds = 64, UNKNOWN
265+
- uint32_t Jit.WarmupMinFillFactor = 10, UNKNOWN
266+
- uint32_t Jit.WriteLeaseExpiration = 1500, UNKNOWN
267+
268+
In seconds
269+
270+
- int Jit.RetargetJumps = 1, UNKNOWN
271+
- bool Jit.ForceVMRegSync = false, UNKNOWN
272+
273+
Sync VM reg state for all native calls.
274+
275+
- std::string Jit.RegionSelector = "tracelet", UNKNOWN
276+
- bool Jit.NoGdb = true, UNKNOWN
277+
- bool Jit.PGO, UNKNOWN
278+
- std::string Jit.PGORegionSelector = "hotcfg", UNKNOWN
279+
- uint64_t Jit.PGOThreshold, UNKNOWN
280+
- bool Jit.PGOOnly = false, UNKNOWN
281+
- bool Jit.PGOUsePostConditions = true, UNKNOWN
282+
- bool Jit.PGOUseAddrCountedCheck = false, UNKNOWN
283+
- uint32_t Jit.PGOUnlikelyIncRefCountedPercent = 2, UNKNOWN
284+
- uint32_t Jit.PGOUnlikelyIncRefIncrementPercent = 5, UNKNOWN
285+
- uint32_t Jit.PGOUnlikelyDecRefReleasePercent = 5, UNKNOWN
286+
- uint32_t Jit.PGOUnlikelyDecRefCountedPercent = 2, UNKNOWN
287+
- uint32_t Jit.PGOUnlikelyDecRefPersistPercent = 5, UNKNOWN
288+
- uint32_t Jit.PGOUnlikelyDecRefSurvivePercent = 5, UNKNOWN
289+
- uint32_t Jit.PGOUnlikelyDecRefDecrementPercent = 5, UNKNOWN
290+
- double Jit.PGODecRefNZReleasePercentCOW, UNKNOWN
291+
- double Jit.PGODecRefNZReleasePercent, UNKNOWN
292+
- double Jit.PGODecRefNopDecPercentCOW, UNKNOWN
293+
- double Jit.PGODecRefNopDecPercent, UNKNOWN
294+
- bool Jit.PGOArrayGetStress = false, UNKNOWN
295+
- double Jit.PGOMinBlockCountPercent = 0.25, UNKNOWN
296+
297+
Mininum weight of a tracelet to include it in HotCFG as a percentage
298+
of the weight of the first tracelet in the region. [0,100]
299+
300+
- double Jit.PGOMinArcProbability = 0.0, UNKNOWN
301+
302+
Minimum probability of an arc to include it in HotCFG. [0,1]
303+
304+
- uint32_t Jit.PGORelaxPercent = 100, UNKNOWN
305+
- double Jit.PGOCalledFuncCheckThreshold = 25, UNKNOWN
306+
- double Jit.PGOCalledFuncExitThreshold = 99.9, UNKNOWN
307+
- bool Jit.PGODumpCallGraph = false, UNKNOWN
308+
- bool Jit.PGOOptCodeCallGraph = true, UNKNOWN
309+
- bool Jit.PGOHFSortPlus = false, UNKNOWN
310+
- uint8_t Jit.LiveThreshold, UNKNOWN
311+
- uint8_t Jit.ProfileThreshold, UNKNOWN
312+
- uint32_t Jit.MaxLiveMainUsage = 96 * 1024 * 1024, UNKNOWN
313+
- uint32_t Jit.SampleRate = 0, UNKNOWN
314+
- bool Jit.AlignMacroFusionPairs, UNKNOWN
315+
- bool Jit.AlignUniqueStubs = true, UNKNOWN
316+
- bool Jit.SerdesModeForceOff = false, UNKNOWN
317+
- bool Jit.DesUnitPreload = false, UNKNOWN
318+
- std::set<std::string> Jit.SerdesDebugFunctions = {}, UNKNOWN
319+
- std::set<std::string> Jit.FuncBlockList = {}, UNKNOWN
320+
- uint32_t Jit.SerializeOptProfSeconds, UNKNOWN
321+
- uint32_t Jit.SerializeOptProfRequests = 0, UNKNOWN
322+
- bool Jit.SerializeOptProfRestart = true, UNKNOWN
323+
- bool Jit.ArmLse, UNKNOWN
324+
- std::string Jit.LogAllInlineRegions = "", UNKNOWN
325+
326+
Log the sizes and metadata for all translations in the TC broken
327+
down by function and inclusive/exclusive size for inlined regions.
328+
When set to "" TC size data will be sampled on a per function basis
329+
as determined by JitSampleRate. When set to a non-empty string all
330+
translations will be logged, and run_key column will be logged with
331+
the value of this option.
332+
333+
- bool Jit.ProfileGuardTypes = false, UNKNOWN
334+
- uint32_t Jit.FilterLease = 1, UNKNOWN
335+
190336
# PHP7
191337

192338
- bool PHP7.all, UNKNOWN, private
@@ -213,6 +359,7 @@ The format can be found in hphp/runtime/base/configs/generate-script.rs
213359

214360
# Server
215361

362+
- bool Server.Mode = false, UNKNOWN, nobind
216363
- int Server.ThreadJobMaxQueuingMilliSeconds = -1, UNKNOWN
217364
- bool Server.ThreadDropStack = false, UNKNOWN
218365
- bool Server.HttpSafeMode = false, UNKNOWN

hphp/hhbbc/eval-cell.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <folly/ScopeGuard.h>
2222

2323
#include "hphp/runtime/base/array-data.h"
24+
#include "hphp/runtime/base/configs/jit.h" // @manual=//hphp/runtime/base/configs:jit-header
2425
#include "hphp/runtime/base/execution-context.h"
2526
#include "hphp/runtime/base/string-data.h"
2627
#include "hphp/runtime/base/tv-refcount.h"
@@ -43,7 +44,7 @@ namespace HPHP::HHBBC {
4344
template<class Pred>
4445
Optional<Type> eval_cell(Pred p) {
4546
try {
46-
assertx(!RuntimeOption::EvalJit);
47+
assertx(!Cfg::Jit::Enabled);
4748
ThrowAllErrorsSetter taes;
4849

4950
TypedValue c = p();

hphp/hhbbc/interp-builtin.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "hphp/runtime/base/array-init.h"
2222
#include "hphp/runtime/base/array-iterator.h"
23+
#include "hphp/runtime/base/configs/jit.h"
2324
#include "hphp/runtime/base/execution-context.h"
2425
#include "hphp/runtime/base/type-structure-helpers-defs.h"
2526

@@ -698,7 +699,7 @@ Optional<Type> const_fold(ISS& env,
698699

699700
FTRACE(1, "invoking: {}\n", func->fullName()->data());
700701

701-
assertx(!RuntimeOption::EvalJit);
702+
assertx(!Cfg::Jit::Enabled);
702703
// NB: Coeffects are already checked prior to here by `shouldAttemptToFold`
703704
return eval_cell(
704705
[&] {

hphp/hhbbc/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <folly/String.h>
3434
#include <folly/portability/Unistd.h>
3535

36+
#include "hphp/runtime/base/configs/jit.h"
3637
#include "hphp/runtime/base/configs/php7.h"
3738
#include "hphp/runtime/base/ini-setting.h"
3839
#include "hphp/runtime/base/runtime-option.h"
@@ -291,7 +292,6 @@ CONFIGS_FOR_REPOGLOBALDATA()
291292
gd.ModuleLevelTraits = RuntimeOption::EvalModuleLevelTraits;
292293
gd.TreatCaseTypesAsMixed = RO::EvalTreatCaseTypesAsMixed;
293294
gd.RenamableFunctions = RO::RenamableFunctions;
294-
gd.JitEnableRenameFunction = RO::EvalJitEnableRenameFunction;
295295
gd.NonInterceptableFunctions = RO::NonInterceptableFunctions;
296296
gd.StrictUtf8Mode = RuntimeOption::EvalStrictUtf8Mode;
297297

@@ -649,7 +649,7 @@ void process_init(const Options& o,
649649

650650
RO::Load(ini, config);
651651
RO::RepoAuthoritative = false;
652-
RO::EvalJit = false;
652+
Cfg::Jit::Enabled = false;
653653
RO::EvalLowStaticArrays = false;
654654
RO::RepoDebugInfo = false;
655655
Logger::LogLevel = Logger::LogError;

hphp/runtime/base/autoload-handler.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "hphp/runtime/base/array-init.h"
2121
#include "hphp/runtime/base/builtin-functions.h"
2222
#include "hphp/runtime/base/configs/autoload.h"
23+
#include "hphp/runtime/base/configs/server.h"
2324
#include "hphp/runtime/base/recorder.h"
2425
#include "hphp/runtime/base/replayer.h"
2526
#include "hphp/runtime/base/runtime-option.h"
@@ -232,7 +233,7 @@ AutoloadHandler::loadFromMapImpl(const String& clsName,
232233
bool ok = false;
233234
// Utility for logging errors in server mode.
234235
auto log_err = [](char const* const msg) {
235-
if (RuntimeOption::ServerMode) {
236+
if (Cfg::Server::Mode) {
236237
Logger::Error("Exception: AutoloadMap::loadFromMapImpl: %s", msg);
237238
}
238239
};

hphp/runtime/base/backtrace.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "hphp/runtime/base/array-init.h"
1919
#include "hphp/runtime/base/array-iterator.h"
2020
#include "hphp/runtime/base/bespoke-runtime.h"
21+
#include "hphp/runtime/base/configs/jit.h"
2122
#include "hphp/runtime/base/execution-context.h"
2223
#include "hphp/runtime/base/rds-header.h"
2324
#include "hphp/runtime/base/runtime-option.h"
@@ -389,7 +390,7 @@ Array createBacktrace(const BacktraceArgs& btArgs) {
389390
if (!frm) return bt;
390391
}
391392

392-
if (btArgs.m_skipInlined && RuntimeOption::EvalJit) {
393+
if (btArgs.m_skipInlined && Cfg::Jit::Enabled) {
393394
while (frm && frm.isInlined()) {
394395
frm = getPrevActRec(frm, visitedWHs);
395396
}

0 commit comments

Comments
 (0)