Replace autoload_map.hdf with IndexJob
commite3098c3465e14de7c9d5d750f9392df1e4b3aaa7
authorEdwin Smith <smith@fb.com>
Wed, 3 Aug 2022 10:46:15 +0000 (3 03:46 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Aug 2022 10:46:15 +0000 (3 03:46 -0700)
tree4ef68cd0e42305a01a49d3ce9972e9ac8f22032b
parent507ab1bedbc4c22085cfa1f18e1e7dad620d0702
Replace autoload_map.hdf with IndexJob

Summary:
Currently hphpc requires a symbol->file index for parse-on-demand.
It gets this map from autoload_map.hdf, a huge config file generated
during the WWW build.

This diff refactors hphpc to add an indexing phase, which runs before
bytecode generation. The indexing phase computes Hack decls for every
autoload-eligible WWW file, and from that builds an index that replaces
autoload_map.hdf. Indexing shares a lot of code with parsing, so both
phases use their own instance of Package which determines which files
get indexed as well as owning a lot of intermediate state.

The computed decls are currently only used for indexing, but will soon
be used to by a new DeclProvider for bytecode generation.

The computed index replaces the use of autoload_map.hdf without adding a dependency on SQLFacts or native facts sql3 db.

Reviewed By: ricklavoie

Differential Revision: D37960849

fbshipit-source-id: 22ac4a6994286f2bd35b73b928ed4ae04887cf5f
hphp/compiler/compiler.cpp
hphp/compiler/option.cpp
hphp/compiler/option.h
hphp/compiler/package.cpp
hphp/compiler/package.h
hphp/hack/src/hackc/ffi_bridge/compiler_ffi.rs
hphp/runtime/ext/facts/ext_facts.cpp
hphp/util/extern-worker.h