Fix coeffect constants that are not runtime enforced
commit67f778c4332c6ac4d4f2d305d1012aa3ffe4aa22
authorOguz Ulgen <oulgen@fb.com>
Mon, 5 Jul 2021 20:57:11 +0000 (5 13:57 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 5 Jul 2021 20:58:52 +0000 (5 13:58 -0700)
tree827ddd7dfc65c51ee60268327bf0ae9caeadaa7c
parent2815e3f49a3feca59ab2ce08ef47285786131950
Fix coeffect constants that are not runtime enforced

Summary:
Previously, unrecognized coeffects would result as pure in the runtime, i.e.
```
const ctx T = [codegen];
```
would result in
```
const ctx T = [];
```
in the runtime. This diff makes it so that it now results as
```
const ctx T = [defaults];
```
This is done by transferring the name of the coeffect to the runtime and letting runtime make it defaults. This change will also allow adding reflection in the future.

Reviewed By: arnaudvenet

Differential Revision: D29550306

fbshipit-source-id: d77e552b890729a32f1b774292445f7af580b494
hphp/hack/src/hhbc/bytecode_printer/print.rs
hphp/hack/src/hhbc/hhbc_by_ref/emit_class.rs
hphp/hack/src/hhbc/hhbc_by_ref/hhas_coeffects.rs
hphp/test/slow/coeffects/codegen-1.php [new file with mode: 0644]
hphp/test/slow/coeffects/codegen-1.php.expectf [new file with mode: 0644]
hphp/test/slow/coeffects/codegen-1.php.opts [new file with mode: 0644]