From 4501db0143dae34324214b2a2f918b2a8d049810 Mon Sep 17 00:00:00 2001 From: Michael O'Farrell Date: Fri, 10 Mar 2017 11:31:45 -0800 Subject: [PATCH] Add no-jit option, and stat-cache option. --- base/HHVMDaemon.php | 10 ++++++++-- base/PerfOptions.php | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/base/HHVMDaemon.php b/base/HHVMDaemon.php index 7dde3e7..630c056 100644 --- a/base/HHVMDaemon.php +++ b/base/HHVMDaemon.php @@ -82,8 +82,6 @@ protected function getArguments(): Vector { 'Server.ErrorDocument404=index.php', '-v', 'Server.SourceRoot='.$this->target->getSourceRoot(), - '-v', - 'Eval.Jit=1', '-d', 'hhvm.log.file='.$this->options->tempDir.'/hhvm_error.log', '-d', @@ -91,6 +89,14 @@ protected function getArguments(): Vector { '-c', OSS_PERFORMANCE_ROOT.'/conf/php.ini', }; + if ($this->options->jit) { + $args->addAll(Vector {'-v', 'Eval.Jit=1'}); + } else { + $args->addAll(Vector {'-v', 'Eval.Jit=0'}); + } + if ($this->options->statCache) { + $args->addAll(Vector {'-v', 'Server.StatCache=1'}); + } if ($this->options->pcreCache) { $args->addAll( Vector {'-v', 'Eval.PCRECacheType='.$this->options->pcreCache}, diff --git a/base/PerfOptions.php b/base/PerfOptions.php index 48a236a..a09e655 100644 --- a/base/PerfOptions.php +++ b/base/PerfOptions.php @@ -74,6 +74,8 @@ final class PerfOptions { public bool $allVolatile = false; public bool $interpPseudomains = false; public bool $proxygen = false; + public bool $jit = false; + public bool $statCache = false; // // HHVM specific options for generating performance data and profiling @@ -135,7 +137,9 @@ public function __construct(Vector $argv) { 'wait-after-warmup', 'no-proxygen', 'no-repo-auth', + 'no-jit', 'no-file-cache', + 'stat-cache', 'pcre-cache:', 'pcre-cache-expire:', 'pcre-cache-size:', @@ -258,6 +262,8 @@ public function __construct(Vector $argv) { $this->noTimeLimit = $this->getBool('no-time-limit'); $this->waitAtEnd = $this->getBool('wait-at-end'); $this->proxygen = !$this->getBool('no-proxygen'); + $this->statCache = $this->getBool('stat-cache'); + $this->jit = !$this->getBool('no-jit'); $this->applyPatches = $this->getBool('apply-patches'); $fraction = $this->getFloat('cpu-fraction', 1.0); @@ -332,6 +338,7 @@ public function validate() { if ($this->php5) { $this->precompile = false; $this->proxygen = false; + $this->jit = false; $this->filecache = false; } if ($this->hhvm) {