Add flags to run the PHP7 emitter from hhvm
commita7ac8b1c813f9385f4365bd266c25b5fb6a6c99d
authorJoseph Griego <jgriego@fb.com>
Mon, 3 Jul 2017 16:57:17 +0000 (3 09:57 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 3 Jul 2017 17:04:32 +0000 (3 10:04 -0700)
tree090fc8eb4419b02a518d455605667005ac66becf
parentaa0940bc3a7751f9258e03231e457ac3e62c39b8
Add flags to run the PHP7 emitter from hhvm

Summary:
Hijack the existing functionality used to shell out to hh_single_compile for
hack builds and use it for PHP7 builds too :) I wanted to keep the interface
the same as it is now for hackc builds; so this only adds two new runtime
flags:

- Eval.PHP7CompilerEnabled
- Eval.PHP7CompilerCommand

I reorganized vm/hack-compiler.{cpp,h} into vm/compiler.{cpp,h} and
parameterized everything by the compiler command.

This also includes changes to make the php7 emitter work like we expect
hh_single_compile in daemon mode to work. Those are pretty straightforward imo.

Unanswered questions include how we want to configure the miscellany around
running the compiler processes; there's a suite of options currently in place
for HackCompiler* but I wasn't sure if we want to duplicate those completely. I
also don't want to change the interface without people being on board.

Also made some hacky tweaks to the test runner to support this mode of operation.

Reviewed By: mofarrell

Differential Revision: D5322940

fbshipit-source-id: 94cb3daa24db735b9e7e831486bad9783537f0a2
12 files changed:
hphp/compiler/analysis/emitter.cpp
hphp/php7/compiler.cpp
hphp/php7/compiler.h
hphp/php7/php7.cpp
hphp/runtime/base/program-functions.cpp
hphp/runtime/base/runtime-option.h
hphp/runtime/vm/extern-compiler.cpp [moved from hphp/runtime/vm/hack-compiler.cpp with 60% similarity]
hphp/runtime/vm/extern-compiler.h [moved from hphp/runtime/vm/hack-compiler.h with 75% similarity]
hphp/test/php7-emitter/config.ini [new file with mode: 0644]
hphp/test/php7-emitter/hello.php [new file with mode: 0644]
hphp/test/php7-emitter/hello.php.expect [new file with mode: 0644]
hphp/test/run