Add Rx bits to the front-end.
commit95d6dc92c9a6dc79dbb3d3f462cc926c0b572f48
authorAlexey Toptygin <alexeyt@fb.com>
Wed, 19 Sep 2018 14:54:57 +0000 (19 07:54 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 19 Sep 2018 14:58:12 +0000 (19 07:58 -0700)
tree74c57f966388ecb1d6b6502c96add4b1e5546fdd
parent75e5cda9b99404709bb6d2243c2f1f24caf40c19
Add Rx bits to the front-end.

Summary:
Add a new header file for Rx-related code, define an enum with the possible Rx states of a func in it.
Move some function attr bits around to make a contiguous 3-bit hole. Put bits in it that can represent the valid states of the Rx enum. Add code for converting from attr bits to values of the enum.
Teach the [dis]assembler about these bits, and validate the bits in the assembler. Teach the func pretty-printer to show them.
Teach the frontend to convert Rx attributes to Rx bits in hhas. Make it copy Rx bits onto memoize wrappers. Inout/byref wrappers will be handled in a later diff, for now they are all non-Rx.
Add test for invalid combinations of bits in .hhas. Tests of invalid combinations of Rx attributes in the hack input are on the previous diff in the stack.

Reviewed By: jano

Differential Revision: D9828340

fbshipit-source-id: 355bffcedf6cc7a16da7867193bac2e89a112655
24 files changed:
hphp/hack/src/hhbc/Hhas_parser_actions.ml
hphp/hack/src/hhbc/emit_attribute.ml
hphp/hack/src/hhbc/emit_class.ml
hphp/hack/src/hhbc/emit_function.ml
hphp/hack/src/hhbc/emit_inout_function.ml
hphp/hack/src/hhbc/emit_memoize_function.ml
hphp/hack/src/hhbc/emit_memoize_method.ml
hphp/hack/src/hhbc/emit_method.ml
hphp/hack/src/hhbc/hhas_function.ml
hphp/hack/src/hhbc/hhas_method.ml
hphp/hack/src/hhbc/hhas_parser.mly
hphp/hack/src/hhbc/hhbc_hhas.ml
hphp/hack/src/hhbc/rx.ml [new file with mode: 0644]
hphp/runtime/base/attr.h
hphp/runtime/vm/as-shared.cpp
hphp/runtime/vm/as.cpp
hphp/runtime/vm/func.cpp
hphp/runtime/vm/rx-inl.h [new file with mode: 0644]
hphp/runtime/vm/rx.h [new file with mode: 0644]
hphp/runtime/vm/verifier/fuzzer/fuzzer.ml
hphp/test/slow/rx/invalid_attrs1.hhas [new file with mode: 0644]
hphp/test/slow/rx/invalid_attrs1.hhas.expectf [new file with mode: 0644]
hphp/test/slow/rx/invalid_attrs2.hhas [new file with mode: 0644]
hphp/test/slow/rx/invalid_attrs2.hhas.expectf [new file with mode: 0644]