Allocate coeffect bits from pure towards unreachable
commitdc5fa34ed1f4257eead3260969f9ede764dbd203
authorOguz Ulgen <oulgen@fb.com>
Sat, 17 Jul 2021 00:49:56 +0000 (16 17:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 17 Jul 2021 00:51:48 +0000 (16 17:51 -0700)
treede2bdb020eb833ba0c539a37b8abe78642df2637
parentd7feae8b97bc63b292155ae760dd50359d3a059e
Allocate coeffect bits from pure towards unreachable

Summary:
This diff makes it so that
1) Each capability is positively given, i.e. ability to do something now gets a 1 bit instead of inability to do something previous getting 1 bit
2) COMMA separated coeffects now work as intended instead of getting promoted to the parent context

In order make sure `policied_of` cannot call `policied_shallow` and `policied_local`, I kept the escaping bit of `policied_of` in the runtime but it is not user denotable.

Reviewed By: jano

Differential Revision: D29521836

fbshipit-source-id: 3ce736e7db969623a8e41d4ef8a9aa4984a541bf
16 files changed:
hphp/runtime/base/coeffects-config.cpp
hphp/runtime/base/coeffects-config.h
hphp/runtime/vm/act-rec-inl.h
hphp/runtime/vm/class.cpp
hphp/runtime/vm/coeffects.cpp
hphp/runtime/vm/coeffects.h
hphp/runtime/vm/func-emitter.cpp
hphp/runtime/vm/func-inl.h
hphp/runtime/vm/func.h
hphp/runtime/vm/interp-helpers.h
hphp/runtime/vm/jit/irgen-coeffects.cpp
hphp/runtime/vm/jit/irgen-func-prologue.cpp
hphp/runtime/vm/jit/irgen-internal.h
hphp/runtime/vm/preclass-emitter.cpp
hphp/test/slow/coeffects/mix-1.php.expectf
hphp/test/slow/coeffects/policied/call-enforcement-1.php.expectf