Hack codegen: static closures, ordering of inline functions and classes
commit2c0e0bd36439d685f688ee398e6cb3f19717054c
authorAndrew Kennedy <akenn@fb.com>
Tue, 6 Jun 2017 09:45:15 +0000 (6 02:45 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 6 Jun 2017 09:57:53 +0000 (6 02:57 -0700)
tree7d5b267cb6f778c84ac04934e0b818bcccc37db4
parent070298d62028dd3dad26afe76c3f95899e13f255
Hack codegen: static closures, ordering of inline functions and classes

Summary:
We weren't generating the correct `DefCls`, `DefFunc` and `DefAlias` instructions when lambdas and inline classes or functions were mixed.
We now do. Most of the work is done during closure conversion, which now also hoists out inline classes and functions, leaving behind a
"stub" definition in order to generate the correct `DefCls` or `DefFunc` instruction.

Now that closure conversion just takes a `program` as input and produces a `program` as output, the operation of `hh_single_compile` is much simpler.

Reviewed By: hubyrod

Differential Revision: D5182055

fbshipit-source-id: b30e920af315b97395c4a0b50825dabdc6b8097e
20 files changed:
hphp/hack/src/hh_single_compile.ml
hphp/hack/src/hhbc/Hhas_parser_actions.ml
hphp/hack/src/hhbc/ast_constant_folder.ml
hphp/hack/src/hhbc/closure_convert.ml
hphp/hack/src/hhbc/closure_convert.mli
hphp/hack/src/hhbc/decl_vars.ml
hphp/hack/src/hhbc/emit_body.ml
hphp/hack/src/hhbc/emit_class.ml
hphp/hack/src/hhbc/emit_function.ml
hphp/hack/src/hhbc/emit_method.ml
hphp/hack/src/hhbc/emit_statement.ml
hphp/hack/src/hhbc/emit_typedef.ml
hphp/hack/src/hhbc/hhas_program.ml
hphp/hack/src/hhbc/hhbc_ast.ml
hphp/hack/src/hhbc/hhbc_hhas.ml
hphp/hack/src/hhbc/inline_defs.ml [deleted file]
hphp/hack/src/hhbc/instruction_sequence.ml
hphp/hack/src/hhbc/semdiff/diff.ml
hphp/test/hhcodegen_failing_tests_quick
hphp/test/hhcodegen_failing_tests_slow